diff options
Diffstat (limited to 'src/gui/menus')
-rw-r--r-- | src/gui/menus/project.c | 4 | ||||
-rw-r--r-- | src/gui/menus/view.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/menus/project.c b/src/gui/menus/project.c index f0b9c17..a5992bf 100644 --- a/src/gui/menus/project.c +++ b/src/gui/menus/project.c @@ -117,7 +117,7 @@ void update_menu_project_for_project(GtkWidget *widget, GStudyProject *project, size_t count; /* Nombre de contenus attachés */ GLoadedContent **contents; /* Liste de ces contenus */ size_t i; /* Boucle de parcours #2 */ - const char *desc; /* Description à afficher */ + char *desc; /* Description à afficher */ GtkWidget *submenuitem; /* Sous-menu à ajouter */ menuitem = GTK_WIDGET(g_object_get_data(G_OBJECT(widget), "menu_prj_remove_bin")); @@ -145,6 +145,8 @@ void update_menu_project_for_project(GtkWidget *widget, GStudyProject *project, g_object_set_data_full(G_OBJECT(submenuitem), "content", contents[i], g_object_unref); gtk_container_add(GTK_CONTAINER(menubar), submenuitem); + free(desc); + /** * Note : l'appel à g_object_unref() est réalisé lorsque la référence * est retirée du menu. diff --git a/src/gui/menus/view.c b/src/gui/menus/view.c index bc833a3..b9451e0 100644 --- a/src/gui/menus/view.c +++ b/src/gui/menus/view.c @@ -198,6 +198,7 @@ void rebuild_menu_view_for_content(GtkWidget *widget, GObject *ref, GLoadedConte GList *iter; /* Boucle de parcours */ unsigned int count; /* Nombre d'itérations à mener */ GSList *rgroup; /* Groupe des boutons radio */ + char *caption; /* Etiquette pour un menu */ /* Retrait d'éventuels anciens menus */ @@ -246,12 +247,13 @@ void rebuild_menu_view_for_content(GtkWidget *widget, GObject *ref, GLoadedConte for (i = 0; i < count; i++) { asprintf(&key, "mnu_view_panel_%u", i); + caption = g_loaded_content_get_view_name(new, i); - submenuitem = qck_create_radio_menu_item(ref, key, rgroup, - g_loaded_content_get_view_name(new, i), + submenuitem = qck_create_radio_menu_item(ref, key, rgroup, caption, G_CALLBACK(mcb_view_change_support), NULL); g_object_set_data(G_OBJECT(submenuitem), "kind_of_view", GUINT_TO_POINTER(i)); + free(caption); free(key); asprintf(&key, "F%u", 3 + i); |