List Info

Thread: How to dettach a Toplevel




How to dettach a Toplevel
user name
2006-11-29 20:02:58
Hi Michael,

While the two toplevel solution will work nicely, I'm not sure how would I close the main application (at one point I want to be able to do so).

As for the other suggestion, that was my first approach, but it doesn't work. I don't know why,
and sometime I'll have to find out, as I'll need later in my project.

What happens is that when the users logs in (no authentication required) I have a small script in
KDE Autostart to issue an
xhost local:root
allowing the daemon to show his stuff.

The daemon waits until KDE is up and running and xhost was executed, then it does a
root=Tk(screenName=':0.0')

Nothing comes on. If I fire up a Python interpreter and do the things manualy, it works
flawless: I have a graphic window controlled by root, can populate it, withdraw it, iconify it,
destroy it... It proves that from an X server standpoint things are set correctly, but my daemon does something wrong (it may be that the window is created and destroyed immediately, I don't know).


Thanks for your ideas, and give me more if possible
Sorin

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
How to dettach a Toplevel
user name
2006-11-29 21:55:02
Sorin Schwimmer wrote:

> The daemon waits until KDE is up and running and xhost
was executed, 
> then it does a
> root=Tk(screenName=':0.0')
> 
> Nothing comes on. If I fire up a Python interpreter and
do the things 
> manualy, it works
> flawless: I have a graphic window controlled by root,
can populate it, 
> withdraw it, iconify it,
> destroy it... It proves that from an X server
standpoint things are set 
> correctly, but my daemon does something wrong (it may
be that the window 
> is created and destroyed immediately, I don't know).
> 

Do you also start the mainloop in your daemon ?

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

_______________________________________________
Tkinter-discuss mailing list
Tkinter-discusspython.org
http://mail.python.org/mailman/listinfo/tkinter-discuss
How to dettach a Toplevel
user name
2006-11-30 10:17:03
Hi Sorin,

> 
> While the two toplevel solution will work nicely, I'm
not sure how would I close the main application (at one
point I want to be able to do so).
> 

As a second thought, you actually do not need two Toplevel
windows, you simply
could withdraw the main gui window instead of closing it
when the user hits the
"close" button (use:
root.protocol("WM_DELETE_WINDOW", root.withdraw)).
This way the popup Toplevel window is still alive after the
user has "closed" the app
and can do what it is supposed to. If you want to restore
the main gui later,
there might be a menu or something in the popup window or
maybe a lock file
to make sure the app will be started only once.

> As for the other suggestion, that was my first
approach, but it doesn't work. I don't know why,
> and sometime I'll have to find out, as I'll need later
in my project.
> 
> What happens is that when the users logs in (no
authentication required) I have a small script in 
> KDE Autostart to issue an
> xhost local:root
> allowing the daemon to show his stuff.
> 
> The daemon waits until KDE is up and running and xhost
was executed, then it does a
> root=Tk(screenName=':0.0')
> 
> Nothing comes on. If I fire up a Python interpreter and
do the things manualy, it works
> flawless: I have a graphic window controlled by root,
can populate it, withdraw it, iconify it,
> destroy it... It proves that from an X server
standpoint things are set correctly, but my daemon does
something wrong (it may be that the window is created and
destroyed immediately, I don't know).
> 
> 

Hm, sorry, besides what John suggested, no further ideas
here.

Michael
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discusspython.org
http://mail.python.org/mailman/listinfo/tkinter-discuss
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )