Too many Configure events

Matthew Dixon Cowles matt at mondoinfo.com
Sat Jan 5 04:28:31 CET 2002


On Fri, 4 Jan 2002 16:14:47 -0700, Bob Greschke <bob at passcal.nmt.edu>
wrote:

>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.  How can I detect (within the Configure handler
>would be nice) that the user still has the mouse button pressed and
>to ignore the Configure event?  Detecting things like
>ButtonPress/ButtonRelease and setting a flag doesn't seem to do it
>(those events don't show up).

Dear Bob,
I'm not too surprised that your app don't see the click events. Since
the clicks are in the window's border, those events are going to the
window manager, not your app. It might work to use after() to set a
timer of a few hundred milliseconds and only do the redraw when the
timer is done. You could either reset the timer after each configure
event and so only do the redraw when the window's size hadn't changed
for some time or you could not set the timer if it was already set and
so only do the redraw every once in a while rather than constantly.

Regards,
Matt



More information about the Python-list mailing list