Tkinter widget.upate() returns when?

Nick Collier nick at src.uchicago.edu
Fri Aug 18 14:15:10 EDT 2000


Hi,

Does the widget update() method return after all the callbacks, redraws,
etc. are
completed, or does it merely tell callbacks to be processed, start
redrawing, etc., and then return. I think the former, but I need to be
sure. In addition, does it
provide time for the os to post any pending key presses, mouse clicks
and so forth to whatever tk uses for an event queue.

My situation is that I'm showing frames of an animation, and need the
user to press a key when they think they see a certain frame. The delay
between frames can be quite small, and I need to be sure that the key
press and the display of the frames is in synch. That is, I need to be
sure that any key presses that have occured while a frame is being
displayed are processed before the next frame is displayed. Is calling
update() after drawing the frame enough? I'm worried this might not
account for any lag in the os posting key events to the event queue.

thanks very much,

Nick

-- 
Nick Collier
Social Science Research Computing
University of Chicago
http://repast.sourceforge.net



More information about the Python-list mailing list