diff options
author | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2008-09-18 12:12:18 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2008-09-18 12:50:58 (GMT) |
commit | f2a8948bf15a5e669f02aa26d1e267ad11cb0ac8 (patch) | |
tree | 786e82cb194a74437f8eb9f1463914ac161fcca3 /src/sugar/graphics/toolbutton.py | |
parent | 1ab0c678302754174e4594eae4c280b90096e765 (diff) |
#8485 Detach from palette when a widget is destroyed
Diffstat (limited to 'src/sugar/graphics/toolbutton.py')
-rw-r--r-- | src/sugar/graphics/toolbutton.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sugar/graphics/toolbutton.py b/src/sugar/graphics/toolbutton.py index 715e7a9..a80c67a 100644 --- a/src/sugar/graphics/toolbutton.py +++ b/src/sugar/graphics/toolbutton.py @@ -68,6 +68,12 @@ class ToolButton(gtk.ToolButton): self.get_child().connect('can-activate-accel', self.__button_can_activate_accel_cb) + self.connect('destroy', self.__destroy_cb) + + def __destroy_cb(self, icon): + if self._palette_invoker is not None: + self._palette_invoker.detach() + def __button_can_activate_accel_cb(self, button, signal_id): # Accept activation via accelerators regardless of this widget's state return True |