Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Quiñones <manuq@laptop.org>2012-11-01 13:23:49 (GMT)
committer Manuel Quiñones <manuq@laptop.org>2012-11-01 13:23:49 (GMT)
commitdd5a68e8ceef002dcda50c59e61e3411ebddcf4e (patch)
tree87f6ea3eae07b0b022716ae04c6f8e6fc2077350
parent25497c7677250850472219df316b8bf032b0bf25 (diff)
Add two testcases: tabs with and without buttons, and sensitive text
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
-rw-r--r--tests/graphics/gtktreesensitive.py48
-rw-r--r--tests/graphics/tabs.py46
2 files changed, 94 insertions, 0 deletions
diff --git a/tests/graphics/gtktreesensitive.py b/tests/graphics/gtktreesensitive.py
new file mode 100644
index 0000000..875612f
--- /dev/null
+++ b/tests/graphics/gtktreesensitive.py
@@ -0,0 +1,48 @@
+#!/usr/bin/python
+from gi.repository import Gtk
+
+
+import common
+test = common.Test()
+test.show()
+
+
+class MyBox(Gtk.VBox):
+
+ def __init__(self):
+ Gtk.VBox.__init__(self)
+
+ self.scrolled = Gtk.ScrolledWindow()
+ self.scrolled.set_policy(Gtk.PolicyType.AUTOMATIC,
+ Gtk.PolicyType.AUTOMATIC)
+
+ self.store = Gtk.ListStore(str, str)
+ for i in range(5):
+ self.store.append([str(i), 'Item %s' % i])
+
+ self.treeview = Gtk.TreeView(self.store)
+ renderer_no_sens = Gtk.CellRendererText()
+ # set 'sensitive' property
+ renderer_no_sens.set_property('sensitive', False)
+
+ renderer = Gtk.CellRendererText()
+
+ column = Gtk.TreeViewColumn('\'sensitive\' False',
+ renderer_no_sens, text=0)
+ self.treeview.append_column(column)
+
+ column = Gtk.TreeViewColumn('\'sensitive\' True',
+ renderer, text=1)
+ self.treeview.append_column(column)
+
+ self.scrolled.add(self.treeview)
+ self.add(self.scrolled)
+
+ self.show_all()
+
+vbox = MyBox()
+test.pack_start(vbox, True, True, 0)
+vbox.show()
+
+if __name__ == '__main__':
+ common.main(test)
diff --git a/tests/graphics/tabs.py b/tests/graphics/tabs.py
new file mode 100644
index 0000000..fbc4bac
--- /dev/null
+++ b/tests/graphics/tabs.py
@@ -0,0 +1,46 @@
+#!/usr/bin/python
+from gi.repository import Gtk
+
+from sugar3.graphics.icon import Icon
+
+import common
+test = common.Test()
+test.show()
+
+box = Gtk.HBox()
+test.pack_start(box, True, True, 0)
+box.show()
+
+# notebook without button
+
+notebook = Gtk.Notebook()
+box.pack_start(notebook, True, True, 0)
+notebook.show()
+
+for i in range(3):
+ hbox = Gtk.HBox()
+ notebook.append_page(hbox, Gtk.Label('Page %d' % (i + 1)))
+ hbox.show()
+
+# notebook with buttons
+
+notebook = Gtk.Notebook()
+box.pack_start(notebook, True, True, 0)
+notebook.show()
+
+add_icon = Icon(icon_name='add')
+button = Gtk.Button()
+button.props.focus_on_click = False
+button.add(add_icon)
+add_icon.show()
+
+notebook.set_action_widget(button, Gtk.PackType.END)
+button.show()
+
+for i in range(3):
+ hbox = Gtk.HBox()
+ notebook.append_page(hbox, Gtk.Label('Page %d' % (i + 1)))
+ hbox.show()
+
+if __name__ == '__main__':
+ common.main(test)