wxPython - drawing without paint event

glenn.chappell at gmail.com glenn.chappell at gmail.com
Fri Aug 10 21:42:47 EDT 2007


On Aug 10, 1:40 am, 7stud <bbxx789_0... at yahoo.com> wrote:
> On Aug 9, 7:46 pm, Matt Bitten <mbitte... at yahoo.com> wrote:
>
> > I've got a wxPython program that needs to do some drawing on a DC on a
> > regular basis.... And there is no event,
> > so my code doesn't get called. What do I do?
>
> Then the event is: "on a regular basis", i.e. the passage of time.
> You can use a wx.Timer to create events at regular intervals, which
> your code can respond to:
> ...

Thanks!

On a related topic, it seems like it would be nice to do *all* drawing
in
response to paint events. When I get an event from the timer, I would
just tell wx that part of the window needs redrawing, and depend on it
to give me a paint even when nothing of higher priority needs to be
done.
I've seen this kind of logic recommended in other GUI tookits. Is it a
good idea in wxPython, and, if so, how does one do it?




More information about the Python-list mailing list