I have a python object owning a widget and implementing a signal
handler, lets say:

  class MyObject:
    ...
    self.button = gtk.Button(title)
    self.button.connect('clicked', self.on_clicked, None)
    ...

Deleting instances of MyObject does not have effect until the signal
handler is disconnected (either by calling disconnect or by deleting
self.button).  Is there any workaround for this?  I can see where the
reference is incremented in pygobject but I do not know if it can get
unreffed at the delete of callback without disconnecting it first.
Can weak references be used here?

The problem in the example above is not bad but it gets a bit tricky
when the user interface is very dynamic and {py,pyg}objects/callbacks
are used for very short lived objects (like for animations with
libclutter).

--
Tero
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to