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:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2008-09-18 12:12:18 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2008-09-18 12:59:48 (GMT)
commita4ae2d2a624fd31a218d6351ca5f584fe11714a2 (patch)
treeca5a94067bdec858cef2d683ee2217a7aef334b9 /src/sugar/graphics/toggletoolbutton.py
parent552689d15de80c69070c9c46d900b93f6be4634a (diff)
#8485 Detach from palette when a widget is destroyed
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)