Tk's default Toplevel - counterintuitive

Fredrik Lundh fredrik at pythonware.com
Fri Aug 20 11:33:34 EDT 1999


Guido van Rossum <guido at cnri.reston.va.us> wrote:
> > > root.protocol("WM_DELETE_WINDOW", root.quit)
> > 
> > how about making the destroy variant the
> > default?
> 
> Good idea.  I've thought of this before, and somehow never got to it.

footnote: someone just pointed out that my Tkinter
introduction says:

...

    as of version 1.63, Tkinter will not destroy the corresponding
    widget instance hierarchy, so it is a good idea to always register
    a handler yourself:

        top = Toplevel(...)

        # make sure widget instances are deleted
        top.protocol("WM_DELETE_WINDOW", top.destroy)

    Future versions of Tkinter will most likely do this by default.

    FIXME: has this been changed in Python 1.5.2?

...

</F>





More information about the Python-list mailing list