[Tkinter-discuss] How to dettach a Toplevel

Michael Lange klappnase at web.de
Thu Nov 30 22:46:09 CET 2006

On Thu, 30 Nov 2006 09:35:22 -0800 (PST)
Sorin Schwimmer <sxn02 at yahoo.com> wrote:

> Mainloop is included.  Basically, the daemon starts a thread that waits for KDE, and does its
> job in the main thread. The function that is started looks like this:

This sounds like you try to start Tk from a child thread ?
I guess that is something one should never do; maybe you could change
this, so Tk runs in the main thread and the job in the child thread.

I hope this helps


> def inittk():
>   global rtk
>   while True:
>     sleep(60)
>     try:
>       rtk=Tk(screenName=':0.0')
>     except:
>       continue
>     break
>   rtk.mainloop()
> I omitted labels, entries, the undecoration, withdrawal... but I guess you have the idea of what I
> try to accomplish.
> The only thing that goes to my mind is that I start mainloop, but then, as the function and the thread are going out of scope, they take mainloop with them.
> Pointers are welcomed...
> Thanks,
> Sorin
> ____________________________________________________________________________________
> Do you Yahoo!?
> Everyone is raving about the all-new Yahoo! Mail beta.
> http://new.mail.yahoo.com

More information about the Tkinter-discuss mailing list