[wxPython-users] Re: drawing lines
Christopher Barker
Chris.Barker at noaa.gov
Tue Jul 11 10:37:27 PDT 2006
Gabriel Murray wrote:
> Is this heading in the right direction? RIght now I'm not getting any
> output at all, but am wondering if this is basically the right idea.
You're close. You want to bind the EVT_PAINT to the panel, not the
buffer. The buffer is a wx.Bitmap, which doesn't get any events.
self.panel.Bind(EVT_PAINT, self.onPaint)
However, your first approach was better. You did all the drawing to a
buffer in a separate method. All you needed to do was draw the buffer to
the Screen in the onPaint method.
See the Wiki entries I pointed you to in a previous post, and also this one:
http://wiki.wxpython.org/index.cgi/wxPython_Style_Guide
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (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