[pygtk] Safely remove widgets

Tobias Weber towb at celvina.de
Fri Sep 3 18:44:58 WST 2010


Hi,
having a custom widget remove itself from a VBox does not always work :(

class MyEntry(gtk.Entry):

    def remove(self):
        self.get_parent().remove(self)

    def on_focus_out(self, widget, event):
        # Works
        self.remove()

    def on_icon_release(self, widget, icon_pos, event):
        # Works
        self.remove()

    def on_activate(self, widget):
        # Bus error!
        self.remove()



More information about the pygtk mailing list