Tk Canvas objects - Deletable?

Zsolt Hever never at mail.matav.hu
Thu May 13 07:22:33 EDT 1999


Randall wrote:
>.... I want to delete the Canvas Group without nuking the Canvas.  (FWIW,
the Group object still doesn't get deleted when you delete the canvas.)
...

I have watched your immortal.py code.
I browsed the dict by PTUI (Script/Browse variables) to figure out  where
the objects of immortal.py are registered. I read An Introduction to
Tkinter (Part: Hello, Again) by Fredrik Lundh and found there the
following:
"Tkinter automatically maintains a widget tree (via the master and children
attributes of each widget instance), so a widget won't disappear when the
application's last reference goes away; it must be explicitly destroyed
before this happens (using the destroy method)."
I think and my idea is that the group (or also the Group)  must be
destroyed because its Tk instance behaviour, but the group reference can be
deleted by the "del" from the namespace dictionary. See the code.
I hope that someone will give you the real explanation and correct my idea.

Zsolt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: immortal.py
Type: application/octet-stream
Size: 1783 bytes
Desc: immortal (Python File)
URL: <http://mail.python.org/pipermail/python-list/attachments/19990513/0c95c556/attachment.obj>


More information about the Python-list mailing list