summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGian Mario Tagliaretti <gianmt@src.gnome.org>2007-07-26 21:25:53 +0000
committerGian Mario Tagliaretti <gianmt@src.gnome.org>2007-07-26 21:25:53 +0000
commitb40aa87208d4899b07e23f327a3786bd8c766124 (patch)
tree91f1f23f5db2a1b7a437e56309daeae205c76543 /tests
parentb1603f0a1a56e0af6c923bc4a53d000c0fa69c49 (diff)
downloadpygtk-b40aa87208d4899b07e23f327a3786bd8c766124.tar.gz
wrap GtkContainer do_forall by Paul Pogonyshev
svn path=/trunk/; revision=2862
Diffstat (limited to 'tests')
-rw-r--r--tests/test_container.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_container.py b/tests/test_container.py
index a970fa44..fa1f6411 100644
--- a/tests/test_container.py
+++ b/tests/test_container.py
@@ -41,6 +41,23 @@ MyContainer.install_child_property(1,
'Dumb Prop',
'Dumb Property for testing purposes',
'', gobject.PARAM_READWRITE))
+
+class MyAlignment(gtk.Alignment):
+
+ def __init__(self, caption):
+ self.caption = gtk.Label()
+ self.caption.set_markup('<b>%s</b>' % gobject.markup_escape_text(caption))
+
+ gtk.Alignment.__init__(self)
+
+ self.caption.set_parent(self)
+
+ def do_forall(self, include_internals, callback, callback_data):
+ callback(self.caption, callback_data)
+ gtk.Alignment.do_forall(self, include_internals, callback, callback_data)
+
+# FIXME: Why is it needed?
+gobject.type_register(MyAlignment)
class ContainerTest(unittest.TestCase):
@@ -52,5 +69,14 @@ class ContainerTest(unittest.TestCase):
obj.child_set_property(label, 'dumb_prop', v)
self.assertEqual(v, obj.child_get_property(label, 'dumb_prop'))
+ def testSuperclassForAll(self):
+ alignment = MyAlignment('test')
+ label = gtk.Label('foo')
+ alignment.add(label)
+ alignment.show_all()
+
+ self.assert_(label.flags() & gtk.VISIBLE)
+ self.assert_(alignment.caption.flags() & gtk.VISIBLE)
+
if __name__ == '__main__':
unittest.main()