A
wxPaintDC
must be constructed if an application wishes to paint on the client
area of a window from within an EVT_PAINT() event handler. This should
normally be constructed as a temporary stack object; don't store a
wxPaintDC object. If you have an EVT_PAINT() handler,
you must create a wxPaintDC object within it even if you don't actually use it.
如果使用EVT_PAINT()分配paint事件處理函數(shù),
一定要在處理函數(shù)里創(chuàng)建一個(gè)wxPaintDC臨時(shí)變量。否則程序會Halt。