summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--gtk/gtk.override4
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/test_button.py12
4 files changed, 22 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index d017970c..c708f585 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-06-21 Paul Pogonyshev <pogonyshev@gmx.net>
+
+ * gtk/gtk.override (_wrap_gtk_button_new): Fix 'use_underline'
+ being ignored if neither 'text' nor 'stock' is set (bug #524187).
+
+ * tests/Makefile.am:
+ * tests/test_button.py: New test file.
+
2008-06-10 Gian Mario Tagliaretti <gianmt@gnome.org>
* gtk/gtk.override: wrap gtk.show_about_dialog()
diff --git a/gtk/gtk.override b/gtk/gtk.override
index beb3b807..857c9d13 100644
--- a/gtk/gtk.override
+++ b/gtk/gtk.override
@@ -1601,12 +1601,10 @@ _wrap_gtk_button_new(PyGObject *self, PyObject *args, PyObject *kwargs)
pygobject_construct(self,
"label", stock, "use-stock", TRUE,
"use-underline", TRUE, NULL);
- else if (text)
+ else
pygobject_construct(self,
"label", text, "use-underline",
PyObject_IsTrue(py_use_underline), NULL);
- else
- pygobject_construct(self, NULL);
if (!self->obj) {
PyErr_SetString(PyExc_RuntimeError, "could not create GtkButton object");
return -1;
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c2d40c88..444a4275 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -4,6 +4,7 @@ tests = \
test_actiongroup.py \
test_api.py \
test_bin.py \
+ test_button.py \
test_container.py
test_conversion.py \
test_dialog.py \
diff --git a/tests/test_button.py b/tests/test_button.py
new file mode 100644
index 00000000..a38edafa
--- /dev/null
+++ b/tests/test_button.py
@@ -0,0 +1,12 @@
+import unittest
+
+from common import gtk
+
+class TextButton(unittest.TestCase):
+ # Bug #524187.
+ def test_constructor(self):
+ button = gtk.Button()
+ self.assert_(button.props.use_underline)
+
+if __name__ == '__main__':
+ unittest.main()