Adds setTarget to buttons and menu items, these are required in many cases

This commit is contained in:
svoss
2019-09-25 06:36:55 -07:00
parent e1229a6b9d
commit 4372c047e6
+14
View File
@@ -821,6 +821,7 @@ pub trait NSMenuItem: Sized {
unsafe fn initWithTitle_action_keyEquivalent_(self, title: id, action: SEL, key: id) -> id;
unsafe fn setKeyEquivalentModifierMask_(self, mask: NSEventModifierFlags);
unsafe fn setSubmenu_(self, submenu: id);
unsafe fn setTarget_(self, target: id);
}
impl NSMenuItem for id {
@@ -835,6 +836,10 @@ impl NSMenuItem for id {
unsafe fn setSubmenu_(self, submenu: id) {
msg_send![self, setSubmenu:submenu]
}
unsafe fn setTarget_(self, target: id) {
msg_send![self, setTarget:target]
}
}
pub type NSWindowDepth = libc::c_int;
@@ -2963,6 +2968,8 @@ pub trait NSButton: Sized {
msg_send![class!(NSButton), alloc]
}
unsafe fn initWithFrame_(self, frameRect: NSRect) -> id;
unsafe fn setTarget_(self, target: id /* Instance */);
unsafe fn setAction_(self, selector: objc::runtime::Sel /* (Instance *) */);
}
impl NSButton for id {
@@ -2978,6 +2985,13 @@ impl NSButton for id {
unsafe fn setImage_(self, img: id /* (NSImage *) */) {
msg_send![self, setImage:img]
}
unsafe fn setTarget_(self, target: id /* (Instance *) */) {
msg_send![self, setTarget:target]
}
unsafe fn setAction_(self, selector: objc::runtime::Sel /* (Instance method *) */) {
msg_send![self, setAction:selector];
}
}
pub trait NSImage: Sized {