ui/cocoa/MainWindow.m

changeset 569
5c06bb9ea458
parent 454
57a2c6c04966
child 570
a2df724b4cb9
--- a/ui/cocoa/MainWindow.m	Thu Apr 17 10:33:05 2025 +0200
+++ b/ui/cocoa/MainWindow.m	Thu Apr 17 11:18:57 2025 +0200
@@ -30,6 +30,9 @@
 #import "Container.h"
 #import "GridLayout.h"
 #import "../common/object.h"
+#import <objc/runtime.h>
+
+#import "EventData.h"
 
 @implementation MainWindow
 
@@ -62,4 +65,12 @@
     return self;
 }
 
+- (void)menuItemAction:(id)sender {
+    EventData *event = objc_getAssociatedObject(sender, "eventdata");
+    if(event) {
+        event.obj = self.uiobj; // temporary set the event object
+        [event handleEvent:sender];
+    }
+}
+
 @end

mercurial