#[repr(C)]pub struct NSMenu {
pub ptr: Id<Object>,
}
Expand description
An object that manages an app’s menus.
Fields§
§ptr: Id<Object>
The raw pointer to the Objective-C object.
Implementations§
Source§impl NSMenu
impl NSMenu
Returns a Boolean value that indicates whether the menu bar is visible.
Sets whether the menu bar is visible and selectable by the user.
The menu bar height for the main menu in pixels.
Sourcepub fn init_with_title(title: NSString) -> Self
pub fn init_with_title(title: NSString) -> Self
Initializes and returns a menu having the specified title and with autoenabling of menu items turned on.
Sourcepub fn insert_item_at_index(&mut self, new_item: NSMenuItem, index: Int)
pub fn insert_item_at_index(&mut self, new_item: NSMenuItem, index: Int)
Inserts a menu item into the menu at a specific location.
Sourcepub fn insert_item_with_title_action_key_equivalent_at_index(
&mut self,
string: NSString,
sel: Sel,
char_code: NSString,
index: Int,
) -> NSMenuItem
pub fn insert_item_with_title_action_key_equivalent_at_index( &mut self, string: NSString, sel: Sel, char_code: NSString, index: Int, ) -> NSMenuItem
Creates and adds a menu item at a specified location in the menu.
Sourcepub fn add_item(&mut self, new_item: NSMenuItem)
pub fn add_item(&mut self, new_item: NSMenuItem)
Adds a menu item to the end of the menu.
Sourcepub fn add_item_with_title_action_key_equivalent(
&mut self,
title: NSString,
sel: Sel,
char_code: NSString,
) -> NSMenuItem
pub fn add_item_with_title_action_key_equivalent( &mut self, title: NSString, sel: Sel, char_code: NSString, ) -> NSMenuItem
Creates a new menu item and adds it to the end of the menu.
Sourcepub fn remove_item(&mut self, item: NSMenuItem)
pub fn remove_item(&mut self, item: NSMenuItem)
Removes a menu item from the menu.
Sourcepub fn remove_item_at_index(&mut self, index: Int)
pub fn remove_item_at_index(&mut self, index: Int)
Removes the menu item at a specified location in the menu.
Sourcepub fn remove_all_items(&mut self)
pub fn remove_all_items(&mut self)
Removes all the menu items in the menu.
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
.