ui/motif/menu.c

branch
newapi
changeset 417
f0fee61a70be
parent 416
89ad8467c39f
child 418
a57268d20ed9
--- a/ui/motif/menu.c	Sun Dec 15 11:59:30 2024 +0100
+++ b/ui/motif/menu.c	Sun Dec 15 22:13:05 2024 +0100
@@ -129,6 +129,24 @@
     if(s) {
         XmStringFree(s);
     }
+    
+    if(it->callback) {
+        UiEventData *eventdata = malloc(sizeof(UiEventData));
+        eventdata->callback = it->callback;
+        eventdata->userdata = it->userdata;
+        eventdata->obj = obj;
+        eventdata->value = 0;
+        XtAddCallback(
+                mitem,
+                XmNactivateCallback,
+                (XtCallbackProc)ui_push_button_callback,
+                eventdata);
+       XtAddCallback(
+                mitem,
+                XmNdestroyCallback,
+                (XtCallbackProc)ui_destroy_eventdata,
+                eventdata);
+    }
 }
 
 void add_menuseparator_widget(Widget p, int i, UiMenuItemI *item, UiObject *obj) {

mercurial