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")
Fredrik Lundh schreef op de 16e dag van de slachtmaand van het jaar 2005:
> Peter Kleiweg wrote:
>
> > I want the program to behave identical if the 'close' button of
> > the application window is clicked. I tried the code below,
> > using a class derived from Tk that redefines the destroy
> > me
Peter Kleiweg wrote:
> I want the program to behave identical if the 'close' button of
> the application window is clicked. I tried the code below,
> using a class derived from Tk that redefines the destroy
> method. That seems to work. At least on Linux.
>
> My questions:
>
> Is this the correct
I have an application written in Tkinter. There is a menu item
'quit' that calls the function 'quit'. If 'quit' is called, it
first checks if there is unsaved data. If there is, it won't let
the application exit unless you confirm to disregard the
changes.
So far, so good.
I want the program