Tkinter and "jumpiness"

Douglas Alan nessus at mit.edu
Fri Jun 18 17:41:41 EDT 2004


Is it possible to double-buffer frame rendering with Tkinter?  I'm
writing a GUI app using Tkinter and the GUI police around here are
complaining about the interface being too "jumpy" at times.  If I
could have the frame rendered offscreen and only put onto the screen
once it has completely finished being rendered, then this would solve
the problem.

One culprit in the jumpiness is a megawidget that I am using that
initially displays a scrollbar and then a fraction of a second later
removes the scrollbar when it realizes that it is not necessary.

To eliminate the jumpiness, I've tried packing all the widgets into
the frame before packing the frame into the app, but that doesn't help
much.  I've noticed, however, that if I pack the frame into the app,
unpack the frame (with the forget() method), and then repack it into
the app, on the repacking, the frame does not get get rendered in a
"jumpy" fashion -- even if the frame is being rendered into a
differently-sized area.  This suggest that a lot of work is done on
the first packing that gets cached somewhere so that it doesn't have
to be redone on the repacking.  Perhaps then an alternative to double
buffering the frame, if that is impossible, would be if I could
somehow get the frame to do all of that work that it currently does on
the first pack *before* the first pack, so the first pack would
display in the manner that subsequent packs do now.

|>oug



More information about the Python-list mailing list