Started work on being able to call some Cocoa built-in methods

dev
Armando Rivera 3 years ago
parent 7d2dc9b9c7
commit 08342e5372
  1. 13
      src/cocoa/widgets/functions.m

@ -168,3 +168,16 @@ void addToParent(id parent, id child) {
void setToolTip(id widget, const char *tooltip) {
[widget setToolTip: [NSString stringWithUTF8String: tooltip]];
}
void eventAction(id widget, EVENT_ACTION callback) {
[widget setEventAction: callback];
}
void setSystemAction(id widget, const char *Title, const char *actionName) {
SEL selector = NSSelectorFromString(NSSTR(actionName));
id menuItem = [widget itemWithTitle: NSSTR(Title)];
NSLog(@"%d",[menuItem respondsToSelector: selector]);
if (selector) {
[menuItem setAction: @selector(selector)];
}
}

Loading…
Cancel
Save