diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-01-09 22:54:59 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-01-09 23:11:29 (GMT) |
commit | c0528230469b10d606b9d1fa66a18696b2584fed (patch) | |
tree | a9ce71e300eba736cd31f3f45b1752618a39c04d /src/gui | |
parent | 43f249445c9c69b9eabeea8be08b6b55a474f1fc (diff) |
Updated the Python documentation for GUI items.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/editem.c | 9 | ||||
-rw-r--r-- | src/gui/editor.c | 2 | ||||
-rw-r--r-- | src/gui/tb/portions.c | 2 |
3 files changed, 12 insertions, 1 deletions
diff --git a/src/gui/editem.c b/src/gui/editem.c index ef7cb30..96d63c7 100644 --- a/src/gui/editem.c +++ b/src/gui/editem.c @@ -129,7 +129,14 @@ const char *g_editor_item_get_name(const GEditorItem *item) GtkWidget *g_editor_item_get_widget(const GEditorItem *item) { - return item->widget; + GtkWidget *result; /* Composant à retourner */ + + result = item->widget; + + if (result != NULL) + g_object_ref(G_OBJECT(result)); + + return result; } diff --git a/src/gui/editor.c b/src/gui/editor.c index 60e4095..6a270fb 100644 --- a/src/gui/editor.c +++ b/src/gui/editor.c @@ -262,6 +262,7 @@ GtkWidget *create_editor(void) menuboard = g_editor_item_get_widget(editem); gtk_box_pack_start(GTK_BOX(vbox1), menuboard, FALSE, FALSE, 0); + g_object_unref(G_OBJECT(menuboard)); g_object_set_data(ref, "menubar", editem); g_object_set_data(ref, "menuboard", menuboard); @@ -291,6 +292,7 @@ GtkWidget *create_editor(void) widget = g_editor_item_get_widget(editem); gtk_box_pack_start(GTK_BOX(vbox1), widget, FALSE, FALSE, 0); + g_object_unref(G_OBJECT(widget)); /* Autre */ diff --git a/src/gui/tb/portions.c b/src/gui/tb/portions.c index a8eb606..af7fc6c 100644 --- a/src/gui/tb/portions.c +++ b/src/gui/tb/portions.c @@ -241,6 +241,8 @@ static void change_portions_tbitem_current_content(GEditorItem *item, GLoadedCon else gtk_widget_hide(GTK_WIDGET(widget)); + g_object_unref(G_OBJECT(widget)); + } |