Re: new Tkinter

Guido.van.Rossum@cwi.nl
Wed, 22 Jun 1994 09:21:43 +0200

> (having pressed the OK button), that the "msg" and "accept" widgets
> would have been GC'ed upon exit from tktest.message, which their being
> the only ones hanging on to "top" would have caused it to be GC'ed,
> which would cause the window in which they were all displayed to be
> GC'ed and disappear. No such luck.

No -- you will have to do an explicit top.delete() in the function.
In the next version (which will keep a map of children) this will be
even truer. In Python, garbage collection can often not be trusted to
do the right thing -- there are too many ways a pointer to a frame can
end up in a stack trace (e.g. sys.exc_traceback and
sys.last_traceback) etc.

Note that deleting the top of a widget tree, in Python as in Tcl, will
delete all subordinate widgets (to answer an earlier question).

--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>