820efa56b9
This is only on a best-effort basis; the code will be in a broken state after this patch and need to be fixed manually. The purpose of committing the intermediate, non-working output is to make it reproducible. It's impractical to manually review the changes. The exact version used was 4f637212f13b197a95c824967a58496b9e3b877c from the main pygobject repository [1] plus a custom patch [2] that hasn't been sent upstream yet. [1] git://git.gnome.org/pygobject [2] https://sascha.silbe.org/patches/pygobject-convert-sugar-20111122.patch Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
52 lines
1.3 KiB
Python
52 lines
1.3 KiB
Python
from gi.repository import Gtk
|
|
|
|
from sugar3.graphics.toolbutton import ToolButton
|
|
from sugar3.graphics.toolbarbox import ToolbarBox, ToolbarButton
|
|
from sugar3.graphics import style
|
|
|
|
window = Gtk.Window()
|
|
|
|
box = Gtk.VBox()
|
|
window.add(box)
|
|
|
|
toolbar = ToolbarBox()
|
|
box.pack_start(toolbar, False)
|
|
|
|
tollbarbutton_1 = ToolbarButton(
|
|
page=Gtk.Button('sub-widget #1'),
|
|
icon_name='computer-xo')
|
|
toolbar.toolbar.insert(tollbarbutton_1, -1)
|
|
|
|
tollbarbutton_2 = ToolbarButton(
|
|
page=Gtk.Button('sub-widget #2'),
|
|
icon_name='button_cancel',
|
|
tooltip='with custom palette instead of sub-widget')
|
|
toolbar.toolbar.insert(tollbarbutton_2, -1)
|
|
|
|
toolbar.toolbar.insert(Gtk.SeparatorToolItem(), -1)
|
|
|
|
|
|
def del_cb(widget):
|
|
toolbar.toolbar.remove(tollbarbutton_3)
|
|
del_b = Gtk.Button('delete sub-widget #3')
|
|
del_b.connect('clicked', del_cb)
|
|
tollbarbutton_3 = ToolbarButton(
|
|
page=del_b,
|
|
icon_name='activity-journal')
|
|
toolbar.toolbar.insert(tollbarbutton_3, -1)
|
|
|
|
subbar = Gtk.Toolbar()
|
|
subbutton = ToolButton(
|
|
icon_name='document-send',
|
|
tooltip='document-send')
|
|
subbar.insert(subbutton, -1)
|
|
subbar.show_all()
|
|
|
|
tollbarbutton_4 = ToolbarButton(
|
|
page=subbar,
|
|
icon_name='document-save')
|
|
toolbar.toolbar.insert(tollbarbutton_4, -1)
|
|
|
|
window.show_all()
|
|
Gtk.main()
|