[wxPython-users] Drawing.... drawing?
Christopher Barker
Chris.Barker at noaa.gov
Tue Aug 21 09:58:34 PDT 2007
Javier Castrillo wrote:
> Hi, simply I can't make a simple drawing in a window. I googled,
> searched but I can't do it anyway.
Did you try the Wiki? Do a title search for "Drawing", and you'll get a =
bunch of references.
http://wiki.wxpython.org/?action=3Dfullsearch&context=3D180&value=3DDrawing=
&titlesearch=3DTitles
Here's a short lesson however.
The system sends a "Paint" event whenever the window needs to be =
re-paninted, so you need to make sure you bind to that event, and paint =
your window there. In your code, you're drawing to the Window, and then =
Show()ing it -- when it is shown, it needs to be re-drawn, but you're =
not doing that. To do that, you need a custom Panel (or Frame, or =
Window), in which you have bound and handled the paint event.
See enclosed sample.
-- =
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: junk.py
Type: text/x-python
Size: 805 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20070=
821/faffb772/junk.py
More information about the wxpython-users
mailing list