summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/gui
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysa/gui')
-rw-r--r--plugins/pychrysa/gui/editem.c10
-rw-r--r--plugins/pychrysa/gui/panels/panel.c5
2 files changed, 8 insertions, 7 deletions
diff --git a/plugins/pychrysa/gui/editem.c b/plugins/pychrysa/gui/editem.c
index 3b7a8b8..c7e4724 100644
--- a/plugins/pychrysa/gui/editem.c
+++ b/plugins/pychrysa/gui/editem.c
@@ -97,7 +97,7 @@ static void _update_editor_item_for_binary_python_wrapper(GEditorItem *item, GLo
target = pychrysalide_get_pygobject(G_OBJECT(item));
args = PyTuple_New(1);
- PyTuple_SetItem(args, 0, py_loaded_binary_from_c(binary));
+ PyTuple_SetItem(args, 0, pygobject_new(G_OBJECT(binary)));
value = run_python_method(target, "update_for_binary", args);
@@ -139,7 +139,7 @@ static void _update_editor_item_for_view_python_wrapper(GEditorItem *item, GtkVi
target = pychrysalide_get_pygobject(G_OBJECT(item));
args = PyTuple_New(1);
- PyTuple_SetItem(args, 0, py_view_panel_from_c(view));
+ PyTuple_SetItem(args, 0, pygobject_new(G_OBJECT(view)));
value = run_python_method(target, "update_for_view", args);
@@ -181,7 +181,7 @@ static void _update_editor_item_for_view_content_python_wrapper(GEditorItem *ite
target = pychrysalide_get_pygobject(G_OBJECT(item));
args = PyTuple_New(1);
- PyTuple_SetItem(args, 0, py_view_panel_from_c(view));
+ PyTuple_SetItem(args, 0, pygobject_new(G_OBJECT(view)));
value = run_python_method(target, "update_for_content", args);
@@ -280,7 +280,7 @@ static PyObject *py_editor_item_get_current_binary(PyObject *self, PyObject *arg
result = Py_None;
}
else
- result = py_loaded_binary_from_c(binary);
+ result = pygobject_new(G_OBJECT(binary));
return result;
@@ -315,7 +315,7 @@ static PyObject *py_editor_item_get_current_view(PyObject *self, PyObject *args)
result = Py_None;
}
else
- result = py_view_panel_from_c(panel);
+ result = pygobject_new(G_OBJECT(panel));
return result;
diff --git a/plugins/pychrysa/gui/panels/panel.c b/plugins/pychrysa/gui/panels/panel.c
index 4b982d0..fc261b5 100644
--- a/plugins/pychrysa/gui/panels/panel.c
+++ b/plugins/pychrysa/gui/panels/panel.c
@@ -65,7 +65,7 @@ static PyObject *py_panel_item_new(PyTypeObject *type, PyObject *args, PyObject
GEditorItem *item; /* Version GLib du format */
ret = PyArg_ParseTuple(args, "ssOs", &name, &lname, &widget, &path);
- if (!ret) return Py_None;
+ if (!ret) Py_RETURN_NONE;
item = g_panel_item_new(get_internal_ref(), name, lname,
GTK_WIDGET(pygobject_get(widget)), path);
@@ -73,7 +73,7 @@ static PyObject *py_panel_item_new(PyTypeObject *type, PyObject *args, PyObject
result = _py_panel_item_from_c(G_PANEL_ITEM(item), type);
g_object_unref(item);
- return (PyObject *)result;
+ return result;
}
@@ -102,6 +102,7 @@ PyObject *_py_panel_item_from_c(GPanelItem *item, PyTypeObject *type)
type = (PyTypeObject *)PyObject_GetAttrString(module, "PanelItem");
Py_DECREF(module);
}
+ else Py_INCREF(type);
pychrysalide_set_instance_data(G_OBJECT(item), type);