diff options
Diffstat (limited to 'plugins/pychrysa/gui/panels/panel.c')
-rw-r--r-- | plugins/pychrysa/gui/panels/panel.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/plugins/pychrysa/gui/panels/panel.c b/plugins/pychrysa/gui/panels/panel.c index bfdfb5f..0e15fb1 100644 --- a/plugins/pychrysa/gui/panels/panel.c +++ b/plugins/pychrysa/gui/panels/panel.c @@ -226,28 +226,18 @@ static bool py_panel_item_define_constants(PyTypeObject *obj_type) bool register_python_panel_item(PyObject *module) { PyTypeObject *py_panel_item_type; /* Type Python 'LoadedBinary' */ - int ret; /* Bilan d'un appel */ PyObject *dict; /* Dictionnaire du module */ py_panel_item_type = get_python_panel_item_type(); - py_panel_item_type->tp_base = get_python_editor_item_type(); - py_panel_item_type->tp_basicsize = py_panel_item_type->tp_base->tp_basicsize; + dict = PyModule_GetDict(module); - if (PyType_Ready(py_panel_item_type) != 0) + if (!register_class_for_pygobject(dict, G_TYPE_PANEL_ITEM, py_panel_item_type, get_python_editor_item_type())) return false; if (!py_panel_item_define_constants(py_panel_item_type)) return false; - Py_INCREF(py_panel_item_type); - ret = PyModule_AddObject(module, "PanelItem", (PyObject *)py_panel_item_type); - if (ret != 0) return false; - - dict = PyModule_GetDict(module); - pygobject_register_class(dict, "PanelItem", G_TYPE_PANEL_ITEM, py_panel_item_type, - Py_BuildValue("(O)", py_panel_item_type->tp_base)); - return true; } |