diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-04-20 13:38:34 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-04-20 13:38:34 (GMT) |
commit | 76e375749addc130252116ea677250c38b117549 (patch) | |
tree | d428b746910bf2fd828586075aa8d7a65c3d9d40 /tests | |
parent | f6a93fd8e9f44acdcddf4a487f1483eca55ae805 (diff) |
Add more toolbars and a text area
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test-ui.py | 58 |
1 files changed, 56 insertions, 2 deletions
diff --git a/tests/test-ui.py b/tests/test-ui.py index e44828c..26f3d12 100755 --- a/tests/test-ui.py +++ b/tests/test-ui.py @@ -17,10 +17,17 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import gtk -import hippo from sugar.graphics2.window import Window +class ActivityToolbar(gtk.Toolbar): + def __init__(self): + gtk.Toolbar.__init__(self) + +class EditToolbar(gtk.Toolbar): + def __init__(self): + gtk.Toolbar.__init__(self) + class TextToolbar(gtk.Toolbar): def __init__(self): gtk.Toolbar.__init__(self) @@ -30,14 +37,61 @@ class TextToolbar(gtk.Toolbar): self.insert(button, -1) button.show() +class ImageToolbar(gtk.Toolbar): + def __init__(self): + gtk.Toolbar.__init__(self) + +class TableToolbar(gtk.Toolbar): + def __init__(self): + gtk.Toolbar.__init__(self) + +class FormatToolbar(gtk.Toolbar): + def __init__(self): + gtk.Toolbar.__init__(self) + +class ViewToolbar(gtk.Toolbar): + def __init__(self): + gtk.Toolbar.__init__(self) + window = Window() window.connect("destroy", lambda w: gtk.main_quit()) +activity_toolbar = ActivityToolbar() +window.toolbox.add_toolbar('Activity', activity_toolbar) +activity_toolbar.show() + +edit_toolbar = EditToolbar() +window.toolbox.add_toolbar('Edit', edit_toolbar) +edit_toolbar.show() + text_toolbar = TextToolbar() window.toolbox.add_toolbar('Text', text_toolbar) text_toolbar.show() -window.canvas.set_root(hippo.CanvasBox(background_color=0)) +image_toolbar = ImageToolbar() +window.toolbox.add_toolbar('Image', image_toolbar) +image_toolbar.show() + +table_toolbar = TableToolbar() +window.toolbox.add_toolbar('Table', table_toolbar) +table_toolbar.show() + +format_toolbar = FormatToolbar() +window.toolbox.add_toolbar('Format', format_toolbar) +format_toolbar.show() + +view_toolbar = ViewToolbar() +window.toolbox.add_toolbar('View', view_toolbar) +view_toolbar.show() + +scrolled_window = gtk.ScrolledWindow() +scrolled_window.set_policy(gtk.POLICY_NEVER, gtk.POLICY_ALWAYS) +window.set_canvas(scrolled_window) +scrolled_window.show() + +text_view = gtk.TextView() +scrolled_window.add(text_view) +text_view.show() window.show() |