[pygtk] How to destroy Window hierarchy and corner cases

Alessandro Dentella sandro at e-den.it
Sat Dec 5 02:20:43 WST 2009


Hi,

  I have an application that writes to StatusBar and uses timeout_add to
  delete the message after a fixed number of seconds.

  If in the meanwhile I destroy() the toplevel window I notice that under
  Linux I get the following message:

/home/misc/src/hg/py/sqlkit/sqlkit/layout/layout.py:661: GtkWarning: gtk_label_set_text: assertion `GTK_IS_LABEL (label)' failed
  msg_id = sb.push(idx, txt)
/home/misc/src/hg/py/sqlkit/sqlkit/layout/layout.py:669: GtkWarning: gtk_label_set_text: assertion `GTK_IS_LABEL (label)' failed
  sb.remove(idx, msg_id)

  Under Windows sometimes it just crashed the application.

  
  The problem is that when I receive a delete-event from a window, I
  destroy() it but the children are not really destroyed, e.g., with
  ipython you can still browse all its methods. The difference is that
  get_toplevel() will return the widget itself rather than the toplevel.

  
  Which is the correct/suggested way to destroy all elements of a hierarcy
  of widgets upon delete-event?


  TIA
  sandro
  *:-)



-- 
Sandro Dentella  *:-)
http://sqlkit.argolinux.org        SQLkit home page - PyGTK/python/sqlalchemy


More information about the pygtk mailing list