diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2023-05-22 20:56:32 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2023-05-22 20:56:32 (GMT) |
commit | e1a2823b5d831349467d309ce42d56055ec9c04f (patch) | |
tree | bc4dd464d10cd379622ceb361398895d59849409 /plugins/pychrysalide/gtkext/displaypanel.c | |
parent | 15fb909bdd8ca0f37dd71da7427ea6bc6bb71cbb (diff) |
Rely on GObject-introspection implementation for some registrations.
Diffstat (limited to 'plugins/pychrysalide/gtkext/displaypanel.c')
-rw-r--r-- | plugins/pychrysalide/gtkext/displaypanel.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/plugins/pychrysalide/gtkext/displaypanel.c b/plugins/pychrysalide/gtkext/displaypanel.c index dc7b8e5..b2eb038 100644 --- a/plugins/pychrysalide/gtkext/displaypanel.c +++ b/plugins/pychrysalide/gtkext/displaypanel.c @@ -100,8 +100,6 @@ bool ensure_python_display_panel_is_registered(void) { bool result; /* Bilan à retourner */ PyTypeObject *type; /* Type Python 'DisplayPanel' */ - PyObject *parent_mod; /* Module Python Fixed */ - PyObject *fixed; /* Module "GtkFixed" */ PyObject *module; /* Module à recompléter */ PyObject *dict; /* Dictionnaire du module */ @@ -113,27 +111,13 @@ bool ensure_python_display_panel_is_registered(void) { module = get_access_to_python_module("pychrysalide.gtkext"); - parent_mod = PyImport_ImportModule("gi.repository.Gtk"); - - if (parent_mod == NULL) - goto rpdp_exit; - - fixed = PyObject_GetAttrString(parent_mod, "Fixed"); - - Py_DECREF(parent_mod); - dict = PyModule_GetDict(module); - result = register_class_for_pygobject(dict, GTK_TYPE_DISPLAY_PANEL, type, (PyTypeObject *)fixed); - Py_DECREF(fixed); + if (!register_class_for_pygobject(dict, GTK_TYPE_DISPLAY_PANEL, type)) + return false; } - else - result = true; - - rpdp_exit: - return result; } |