[pygobject] GtkToolButton: Add a default value for the stock_id constructor parameter



commit 458dab08c78cb730dd95bcd67af20a0d73a3af2f
Author: Johan Dahlin <johan gnome org>
Date:   Fri Mar 16 16:06:12 2012 -0300

    GtkToolButton: Add a default value for the stock_id constructor parameter
    
    https://bugzilla.gnome.org/show_bug.cgi?id=672260

 gi/overrides/Gtk.py     |   10 ++++++++++
 tests/test_overrides.py |    9 ++++++++-
 2 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index 83631a2..609e8cd 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -573,6 +573,16 @@ class IconView(Gtk.IconView):
 IconView = override(IconView)
 __all__.append('IconView')
 
+
+class ToolButton(Gtk.ToolButton):
+
+    def __init__(self, stock_id=None):
+        Gtk.ToolButton.__init__(self, stock_id=stock_id)
+
+ToolButton = override(ToolButton)
+__all__.append('ToolButton')
+
+
 class IMContext(Gtk.IMContext):
 
     def get_surrounding(self):
diff --git a/tests/test_overrides.py b/tests/test_overrides.py
index 3794215..e7ff5e0 100644
--- a/tests/test_overrides.py
+++ b/tests/test_overrides.py
@@ -1811,9 +1811,16 @@ class TestGtk(unittest.TestCase):
 
         model = Gtk.ListStore(str)
         iconview = Gtk.IconView(model)
-
         self.assertEquals(iconview.props.model, model)
 
+    def test_toolbutton(self):
+        # PyGTK compat
+        button = Gtk.ToolButton()
+        self.assertEquals(button.props.stock_id, None)
+
+        button = Gtk.ToolButton('gtk-new')
+        self.assertEquals(button.props.stock_id, 'gtk-new')
+
 
 class TestGio(unittest.TestCase):
     def setUp(self):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]