diff options
author | Sascha Silbe <silbe@activitycentral.com> | 2011-11-15 18:29:07 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@schampijer.de> | 2011-12-13 20:19:52 (GMT) |
commit | 820efa56b9876bb418bc51d30de959775930e35c (patch) | |
tree | a4310912a6a3f067c128ff1b3d47a47b5f3de5ac /examples | |
parent | aed295ec4effbee66626da7ff42277f691ddb5bd (diff) |
Run pygi-convert.sh for automatic conversion from GTK2 to GTK3 + pygi.
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>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/radiopalette.py | 14 | ||||
-rw-r--r-- | examples/toolbar.py | 18 |
2 files changed, 16 insertions, 16 deletions
diff --git a/examples/radiopalette.py b/examples/radiopalette.py index 5aa817c..3403dd3 100644 --- a/examples/radiopalette.py +++ b/examples/radiopalette.py @@ -1,4 +1,4 @@ -import gtk +from gi.repository import Gtk from sugar3.graphics.radiopalette import RadioPalette, RadioMenuButton, \ RadioToolsButton @@ -6,16 +6,16 @@ from sugar3.graphics.radiotoolbutton import RadioToolButton from sugar3.graphics.toolbutton import ToolButton from sugar3.graphics import style -window = gtk.Window() +window = Gtk.Window() -box = gtk.VBox() +box = Gtk.VBox() window.add(box) -toolbar = gtk.Toolbar() +toolbar = Gtk.Toolbar() box.pack_start(toolbar, False) -text_view = gtk.TextView() -box.pack_start(text_view) +text_view = Gtk.TextView() +box.pack_start(text_view, True, True, 0) def echo(button, label): @@ -72,4 +72,4 @@ button = RadioToolsButton(palette=palette) toolbar.insert(button, -1) window.show_all() -gtk.main() +Gtk.main() diff --git a/examples/toolbar.py b/examples/toolbar.py index bd6afef..b1cda59 100644 --- a/examples/toolbar.py +++ b/examples/toolbar.py @@ -1,41 +1,41 @@ -import gtk +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() +window = Gtk.Window() -box = gtk.VBox() +box = Gtk.VBox() window.add(box) toolbar = ToolbarBox() box.pack_start(toolbar, False) tollbarbutton_1 = ToolbarButton( - page=gtk.Button('sub-widget #1'), + 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'), + 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) +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 = 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() +subbar = Gtk.Toolbar() subbutton = ToolButton( icon_name='document-send', tooltip='document-send') @@ -48,4 +48,4 @@ tollbarbutton_4 = ToolbarButton( toolbar.toolbar.insert(tollbarbutton_4, -1) window.show_all() -gtk.main() +Gtk.main() |