Struct iui::menus::MenuItem [−][src]
pub struct MenuItem { /* fields omitted */ }
A MenuItem
represents an item that is shown in a Menu
. Note that, unlike many controls,
the text on MenuItem
s cannot be changed after creation.
Methods
impl MenuItem
[src]
impl MenuItem
pub fn enable(&self, _ctx: &UI)
[src]
pub fn enable(&self, _ctx: &UI)
Enables the item, allowing it to be selected. This is the default state of a menu item.
pub fn disable(&self, _ctx: &UI)
[src]
pub fn disable(&self, _ctx: &UI)
Disables the item, preventing it from being selected and providing a visual cue to the user that it cannot be selected.
pub fn checked(&self, _ctx: &UI) -> bool
[src]
pub fn checked(&self, _ctx: &UI) -> bool
Returns true
if the menu item is checked, and false if it is not checked (or not checkable).
pub fn set_checked(&self, _ctx: &UI, checked: bool)
[src]
pub fn set_checked(&self, _ctx: &UI, checked: bool)
Sets the menu item to either checked or unchecked based on the given value.
Setting the checked value of a non-checkable menu item has no effect.
pub fn on_clicked<F: FnMut(&MenuItem, &Window)>(&self, _ctx: &UI, callback: F)
[src]
pub fn on_clicked<F: FnMut(&MenuItem, &Window)>(&self, _ctx: &UI, callback: F)
Sets the function to be executed when the item is clicked/selected.
pub unsafe fn from_raw(raw: *mut uiMenuItem) -> Self
[src]
pub unsafe fn from_raw(raw: *mut uiMenuItem) -> Self