diff options
Diffstat (limited to 'plugins/pychrysa/gtkext/viewpanel.c')
-rw-r--r-- | plugins/pychrysa/gtkext/viewpanel.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/plugins/pychrysa/gtkext/viewpanel.c b/plugins/pychrysa/gtkext/viewpanel.c index c031627..f8d6d4e 100644 --- a/plugins/pychrysa/gtkext/viewpanel.c +++ b/plugins/pychrysa/gtkext/viewpanel.c @@ -228,7 +228,7 @@ bool register_python_view_panel(PyObject *module) { PyTypeObject *py_view_panel_type; /* Type Python 'ViewPanel' */ PyObject *parent_mod; /* Module Python Fixed */ - int ret; /* Bilan d'un appel */ + PyObject *fixed; /* Module "GtkFixed" */ PyObject *dict; /* Dictionnaire du module */ py_view_panel_type = get_python_view_panel_type(); @@ -236,25 +236,17 @@ bool register_python_view_panel(PyObject *module) parent_mod = PyImport_ImportModule("gi.repository.Gtk"); if (parent_mod == NULL) return false; - py_view_panel_type->tp_base = (PyTypeObject *)PyObject_GetAttrString(parent_mod, "Fixed"); + fixed = PyObject_GetAttrString(parent_mod, "Fixed"); Py_DECREF(parent_mod); - py_view_panel_type->tp_basicsize = py_view_panel_type->tp_base->tp_basicsize; + dict = PyModule_GetDict(module); - if (PyType_Ready(py_view_panel_type) != 0) + if (!register_class_for_pygobject(dict, GTK_TYPE_VIEW_PANEL, py_view_panel_type, (PyTypeObject *)fixed)) return false; if (!py_view_panel_define_constants(py_view_panel_type)) return false; - Py_INCREF(py_view_panel_type); - ret = PyModule_AddObject(module, "ViewPanel", (PyObject *)py_view_panel_type); - if (ret != 0) return false; - - dict = PyModule_GetDict(module); - pygobject_register_class(dict, "ViewPanel", GTK_TYPE_VIEW_PANEL, py_view_panel_type, - Py_BuildValue("(O)", py_view_panel_type->tp_base)); - return true; } |