# HG changeset patch # User Olaf Wintermann # Date 1732611724 -3600 # Node ID fc0df448dfbc2d52b3333fe1da325578506d22d0 # Parent b130f80ec7f99aed0c5b00a83efe454a0b687306 fix treeview contextmenu (GTK) diff -r b130f80ec7f9 -r fc0df448dfbc ui/gtk/list.c --- a/ui/gtk/list.c Thu Nov 21 18:45:47 2024 +0100 +++ b/ui/gtk/list.c Tue Nov 26 10:02:04 2024 +0100 @@ -402,11 +402,7 @@ } // TODO: destroy callback - if(args.contextmenu) { - UIMENU menu = ui_contextmenu_create(args.contextmenu, obj, view); - ui_widget_set_contextmenu(view, menu); - } - + GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(view)); if(args.multiselection) { gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE); @@ -420,6 +416,11 @@ GTK_POLICY_AUTOMATIC); // GTK_POLICY_ALWAYS SCROLLEDWINDOW_SET_CHILD(scroll_area, view); + if(args.contextmenu) { + UIMENU menu = ui_contextmenu_create(args.contextmenu, obj, scroll_area); + ui_widget_set_contextmenu(scroll_area, menu); + } + UI_APPLY_LAYOUT1(current, args); current->container->add(current->container, scroll_area, FALSE); diff -r b130f80ec7f9 -r fc0df448dfbc ui/gtk/menu.c --- a/ui/gtk/menu.c Thu Nov 21 18:45:47 2024 +0100 +++ b/ui/gtk/menu.c Tue Nov 26 10:02:04 2024 +0100 @@ -367,7 +367,6 @@ if(e->button == 3) { gtk_widget_show_all(GTK_WIDGET(menu)); ui_contextmenu_popup(menu, widget, 0, 0); - return TRUE; } } return FALSE; diff -r b130f80ec7f9 -r fc0df448dfbc ui/winui/appmenu.cpp --- a/ui/winui/appmenu.cpp Thu Nov 21 18:45:47 2024 +0100 +++ b/ui/winui/appmenu.cpp Tue Nov 26 10:02:04 2024 +0100 @@ -285,3 +285,11 @@ return flyout; } + +UIMENU ui_contextmenu_create(UiMenuBuilder *builder, UiObject *obj, UIWIDGET widget) { + return NULL; +} + +void ui_contextmenu_popup(UIMENU menu, UIWIDGET widget, int x, int y) { + +}