Re: seperate main loop with Tkinter.

Guido.van.Rossum@cwi.nl
Wed, 01 Mar 1995 15:40:02 +0100

> I'm curious - how do people cope with Tkinter, if you want to loop in
> your own command loop, and not in Tkinter's mainloop(). I've been either
> making it a seperate process or using the after() function of Tk to do
> one run of whatever it is that I wanted done, then rescheduling it with
> after() again - any other better suggestions?

I haven't tried it, but the current version has a "dooneevent()"
function which seems to do what you want -- simply call it often
enough in your other code and the Tk widgets will appear to be fully
interactive. Of course if your other command loop blocks waiting for
input from somewhere else, this won't work -- there it's probably
better to use select (and Tk supports select using
"createfilehandler()").

--Guido van Rossum, CWI, Amsterdam <mailto:Guido.van.Rossum@cwi.nl>
<http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>