Too many Configure events

Bernhard Herzog bh at intevation.de
Sat Jan 5 10:34:07 EST 2002


"Bob Greschke" <bob at passcal.nmt.edu> writes:

> I have a Tkinter program that draws a graph.  If the user grabs a
> corner of the frame and resizes it I use the Configure event to clear
> and redraw the graph.  In (UNIX/Solaris) OpenWindows, and FVWM, one
> Configure event gets generated when the user releases the mouse
> button.  But Gnome generates Configure events while the user is
> resizing the frame. 

The best way to handle this is to only redraw in idle time, i.e. when no
more unhandled events are in the queue. Basically, everytime the
window's contents become invalid you add an idle handler which will
start the redraw. Since there can be several events that require a
redraw before the program gets idle, you should check whether you
already started the idle handler.

  Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Sketch                                 http://sketch.sourceforge.net/
MapIt!                                               http://mapit.de/



More information about the Python-list mailing list