2006-10-16 18:43:31 +02:00
|
|
|
import gtk
|
|
|
|
|
|
|
|
from _sugar import TrayManager
|
|
|
|
|
|
|
|
class NotificationTray(gtk.HBox):
|
2006-12-04 20:12:24 +01:00
|
|
|
def __init__(self):
|
|
|
|
gtk.HBox.__init__(self)
|
2006-10-16 18:43:31 +02:00
|
|
|
|
2006-12-04 20:12:24 +01:00
|
|
|
self._manager = TrayManager()
|
|
|
|
self._manager.connect('tray-icon-added', self._icon_added_cb)
|
|
|
|
self._manager.connect('tray-icon-removed', self._icon_removed_cb)
|
|
|
|
self._manager.manage_screen(gtk.gdk.screen_get_default())
|
2006-10-16 18:43:31 +02:00
|
|
|
|
2006-12-04 20:12:24 +01:00
|
|
|
def _icon_added_cb(self, manager, icon):
|
|
|
|
self.pack_start(icon, False)
|
2006-10-16 20:42:39 +02:00
|
|
|
|
2006-12-04 20:12:24 +01:00
|
|
|
def _icon_removed_cb(self, manager, icon):
|
|
|
|
icon.destroy()
|