[Tutor] Tkinter, widgets not displaying...

Kent Johnson kent37 at tds.net
Fri Feb 10 14:32:18 CET 2006


John Fouhy wrote:
> If you want to do multithreaded programming with a GUI, one good way
> is to use .after_idle.
> 
> ie, instead of myturns.insert(str(i)), do
> top.after_idle(myturns.insert, str(i))  (I think this is the right
> syntax).  This will cause the mainloop thread to run the code instead.

Another way to do this without a separate thread is to use top.after() 
to schedule the inserts. Schedule the first one before calling 
mainloop(), and have each insert schedule the next one.

Kent



More information about the Tutor mailing list