From ee4a4ece7c1524c22a201ac7a086d3cb71554c24 Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Mon, 25 Feb 2008 12:36:58 +0100 Subject: [PATCH] Add TrayIcon.get_icon() (tomeu) --- sugar/graphics/tray.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sugar/graphics/tray.py b/sugar/graphics/tray.py index da405015..f95cb494 100644 --- a/sugar/graphics/tray.py +++ b/sugar/graphics/tray.py @@ -261,10 +261,10 @@ class _IconWidget(gtk.EventBox): self.set_app_paintable(True) - icon = Icon(icon_name=icon_name, xo_color=xo_color, - icon_size=gtk.ICON_SIZE_LARGE_TOOLBAR) - self.add(icon) - icon.show() + self._icon = Icon(icon_name=icon_name, xo_color=xo_color, + icon_size=gtk.ICON_SIZE_LARGE_TOOLBAR) + self.add(self._icon) + self._icon.show() def do_expose_event(self, event): if self._palette and self._palette.is_up(): @@ -279,6 +279,9 @@ class _IconWidget(gtk.EventBox): self._palette = palette self._palette.props.invoker = ToolInvoker(self) + def get_icon(self): + return self._icon + class TrayIcon(gtk.ToolItem): __gtype_name__ = "SugarTrayIcon" @@ -297,3 +300,6 @@ class TrayIcon(gtk.ToolItem): def set_tooltip(self, text): self.set_palette(Palette(text)) + def get_icon(self): + return self._icon_widget.get_icon() +