Add TrayIcon.get_icon() (tomeu)

This commit is contained in:
Simon Schampijer 2008-02-25 12:36:58 +01:00
parent 324a9b549d
commit ee4a4ece7c

View File

@ -261,10 +261,10 @@ class _IconWidget(gtk.EventBox):
self.set_app_paintable(True) self.set_app_paintable(True)
icon = Icon(icon_name=icon_name, xo_color=xo_color, self._icon = Icon(icon_name=icon_name, xo_color=xo_color,
icon_size=gtk.ICON_SIZE_LARGE_TOOLBAR) icon_size=gtk.ICON_SIZE_LARGE_TOOLBAR)
self.add(icon) self.add(self._icon)
icon.show() self._icon.show()
def do_expose_event(self, event): def do_expose_event(self, event):
if self._palette and self._palette.is_up(): if self._palette and self._palette.is_up():
@ -279,6 +279,9 @@ class _IconWidget(gtk.EventBox):
self._palette = palette self._palette = palette
self._palette.props.invoker = ToolInvoker(self) self._palette.props.invoker = ToolInvoker(self)
def get_icon(self):
return self._icon
class TrayIcon(gtk.ToolItem): class TrayIcon(gtk.ToolItem):
__gtype_name__ = "SugarTrayIcon" __gtype_name__ = "SugarTrayIcon"
@ -297,3 +300,6 @@ class TrayIcon(gtk.ToolItem):
def set_tooltip(self, text): def set_tooltip(self, text):
self.set_palette(Palette(text)) self.set_palette(Palette(text))
def get_icon(self):
return self._icon_widget.get_icon()