[Tutor] Tkinter, widgets not displaying...

Hugo González Monteverde hugonz-lists at h-lab.net
Fri Feb 10 07:25:57 CET 2006


Sorry for replying to myself, but I found a page that says that it can 
be done without threads... so it hit me: use threads!!! (duh)

Ok, for future reference, this is the part where I use the classes I 
defined:

if __name__ == "__main__":
     top = Tkinter.Tk()
     myturns = TurnQueue(top, pw=200, ph=100, panels=4)

     #importing here is ugly, but just for testing.
     from thread import start_new_thread

     start_new_thread(Tkinter.Tk.mainloop, (top,))
     for i in range(10):
         myturns.insert(str(i))
         sleep(0.2)

So now I see my line of canvases displaying numbers going upwards..

Hugo


More information about the Tutor mailing list