Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-07-12 01:42:23 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-07-12 01:42:23 (GMT)
commite256b96366e7d7e5a327b8c6f675c899065cd710 (patch)
treef60e27e7b844617ab811acf9dee9545e957566f9 /examples
parentf9de29f53906b7851fef37f11425649aca323d7d (diff)
Implement palette mode
Diffstat (limited to 'examples')
-rw-r--r--examples/toolbar.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/examples/toolbar.py b/examples/toolbar.py
index 36624c0..ad07f37 100644
--- a/examples/toolbar.py
+++ b/examples/toolbar.py
@@ -1,5 +1,7 @@
import gtk
+
from sugar.graphics.toolbar import Toolbar, ToolbarButton
+from sugar.graphics import style
window = gtk.Window()
@@ -9,16 +11,15 @@ window.add(box)
toolbar = Toolbar()
box.pack_start(toolbar, False)
-tollbarbutton_1 = ToolbarButton(toolbar, gtk.Button('sub-widget #1'),
- icon_name='computer-xo',
- tooltip='foo')
+tollbarbutton_1 = ToolbarButton(
+ page=gtk.Button('sub-widget #1'),
+ icon_name='computer-xo')
toolbar.top.insert(tollbarbutton_1, -1)
-toolbar.top.insert(gtk.SeparatorToolItem(), -1)
-
-tollbarbutton_2 = ToolbarButton(toolbar, gtk.Button('sub-widget #2'),
+tollbarbutton_2 = ToolbarButton(
+ page=gtk.Button('sub-widget #2'),
icon_name='button_cancel',
- tooltip='foo')
+ tooltip='with custom palette instead of sub-widget')
toolbar.top.insert(tollbarbutton_2, -1)
toolbar.top.insert(gtk.SeparatorToolItem(), -1)
@@ -27,9 +28,9 @@ def del_cb(widget):
toolbar.top.remove(tollbarbutton_3)
del_b = gtk.Button('delete sub-widget #3')
del_b.connect('clicked', del_cb)
-tollbarbutton_3 = ToolbarButton(toolbar, del_b,
- icon_name='activity-journal',
- tooltip='del')
+tollbarbutton_3 = ToolbarButton(
+ page=del_b,
+ icon_name='activity-journal')
toolbar.top.insert(tollbarbutton_3, -1)
window.show_all()