Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/graphics/toggletoolbutton.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/sugar/graphics/toggletoolbutton.py')
-rw-r--r--src/sugar/graphics/toggletoolbutton.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sugar/graphics/toggletoolbutton.py b/src/sugar/graphics/toggletoolbutton.py
index ec622b4..35c4bf1 100644
--- a/src/sugar/graphics/toggletoolbutton.py
+++ b/src/sugar/graphics/toggletoolbutton.py
@@ -30,6 +30,12 @@ class ToggleToolButton(gtk.ToggleToolButton):
self._palette_invoker = ToolInvoker(self)
self.set_named_icon(named_icon)
+ self.connect('destroy', self.__destroy_cb)
+
+ def __destroy_cb(self, icon):
+ if self._palette_invoker is not None:
+ self._palette_invoker.detach()
+
def set_named_icon(self, named_icon):
icon = Icon(icon_name=named_icon)
self.set_icon_widget(icon)