[POS-commit] Kiwi/tests test_OptionMenu.py,1.11,1.12
kiko at async.com.br
kiko at async.com.br
Fri May 9 18:03:35 BRST 2003
Update of /cvs/Kiwi/tests
In directory anthem:/tmp/cvs-serv30649/tests
Modified Files:
test_OptionMenu.py
Log Message:
Implement OptionMenu.set_item_label(self, item, text), offering a
convenience function for changing labels on GtkMenuItems (which suffers
from GTK+ bugs)
Index: test_OptionMenu.py
===================================================================
RCS file: /cvs/Kiwi/tests/test_OptionMenu.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- test_OptionMenu.py 24 Jan 2003 20:13:36 -0000 1.11
+++ test_OptionMenu.py 9 May 2003 21:03:33 -0000 1.12
@@ -19,6 +19,13 @@
X = 1 and not X
m.set_sensitive(X)
+def set_label_one(*args):
+ m.set_item_label(1, "MIND YOU")
+
+def set_label_two(*args):
+ item = m.get_menu().children()[2]
+ m.set_item_label(item, "SPEAK THE PEACE")
+
def reset(*args):
m.reset()
l.set_text("Reset!")
@@ -106,6 +113,12 @@
v.add(l)
b = gtk.GtkButton(label="Reset")
b.connect("clicked",reset)
+v.add(b)
+b = gtk.GtkButton(label="Set item 1")
+b.connect("clicked",set_label_one)
+v.add(b)
+b = gtk.GtkButton(label="Set item 2")
+b.connect("clicked",set_label_two)
v.add(b)
b = gtk.GtkButton(label="Prefill w/ XPM")
b.connect("clicked",prefill_with_xpm)
More information about the POS-commit
mailing list