tkinter question

Eric Brunel eric_brunel at despammed.com
Thu Mar 30 03:24:10 EST 2006


(Please quote a part of the message you're replying to; I had problems  
figuring out you were replying to my post...)

On 29 Mar 2006 14:08:02 -0800, <linuxnooby at yahoo.com.au> wrote:
> Ultimately what I am trying to is create a public computer session
> manager.
>
> 1) User logs in and main application window is withdrawn (easy)
> 2) After (for example) 55 minutes - a warning window/dialoguebox
> "session will end in 5 minutes"
> 3) With 30 seconds to go  - a warning window/dialoguebox "session will
> end in 30 seconds"
> 4) User logged out (easy)
>
> I am having problems with steps 2 and 3
> Either the window/dialoguebox  will
> (a) pause the program execution upon display waiting for user input
> or (b) both warnings display together when application has finished.
>
> What I want want is a window/dialogue box that will not halt
> application logic, and will display immediately.

But what does it do between steps 1 and 2? Is Python/Tkinter still in  
control, or are you running some external program, or something else?

As for the dialogue box pausing the program execution waiting for user  
input, you're probably using the "built-in" show* or ask* functions from  
the tkMessageBox module that are designed to be modal. If you just create  
a Toplevel and populate it with widgets, it will just display once the  
control is returned to the Tkinter mainloop and no user input will be  
needed. But the control *has* to return to the mainloop, or the window  
won't show up. One acceptable workaround may be to call the "update"  
method on the Toplevel, but it may depend on what you do between steps 1 &  
2.

HTH
-- 
python -c "print ''.join([chr(154 - ord(c)) for c in  
'U(17zX(%,5.zmz5(17l8(%,5.Z*(93-965$l7+-'])"



More information about the Python-list mailing list