Tkinter destroy() or quit()

Egbert Bouwman egbert at bork.demon.nl
Mon Jul 1 09:44:13 EDT 2002


Hello,
In Tkinter destroy() destroys a widget, and quit() exits the mainloop.
However if I replace in the following script the callback by 
root.destroy, the effect is the same:
the button disappears and the mainloop exits.

    #!/usr/bin/python
    from Tkinter import *

    root=Tk()
    button=Button(root,text='STOP',command=root.quit)
    button.grid(row=0,column=0)
    root.mainloop()

    print "This the end"
    
Intuitively it doesn't look strange in this case.

I would like to know more about their effects:
when (not) to use the one or the other one,
when do they bite or complement each other,
and especially, what about these two and nested mainloops.
egbert
-- 
Egbert Bouwman - Keizersgracht 197 II - 1016 DS  Amsterdam - 020 6257991
========================================================================





More information about the Python-list mailing list