diff -r 9e2aee097b69 -r 132c7bcc6997 ui/gtk/menu.c --- a/ui/gtk/menu.c Sun Mar 31 09:58:07 2024 +0200 +++ b/ui/gtk/menu.c Sun Mar 31 16:19:01 2024 +0200 @@ -74,6 +74,16 @@ return mb; } +void ui_add_menu_items(GtkWidget *parent, int i, UiMenu *menu, UiObject *obj) { + UiMenuItemI *it = menu->items_begin; + int index = 0; + while(it) { + createMenuItem[it->type](parent, index, it, obj); + it = it->next; + index++; + } +} + void add_menu_widget(GtkWidget *parent, int i, UiMenuItemI *item, UiObject *obj) { UiMenu *menu = (UiMenu*)item; @@ -81,14 +91,8 @@ GtkWidget *menu_item = gtk_menu_item_new_with_mnemonic(menu->label); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), menu_widget); - UiMenuItemI *it = menu->items_begin; - int index = 0; - while(it) { - createMenuItem[it->type](menu_widget, index, it, obj); - - it = it->next; - index++; - } + ui_add_menu_items(menu_widget, i, menu, obj); + gtk_menu_shell_append(GTK_MENU_SHELL(parent), menu_item); }