ui/gtk/image.c

branch
newapi
changeset 389
d15eca5fd8b3
parent 381
b47bda6666ce
child 390
b130f80ec7f9
--- a/ui/gtk/image.c	Thu Nov 21 12:04:53 2024 +0100
+++ b/ui/gtk/image.c	Thu Nov 21 13:17:56 2024 +0100
@@ -29,6 +29,7 @@
 #include "image.h"
 
 #include "container.h"
+#include "menu.h"
 #include "../common/context.h"
 #include "../common/object.h"
 
@@ -51,6 +52,7 @@
     gtk_container_add(GTK_CONTAINER(eventbox), image);
 #else
     SCROLLEDWINDOW_SET_CHILD(scrolledwindow, image);
+    GtkWidget *eventbox = image;
 #endif
     
     UI_APPLY_LAYOUT1(current, args);
@@ -70,6 +72,11 @@
         }
     }
     
+    if(args.contextmenu) {
+        UIMENU menu = ui_create_menu(args.contextmenu, obj);
+        ui_widget_set_contextmenu(eventbox, menu);
+    }
+    
     return scrolledwindow;
 }
 

mercurial