Tkinter and "jumpiness"

klappnase klappnase at web.de
Sat Jun 19 18:57:14 EDT 2004


Douglas Alan <nessus at mit.edu> wrote in message news:<lc1xkc5ysq.fsf at gaffa.mit.edu>...
> 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.
> 

Have you tried useing wait_visibility() on the frame like this:

frame .wait_visibility(last_widget_that_is_created)
frame.pack()

I *think* from what you are writing this should solve your problem (if
I
understand you correctly).

> 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.
> 
(...)
> |>oug

I had a similar problem with a widget with automatic scrollbars I
wrote; the fix
that worked for me was not to pack() the scrollbar within the
mega-widget's
__init__ method; I did the packing/unpacking from within the widget's
xscrollcommand that looks like this:

def _hscroll(self, *args):
        self.hbar.set(*args)
        if self.hbar.get() == (0.0, 1.0):
            self.hbar.grid_forget()
        else:
            self.hbar.grid(row=1, column=0, columnspan=2, sticky='ew')

Within the widget's __init__ I just callled self.hbar.set(0.0, 1.0)
and could avoid the initial showing up of the scrollbar.


I hope this helps

Michael



More information about the Python-list mailing list