Python GUI wrapper for a long operation

Cameron Laird claird at lairds.com
Wed Apr 21 10:50:55 EDT 2004


In article <mailman.831.1082550203.20120.python-list at python.org>,
Jeff Epler  <jepler at unpythonic.net> wrote:
>To interleave calculation and GUI activity in the same thread, simply
>call the "update_idletasks" or "update" method on any Tk widget at
>intervals.
			.
		[much useful detail]
			.
			.
Yes and no.

First, I want readers to know that they're lucky.  Jeff's
*good* with Tkinter, among other things Pythonic, and I
always seek out his postings for their valuable content.

I have particular experience that obliges me to supplement
his counsel in specialized areas.  The proposition above
is slightly fragile in the vicinity of "simply".  Some
developers never seem to "get the hang" of update().  
Update() itself has subtleties, and a significant number
of developers like to rework our designs to avoid it; as 
it turns out, it's possible and desirable in general to
rewrite update() uses in terms of transformed, event-oriented 
segments.  Finally, there are some "long operation[s]"
that simply are not compatible with the Tcl-based event-
orientation behind update().

While I'm sure Fredrik has written on at least some of these
matters, I'll not make the time now to track down his essays.
For the moment, I recommend the Tcl-targeted <URL:
http://wiki.tcl.tk/1526 >, which I think those with an
interest in intermediate Tkinter topics find readable.
-- 

Cameron Laird <claird at phaseit.net>
Business:  http://www.Phaseit.net



More information about the Python-list mailing list