Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAgustin Zubiaga <aguz@sugarlabs.org>2013-11-26 14:00:31 (GMT)
committer Agustin Zubiaga <aguz@sugarlabs.org>2013-11-26 14:00:31 (GMT)
commit1c881f74e8da6ff44a61ebd437ba51be6c5687cb (patch)
treed46654d6f7e91d418ae62c75a626a8a63a6cbaa9
parente2bf72c67996969b4d46d552e8f7b231f3d9e250 (diff)
Showing the StopButton always and returning ToolbarButton
Signed-off-by: Agustin Zubiaga <aguz@sugarlabs.org>
-rw-r--r--simpleactivity.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/simpleactivity.py b/simpleactivity.py
index 3ae2d8f..36fcc71 100644
--- a/simpleactivity.py
+++ b/simpleactivity.py
@@ -121,15 +121,18 @@ class SimpleActivity(activity.Activity):
self.toolbarbox.show()
self.set_toolbar_box(self.toolbarbox)
- def add_toolbar(self, icon, index=-1):
+ def add_toolbar(self, icon, page=None, index=-1):
"""Add a ToolbarButton to the toolbarbox, and return the page
(Gtk.Toolbar)"""
toolbar_btn = ToolbarButton(icon_name=icon)
- toolbar_btn.props.page = Gtk.Toolbar()
+ if page is None:
+ toolbar_btn.props.page = Gtk.Toolbar()
+ else:
+ toolbar_btn.props.page = page
self.toolbarbox.toolbar.insert(toolbar_btn, index)
- return toolbar_btn.props.page
+ return toolbar_btn, toolbar_btn.props.page
def add_toolbutton(self, icon=None, cb=None, tooltip=None,
accelerator=None, index=-1, toolbar=None):
@@ -197,6 +200,8 @@ class SimpleActivity(activity.Activity):
toolbar.remove(self._stopbutton_sep)
toolbar.insert(self._stopbutton_sep, -1)
toolbar.insert(self._stopbutton, -1)
+ self._stopbutton_sep.show()
+ self._stopbutton.show()
def add_to_activitytoolbar(self, item, index=-1):
"""Add an item to activity_toolbar"""