[Tutor] Simple Tkinter question (fwd)
dyoo at hkn.eecs.berkeley.edu
Fri Oct 7 19:40:27 CEST 2005
[Keeping Tutor in CC]
---------- Forwarded message ----------
Date: Fri, 7 Oct 2005 01:25:26 -0700 (PDT)
From: Mike Cheponis <mac at Wireless.Com>
To: Danny Yoo <dyoo at hkn.eecs.berkeley.edu>
Subject: Re: [Tutor] Simple Tkinter question (fwd)
On Fri, 7 Oct 2005, Danny Yoo wrote:
> Ok, that works too. Another variation on your approach is the
> update_idletasks() method, which like update() should handle all the
> graphic-updating commands that are queued up for the GUI. There's a
> little more in:
Yeah, the instant after I sent you that msg, I tried update_idletasks and it worked, too, so I switched to using that.
Thanks, very helpful.
> that talks about what kind of GUI tasks are considered "idle", and when
> you might want to call update() or update_idletasks().
> The issue with update() is that while the program is sleeping, GUI
> interaction, like button presses, will be ineffective, since we're still
> not relinquishing control back to the GUI.
> This may or may not be a problem for you. You've probably seen programs
> in the real world whose GUIs lag and drag when they do a lot of work. If
> that kind of program behavior annoys you, then you'll probably want to
> search for another solution in your own programs. *grin*
Yeah, one of those references says to _insert_ calls to update_idletasks to get the GUI to be more responsive.
I wish I understood Tkinter better; I've looked at most of the on-line stuff, and I think I have every Python book ever printed, but some Tk stuff still seems mysterious.
well, after I deliver this one program with Tk, I think I'm going to switch to wxPython for future GUI front-ends.
More information about the Tutor