diff options
author | Dieter Verfaillie <dieterv@optionexplicit.be> | 2010-12-24 10:04:56 +1300 |
---|---|---|
committer | John Stowers <john.stowers@gmail.com> | 2010-12-24 10:04:56 +1300 |
commit | c5f0622b20c56988d369083cb822ab492269d6f9 (patch) | |
tree | c644da90f073b7b9bc19a85bfa320400b505eedc | |
parent | 828f3c430e535fae6e55a8e49ca0c7087b560ac2 (diff) | |
download | pygtk-c5f0622b20c56988d369083cb822ab492269d6f9.tar.gz |
Fix GtkAssistant.set_forward_page_func
* Allow passing None to set default func.
* Fixes bug 625603
-rw-r--r-- | gtk/gtk.override | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/gtk/gtk.override b/gtk/gtk.override index 4c9f98d8..75018f42 100644 --- a/gtk/gtk.override +++ b/gtk/gtk.override @@ -6950,20 +6950,26 @@ _wrap_gtk_assistant_set_forward_page_func(PyGObject *self, PyObject *args, kwlist, &pyfunc, &pyarg)) return NULL; - if (!PyCallable_Check(pyfunc)) { + if (pyfunc != Py_None && !PyCallable_Check(pyfunc)) { PyErr_SetString(PyExc_TypeError, "page_func must be a callable object"); return NULL; } - cunote = g_new0(PyGtkCustomNotify, 1); - cunote->func = pyfunc; - cunote->data = pyarg; - Py_INCREF(cunote->func); - Py_XINCREF(cunote->data); + + if (pyfunc == Py_None) { + gtk_assistant_set_forward_page_func(GTK_ASSISTANT(self->obj), + NULL, NULL, NULL); + } else { + cunote = g_new0(PyGtkCustomNotify, 1); + cunote->func = pyfunc; + cunote->data = pyarg; + Py_INCREF(cunote->func); + Py_XINCREF(cunote->data); - gtk_assistant_set_forward_page_func(GTK_ASSISTANT(self->obj), - pygtk_assistant_set_forward_page_func_cb, - cunote, pygtk_custom_destroy_notify); + gtk_assistant_set_forward_page_func(GTK_ASSISTANT(self->obj), + pygtk_assistant_set_forward_page_func_cb, + cunote, pygtk_custom_destroy_notify); + } Py_INCREF(Py_None); return Py_None; |