diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/graphics/common.py | 14 | ||||
-rw-r--r-- | tests/graphics/iconcache.py | 10 | ||||
-rw-r--r-- | tests/graphics/iconwidget.py | 34 | ||||
-rw-r--r-- | tests/graphics/ticket2855.py | 12 | ||||
-rw-r--r-- | tests/graphics/ticket2999.py | 6 | ||||
-rw-r--r-- | tests/graphics/ticket3000.py | 6 | ||||
-rw-r--r-- | tests/graphics/toolbarpalettes.py | 14 | ||||
-rw-r--r-- | tests/graphics/tray.py | 12 |
8 files changed, 54 insertions, 54 deletions
diff --git a/tests/graphics/common.py b/tests/graphics/common.py index 103a81d..e5aabd4 100644 --- a/tests/graphics/common.py +++ b/tests/graphics/common.py @@ -15,21 +15,21 @@ # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. -import gtk +from gi.repository import Gtk from sugar3.graphics.toolbutton import ToolButton -class Test(gtk.VBox): +class Test(Gtk.VBox): def __init__(self): - gtk.VBox.__init__(self) + GObject.GObject.__init__(self) class TestPalette(Test): def __init__(self): Test.__init__(self) - toolbar = gtk.Toolbar() + toolbar = Gtk.Toolbar() self._invoker = ToolButton('go-previous') toolbar.insert(self._invoker, -1) @@ -44,8 +44,8 @@ class TestPalette(Test): class TestRunner(object): def run(self, test): - window = gtk.Window() - window.connect('destroy', lambda w: gtk.main_quit()) + window = Gtk.Window() + window.connect('destroy', lambda w: Gtk.main_quit()) window.add(test) test.show() @@ -56,4 +56,4 @@ def main(test): runner = TestRunner() runner.run(test) - gtk.main() + Gtk.main() diff --git a/tests/graphics/iconcache.py b/tests/graphics/iconcache.py index 9508f6b..5a027d9 100644 --- a/tests/graphics/iconcache.py +++ b/tests/graphics/iconcache.py @@ -19,7 +19,7 @@ Test the sugar3.graphics.icon.* cache. """ -import gtk +from gi.repository import Gtk from sugar3.graphics.icon import Icon from sugar3.graphics.xocolor import XoColor @@ -54,13 +54,13 @@ def _button_activated_cb(button): for d in data: icon = Icon(icon_name=d[0], - icon_size=gtk.ICON_SIZE_LARGE_TOOLBAR, + icon_size=Gtk.IconSize.LARGE_TOOLBAR, xo_color=XoColor(d[1])) - test.pack_start(icon) + test.pack_start(icon, True, True, 0) icon.show() -button = gtk.Button('mec mac') -test.pack_start(button) +button = Gtk.Button('mec mac') +test.pack_start(button, True, True, 0) button.connect('activate', _button_activated_cb) button.show() diff --git a/tests/graphics/iconwidget.py b/tests/graphics/iconwidget.py index d4626ff..e4d7f26 100644 --- a/tests/graphics/iconwidget.py +++ b/tests/graphics/iconwidget.py @@ -19,7 +19,7 @@ Test the sugar3.graphics.icon.Icon widget. """ -import gtk +from gi.repository import Gtk from sugar3.graphics.icon import Icon from sugar3.graphics.xocolor import XoColor @@ -28,41 +28,41 @@ import common test = common.Test() -hbox = gtk.HBox() -test.pack_start(hbox) -sensitive_box = gtk.VBox() -insensitive_box = gtk.VBox() +hbox = Gtk.HBox() +test.pack_start(hbox, True, True, 0) +sensitive_box = Gtk.VBox() +insensitive_box = Gtk.VBox() -hbox.pack_start(sensitive_box) -hbox.pack_start(insensitive_box) +hbox.pack_start(sensitive_box, True, True, 0) +hbox.pack_start(insensitive_box, True, True, 0) hbox.show_all() def create_icon_widgets(box, sensitive=True): icon = Icon(icon_name='go-previous') - icon.props.icon_size = gtk.ICON_SIZE_LARGE_TOOLBAR - box.pack_start(icon) + icon.props.icon_size = Gtk.IconSize.LARGE_TOOLBAR + box.pack_start(icon, True, True, 0) icon.set_sensitive(sensitive) icon.show() icon = Icon(icon_name='computer-xo', - icon_size=gtk.ICON_SIZE_LARGE_TOOLBAR, + icon_size=Gtk.IconSize.LARGE_TOOLBAR, xo_color=XoColor()) - box.pack_start(icon) + box.pack_start(icon, True, True, 0) icon.set_sensitive(sensitive) icon.show() icon = Icon(icon_name='battery-000', - icon_size=gtk.ICON_SIZE_LARGE_TOOLBAR, + icon_size=Gtk.IconSize.LARGE_TOOLBAR, badge_name='emblem-busy') - box.pack_start(icon) + box.pack_start(icon, True, True, 0) icon.set_sensitive(sensitive) icon.show() icon = Icon(icon_name='gtk-new', - icon_size=gtk.ICON_SIZE_LARGE_TOOLBAR, + icon_size=Gtk.IconSize.LARGE_TOOLBAR, badge_name='gtk-cancel') - box.pack_start(icon) + box.pack_start(icon, True, True, 0) icon.set_sensitive(sensitive) icon.show() @@ -80,8 +80,8 @@ test.show() # test.queue_draw() # return True # -#import gobject -#gobject.idle_add(idle_cb) +#from gi.repository import GObject +#GObject.idle_add(idle_cb) if __name__ == '__main__': common.main(test) diff --git a/tests/graphics/ticket2855.py b/tests/graphics/ticket2855.py index 96c4a66..0de36a3 100644 --- a/tests/graphics/ticket2855.py +++ b/tests/graphics/ticket2855.py @@ -21,7 +21,7 @@ contains only an icon and should be rendered similarly to the toolbar controls. Ticket #2855. """ -import gtk +from gi.repository import Gtk from sugar3.graphics.palette import Palette from sugar3.graphics.icon import Icon @@ -33,19 +33,19 @@ test = common.TestPalette() palette = Palette('Test radio and toggle') test.set_palette(palette) -box = gtk.HBox() +box = Gtk.HBox() -toggle = gtk.ToggleButton() +toggle = Gtk.ToggleButton() -icon = Icon(icon_name='go-previous', icon_size=gtk.ICON_SIZE_LARGE_TOOLBAR) +icon = Icon(icon_name='go-previous', icon_size=Gtk.IconSize.LARGE_TOOLBAR) toggle.set_image(icon) box.pack_start(toggle, False) toggle.show() -radio = gtk.RadioButton() +radio = Gtk.RadioButton() -icon = Icon(icon_name='go-next', icon_size=gtk.ICON_SIZE_LARGE_TOOLBAR) +icon = Icon(icon_name='go-next', icon_size=Gtk.IconSize.LARGE_TOOLBAR) radio.set_image(icon) radio.set_mode(False) diff --git a/tests/graphics/ticket2999.py b/tests/graphics/ticket2999.py index 5ebae31..557ba53 100644 --- a/tests/graphics/ticket2999.py +++ b/tests/graphics/ticket2999.py @@ -19,7 +19,7 @@ Spec in ticket #2999. """ -import gtk +from gi.repository import Gtk from sugar3.graphics.palette import Palette from sugar3.graphics.icon import Icon @@ -29,9 +29,9 @@ import common test = common.Test() test.set_border_width(60) -text_view = gtk.TextView() +text_view = Gtk.TextView() text_view.props.buffer.props.text = 'Blah blah blah, blah blah blah.' -test.pack_start(text_view) +test.pack_start(text_view, True, True, 0) text_view.show() if __name__ == '__main__': diff --git a/tests/graphics/ticket3000.py b/tests/graphics/ticket3000.py index afecb4a..295d796 100644 --- a/tests/graphics/ticket3000.py +++ b/tests/graphics/ticket3000.py @@ -19,7 +19,7 @@ Spec in ticket #3000. """ -import gtk +from gi.repository import Gtk from sugar3.graphics.toolbutton import ToolButton @@ -27,7 +27,7 @@ import common test = common.Test() -toolbar = gtk.Toolbar() +toolbar = Gtk.Toolbar() test.pack_start(toolbar, False) toolbar.show() @@ -35,7 +35,7 @@ button = ToolButton('go-previous') toolbar.insert(button, -1) button.show() -separator = gtk.SeparatorToolItem() +separator = Gtk.SeparatorToolItem() toolbar.add(separator) separator.show() diff --git a/tests/graphics/toolbarpalettes.py b/tests/graphics/toolbarpalettes.py index 1fd079a..93177c1 100644 --- a/tests/graphics/toolbarpalettes.py +++ b/tests/graphics/toolbarpalettes.py @@ -19,7 +19,7 @@ Test palette positioning for toolbar and tray. """ -import gtk +from gi.repository import Gtk from sugar3.graphics.tray import HTray, TrayButton from sugar3.graphics.toolbutton import ToolButton @@ -28,11 +28,11 @@ import common test = common.Test() -vbox = gtk.VBox() +vbox = Gtk.VBox() -theme_icons = gtk.icon_theme_get_default().list_icons() +theme_icons = Gtk.IconTheme.get_default().list_icons() -toolbar = gtk.Toolbar() +toolbar = Gtk.Toolbar() vbox.pack_start(toolbar, False) toolbar.show() @@ -42,8 +42,8 @@ for i in range(0, 5): toolbar.insert(button, -1) button.show() -content = gtk.Label() -vbox.pack_start(content) +content = Gtk.Label() +vbox.pack_start(content, True, True, 0) content.show() tray = HTray() @@ -56,7 +56,7 @@ for i in range(0, 30): tray.add_item(button) button.show() -test.pack_start(vbox) +test.pack_start(vbox, True, True, 0) vbox.show() test.show() diff --git a/tests/graphics/tray.py b/tests/graphics/tray.py index 9b2d15a..fbe78d1 100644 --- a/tests/graphics/tray.py +++ b/tests/graphics/tray.py @@ -19,7 +19,7 @@ Test the sugar3.graphics.icon.Icon widget. """ -import gtk +from gi.repository import Gtk from sugar3.graphics.tray import HTray, VTray from sugar3.graphics.tray import TrayButton, TrayIcon @@ -28,13 +28,13 @@ import common test = common.Test() -vbox = gtk.VBox() +vbox = Gtk.VBox() tray = HTray() vbox.pack_start(tray, False) tray.show() -theme_icons = gtk.icon_theme_get_default().list_icons() +theme_icons = Gtk.IconTheme.get_default().list_icons() for i in range(0, 100): button = TrayButton(icon_name=theme_icons[i]) @@ -50,7 +50,7 @@ for i in range(0, 10): tray.add_item(icon) icon.show() -hbox = gtk.HBox() +hbox = Gtk.HBox() tray = VTray() hbox.pack_start(tray, False) @@ -70,10 +70,10 @@ for i in range(0, 4): tray.add_item(button) button.show() -vbox.pack_start(hbox) +vbox.pack_start(hbox, True, True, 0) hbox.show() -test.pack_start(vbox) +test.pack_start(vbox, True, True, 0) vbox.show() test.show() |