Struct rust_macios::appkit::NSMenuItem
source · Expand description
A command item in an app menu.
Fields§
§ptr: Id<Object>
The raw pointer to the Objective-C object.
Implementations§
source§impl NSMenuItem
impl NSMenuItem
sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
A Boolean value that indicates whether the menu item is enabled.
sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Sets whether the menu item is enabled.
A Boolean value that indicates whether the menu item is hidden.
Sets whether the menu item is hidden.
A Boolean value that indicates whether the menu item or any of its superitems is hidden.
sourcepub fn set_target(&mut self, target: id)
pub fn set_target(&mut self, target: id)
Sets the menu item’s target.
sourcepub fn set_action(&mut self, action: Sel)
pub fn set_action(&mut self, action: Sel)
Sets the menu item’s action-method selector.
The submenu of the menu item.
Sets the submenu of the menu item.
A Boolean value that indicates whether the menu item has a submenu.
sourcepub fn parent_item(&self) -> Option<NSMenuItem>
pub fn parent_item(&self) -> Option<NSMenuItem>
The menu item whose submenu contains the receiver.
Methods from Deref<Target = Object>§
sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Returns a reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.
sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Returns a mutable reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.