Desrtuctor WOES, was Advice on __del__

Fredrik Lundh fredrik at pythonware.com
Sun May 15 06:23:59 EDT 2005


"phil" wrote:

> SO: without significant rewrite of each class such as triangle
> and line, how can I ensure those canvas lines get deleted?
> You don't really need to understand Canvas, just trust me
> I have to delete those objects and they are not properties of the
> class which go away with garbage collection.

well, I think you're asking the wrong person: I wouldn't use a Canvas
in the first place.  instead, I'd update the screen based on the current
contents of the data structure:

    http://effbot.org/zone/wck-3.htm

(see the "A Simple Canvas Widget" example, and the "Using the
ui_doublebuffer flag" modifications)

</F>






More information about the Python-list mailing list