diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-08-08 11:03:09 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-08-08 11:03:09 (GMT) |
commit | 6ae38464156c5ba2c06826ab9d8b9d4bd226c2bb (patch) | |
tree | e1153328acaff4b5cf6568b473a8f38b761861eb /sugar | |
parent | 6dd6b0275b34ab6aa029427ee33ec59686319f21 (diff) |
Expose palette.action_bar
Diffstat (limited to 'sugar')
-rw-r--r-- | sugar/graphics/palette.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/sugar/graphics/palette.py b/sugar/graphics/palette.py index 4d09499..a877488 100644 --- a/sugar/graphics/palette.py +++ b/sugar/graphics/palette.py @@ -110,9 +110,9 @@ class Palette(gtk.Window): self._secondary_box.pack_start(self._content) self._content.show() - self._button_bar = gtk.HButtonBox() - self._secondary_box.pack_start(self._button_bar) - self._button_bar.show() + self.action_bar = PaletteActionBar() + self._secondary_box.pack_start(self.action_bar) + self.action_bar.show() self.add(vbox) vbox.show() @@ -145,10 +145,6 @@ class Palette(gtk.Window): self._update_accept_focus() self._update_separator() - def append_button(self, button): - self._button_bar.append_button(button) - self._button_bar.show() - def set_group_id(self, group_id): if self._group_id: group = palettegroup.get_group(self._group_id) @@ -377,6 +373,18 @@ class Palette(gtk.Window): if self != palette: self._hide() +class PaletteActionBar(gtk.HButtonBox): + def add_action(label, icon_name=None): + button = Button(label) + + if icon_name: + icon = Icon(icon_name) + button.set_image(icon) + icon.show() + + self.pack_start(button) + button.show() + class _Menu(_sugaruiext.Menu): __gtype_name__ = 'SugarPaletteMenu' |