rust_macios/appkit/
ns_control.rs1use objc::{msg_send, runtime::Sel, sel, sel_impl};
2
3use crate::{appkit::INSView, object};
4
5use super::{interface_impl, INSResponder};
6
7object! {
8 unsafe pub struct NSControl;
10}
11
12impl INSResponder for NSControl {}
13
14impl INSView for NSControl {}
15
16#[interface_impl(NSView)]
17impl NSControl {
18 #[property]
22 pub fn action(&self) -> Sel {
23 unsafe { msg_send![self.m_self(), action] }
24 }
25
26 #[property]
32 pub fn set_action(&self, action: Sel) {
33 unsafe { msg_send![self.m_self(), setAction: action] }
34 }
35}