[pygobject] Override GtkTable constructor to behave like pygtk
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Override GtkTable constructor to behave like pygtk
- Date: Sat, 4 Dec 2010 14:39:14 +0000 (UTC)
commit da4e045e5abbed2796cc4ed39df35a0dde2de31b
Author: Paolo Borelli <pborelli gnome org>
Date: Sat Dec 4 15:40:35 2010 +0100
Override GtkTable constructor to behave like pygtk
gi/overrides/Gtk.py | 7 +++++++
tests/test_overrides.py | 12 ++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index 6e8e566..28f3416 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -1044,6 +1044,13 @@ class Button(Gtk.Button, Container):
Button = override(Button)
__all__.append('Button')
+class Table(Gtk.Table, Container):
+ def __init__(self, rows=1, columns=1, homogeneous=False, **kwds):
+ Gtk.Table.__init__(self, n_rows=rows, n_columns=columns, homogeneous=homogeneous, **kwds)
+
+Table = override(Table)
+__all__.append('Table')
+
_Gtk_main_quit = Gtk.main_quit
@override(Gtk.main_quit)
def main_quit(*args):
diff --git a/tests/test_overrides.py b/tests/test_overrides.py
index 7a0bfbd..717e6c2 100644
--- a/tests/test_overrides.py
+++ b/tests/test_overrides.py
@@ -754,3 +754,15 @@ class TestGtk(unittest.TestCase):
self.assertEquals(pos, 6)
text = entry.get_chars(0, 11)
self.assertEquals('Hello World', text)
+
+ def test_table(self):
+ table = Gtk.Table()
+ self.assertEquals(table.get_size(), (1,1))
+ self.assertEquals(table.get_homogeneous(), False)
+ table = Gtk.Table(2, 3)
+ self.assertEquals(table.get_size(), (2,3))
+ self.assertEquals(table.get_homogeneous(), False)
+ table = Gtk.Table(2, 3, True)
+ self.assertEquals(table.get_size(), (2,3))
+ self.assertEquals(table.get_homogeneous(), True)
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]