Quitting a Tkinter application with confirmation

jepler at unpythonic.net jepler at unpythonic.net
Wed Nov 16 20:56:23 EST 2005


Sure, there's a difference.  Consider how this program behaves.
Quit only quits the mainloop, Destroy destroys the root widget.
When you Quit, you can enter the mainloop again.

from Tkinter import *
t = Tk()
Button(t, command=t.quit, text="Quit").pack()
Button(t, command=t.destroy, text="Destroy").pack()
t.mainloop()
t.mainloop()

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20051116/4976bd1e/attachment.sig>


More information about the Python-list mailing list