diff --git a/sugar/browser/Makefile.am b/sugar/browser/Makefile.am index b6440e5f..e3892a33 100644 --- a/sugar/browser/Makefile.am +++ b/sugar/browser/Makefile.am @@ -1,7 +1,8 @@ sugardir = $(pythondir)/sugar/browser -sugar_PYTHON = \ - __init__.py \ - browser.py +sugar_PYTHON = \ + __init__.py \ + browser.py \ + NotificationBar.py icondir = $(pkgdatadir) icon_DATA = \ diff --git a/sugar/browser/NotificationBar.py b/sugar/browser/NotificationBar.py new file mode 100644 index 00000000..01b5b73b --- /dev/null +++ b/sugar/browser/NotificationBar.py @@ -0,0 +1,30 @@ +import pygtk +pygtk.require('2.0') +import gtk +import gobject + +class NotificationBar(gtk.HBox): + __gsignals__ = { + 'action': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, + ([gobject.TYPE_STRING])) + } + + def __init__(self): + gtk.HBox.__init__(self) + self._text_label = gtk.Label() + self.pack_start(self._text_label) + self._text_label.show() + + self._action_button = gtk.Button() + self.pack_start(self._action_button, False) + self._action_button.show() + + def set_text(self, text): + self._text_label.set_text(text) + + def set_action(self, action_id, action_text): + self._action_id = action_id + self._action_button.set_label(action_text) + + def __action_button_clicked(self): + self.emit("action", self._action_id)