From 71c10ce7228c4d33fc83f1cd3bcfe3c0c53a9dab Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Sat, 13 Jul 2024 11:14:14 +0200 Subject: [PATCH] WIP: learning menu (cleaning) --- src/calls.c | 1 + src/widget.c/menu.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/calls.c b/src/calls.c index 668364f..4dd62d6 100644 --- a/src/calls.c +++ b/src/calls.c @@ -402,6 +402,7 @@ void on_clicked_MENU (GtkWidget *btt_reset, gpointer menu_button) printf ("callback.on_clicked_MENU() button\n"); // presents the text_window and works only once.\nIt should present a menu.\n"); // TODO learning_how_to_create_a_menu (menu_button); + // https://docs.gtk.org/gtk4/class.ListBox.html gtk_window_present (GTK_WINDOW (widget_head_get_TEXT_WINDOW())); } diff --git a/src/widget.c/menu.c b/src/widget.c/menu.c index 47e3a1f..8e3ffe6 100644 --- a/src/widget.c/menu.c +++ b/src/widget.c/menu.c @@ -86,6 +86,7 @@ GtkWidget *get_menu_anchor() struct MenuNode_t *item_b = create_user_menu_node("item_b");add_menu_item (menu_root, item_b); struct MenuNode_t *item_c = create_user_menu_node("item_c");add_menu_item (menu_root, item_c); + GtkWidget* list_box = gtk_list_box_new(); GtkStringList *model = gtk_string_list_new (NULL); gtk_string_list_append (model, menu_root->text); GtkSignalListItemFactory *factory = GTK_SIGNAL_LIST_ITEM_FACTORY (gtk_signal_list_item_factory_new());