[wxPython-users] please help with drawing

Christopher Barker Chris.Barker at noaa.gov
Tue Mar 6 11:48:53 PST 2007


Robin Dunn wrote:
> Christopher Barker wrote:
>> a few comments:
>>
>> 1) In your OnPaint, you need to use a wx.PaintDC, not a wx.ClientDC. 
>> It should be:
>>
>>     def OnPaint(self,event):
>>         dc=wx.PaintDC(self.panel)
>>         self.DrawMote(dc)

I did think it was very weird that self.panel was set to parent, but 
didn't notice carefully what exactly was being drawn!

> This will still cause problems on Windows.  If you don't create a 
> PaintDC for the window that received the EVT_PAINT then Windows will

I also re-bound the PaintDC. It worked on OS-X, but, working or not, I 
don't think it's a good structure!

-CHB

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the wxpython-users mailing list