diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-07-30 10:57:08 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-07-30 10:57:08 (GMT) |
commit | fb1d26845908d131b1c92d7d7cd1bc402b656ca4 (patch) | |
tree | a6c6a30482ce97dfe7b985116877bb0ce8b7b0a0 /plugins/pychrysa/gtkext/bufferview.c | |
parent | 7b8eed3f8207fe9b629165f8230e38ee620900ea (diff) |
Registered properly the PyGObject wrappers for Python classes.
Diffstat (limited to 'plugins/pychrysa/gtkext/bufferview.c')
-rw-r--r-- | plugins/pychrysa/gtkext/bufferview.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/plugins/pychrysa/gtkext/bufferview.c b/plugins/pychrysa/gtkext/bufferview.c index a8b86e8..00f32bc 100644 --- a/plugins/pychrysa/gtkext/bufferview.c +++ b/plugins/pychrysa/gtkext/bufferview.c @@ -32,6 +32,7 @@ #include "viewpanel.h" +#include "../helpers.h" @@ -93,25 +94,15 @@ PyTypeObject *get_python_buffer_view_type(void) bool register_python_buffer_view(PyObject *module) { PyTypeObject *py_buffer_view_type; /* Type Python 'Bufferview' */ - int ret; /* Bilan d'un appel */ PyObject *dict; /* Dictionnaire du module */ py_buffer_view_type = get_python_buffer_view_type(); - py_buffer_view_type->tp_base = get_python_view_panel_type(); - py_buffer_view_type->tp_basicsize = py_buffer_view_type->tp_base->tp_basicsize; + dict = PyModule_GetDict(module); - if (PyType_Ready(py_buffer_view_type) != 0) + if (!register_class_for_pygobject(dict, GTK_TYPE_BUFFER_VIEW, py_buffer_view_type, get_python_view_panel_type())) return false; - Py_INCREF(py_buffer_view_type); - ret = PyModule_AddObject(module, "Bufferview", (PyObject *)py_buffer_view_type); - if (ret != 0) return false; - - dict = PyModule_GetDict(module); - pygobject_register_class(dict, "Bufferview", GTK_TYPE_BUFFER_VIEW, py_buffer_view_type, - Py_BuildValue("(O)", py_buffer_view_type->tp_base)); - return true; } |