Hi,
On Tue, 27 Apr 2010 15:44:39 -0700
Guido Carballo-Guerrero <[email protected]> wrote:
> How can I get back into a while loop if I go to a new pop-up toplevel
> window, that is created when I press one button.
>
> I'm attaching a sample of the code that I'm trying to make. The
> problem that I have is that after the button is press and the new
> toplevel window, what ever is inside of the while loop doesn't do
> anything anymore. Is as if I got out of the while loop.
>
> Is there a way in which I can get back into the while loop once the
> toplevel window is destroy?
>
> Guido
>
(...)
> def new():
> root2 = Tkt.Toplevel()
>
> def ask_quit2():
> root2.destroy()
>
> root2.protocol("WM_DELETE_WINDOW", ask_quit2)
>
> L1 = ttk.Label(root2)
> L1.config(text = 'Window2')
> L1.pack()
>
> root2.mainloop()
^^^^^^^^^^^^^^^^
The second call to mainloop() is the problem, just remove it and
everything will work as expected. mainloop() must only be called
once per application (for the main Tk() window).
I hope this helps
Michael
_______________________________________________
Tkinter-discuss mailing list
[email protected]
http://mail.python.org/mailman/listinfo/tkinter-discuss