[Xfce4-commits] <thunarx-python:master> Override the thunarx.PropertyPage constructor to allow for a string label or a gtkwidget label
Adam Plumb
noreply at xfce.org
Thu May 27 18:12:34 CEST 2010
Updating branch refs/heads/master
to 17f75c66bd09108b7ad62f77551e1d3e01379344 (commit)
from 0073dd87b22bae994984fe6f31d43c8132637410 (commit)
commit 17f75c66bd09108b7ad62f77551e1d3e01379344
Author: Adam Plumb <adamplumb at gmail.com>
Date: Wed Jan 27 10:16:30 2010 -0500
Override the thunarx.PropertyPage constructor to allow for a string label or a gtkwidget label
src/thunarx.override | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/src/thunarx.override b/src/thunarx.override
index d4b1832..bf2d3c7 100644
--- a/src/thunarx.override
+++ b/src/thunarx.override
@@ -378,3 +378,35 @@ _wrap_thunarx_file_info_get_vfs_info(PyGObject *self)
Py_DECREF(Py_None);
return Py_None;
}
+%%
+override thunarx_property_page_new
+static int
+_wrap_thunarx_property_page_new(PyGObject *self, PyObject *args)
+{
+ PyGObject *arg;
+ char *label;
+ GtkWidget *label_widget;
+
+ if (!PyArg_ParseTuple(args,"O:ThunarxPropertyPage.__init__", &arg))
+ return -1;
+
+ if (PyObject_TypeCheck(arg, &PyString_Type))
+ {
+ label = PyString_AsString((PyObject *)arg);
+ Py_DECREF(arg);
+ self->obj = (GObject *)thunarx_property_page_new(label);
+ }
+ else if (PyObject_TypeCheck(arg, &PyGtkWidget_Type))
+ {
+ label_widget = GTK_WIDGET(arg->obj);
+ Py_DECREF(arg);
+ self->obj = (GObject *)thunarx_property_page_new_with_label_widget(label_widget);
+ }
+
+ if (!self->obj) {
+ PyErr_SetString(PyExc_RuntimeError, "could not create ThunarxPropertyPage object");
+ return -1;
+ }
+ pygobject_register_wrapper((PyObject *)self);
+ return 0;
+}
More information about the Xfce4-commits
mailing list