[−][src]Struct fltk::menu::MenuItem
Creates a menu item
Implementations
impl MenuItem
[src]
pub fn new(choices: Vec<&str>) -> MenuItem
[src]
Initializes a new window, useful for popup menus
pub fn popup(&mut self, x: i32, y: i32) -> Option<MenuItem>
[src]
Creates a popup menu at the specified coordinates and returns its choice
pub fn label(&self) -> Option<String>
[src]
Returns the label of the menu item
pub fn set_label(&mut self, txt: &str)
[src]
Sets the label of the menu item
pub fn label_type(&self) -> LabelType
[src]
Returns the label type of the menu item
pub fn set_label_type(&mut self, typ: LabelType)
[src]
Sets the label type of the menu item
pub fn label_color(&self) -> Color
[src]
Returns the label color of the menu item
pub fn set_label_color(&mut self, color: Color)
[src]
Sets the label color of the menu item
pub fn label_font(&self) -> Font
[src]
Returns the label font of the menu item
pub fn set_label_font(&mut self, font: Font)
[src]
Sets the label font of the menu item
pub fn label_size(&self) -> u32
[src]
Returns the label size of the menu item
pub fn set_label_size(&mut self, sz: u32)
[src]
Sets the label size of the menu item
pub fn value(&self) -> bool
[src]
Returns the value of the menu item
pub fn set(&mut self)
[src]
Sets the menu item
pub fn clear(&mut self)
[src]
Clears the menu item
pub fn visible(&self) -> bool
[src]
Returns whether the menu item is visible or not
pub fn active(&mut self) -> bool
[src]
Returns whether the menu item is active
pub fn activate(&mut self)
[src]
Activates the menu item
pub fn deactivate(&mut self)
[src]
Deactivates the menu item
pub fn is_submenu(&self) -> bool
[src]
Returns whether a menu item is a submenu
pub fn is_checkbox(&self) -> bool
[src]
Returns whether a menu item is a checkbox
pub fn is_radio(&self) -> bool
[src]
Returns whether a menu item is a radio item
pub fn show(&mut self)
[src]
Shows the menu item
pub fn hide(&mut self)
[src]
Hides the menu item
pub fn next(&mut self, idx: u32) -> Option<MenuItem>
[src]
Get the next menu item
pub unsafe fn user_data(&self) -> Option<Box<dyn FnMut()>>
[src]
Get the user data
pub unsafe fn set_user_data(&mut self, data: *mut c_void)
[src]
Manually set the user data
pub fn set_callback(&mut self, cb: Box<dyn FnMut()>)
[src]
Set a callback for the menu item
pub fn emit<T: 'static + Copy + Send + Sync>(
&mut self,
sender: Sender<T>,
msg: T
)
[src]
&mut self,
sender: Sender<T>,
msg: T
)
Use a sender to send a message during callback
pub unsafe fn unset_callback(&mut self)
[src]
Manually unset a callback
pub fn safe_unset_callback(&mut self)
[src]
Delete the old callback and replace it with an empty one
pub fn was_deleted(&self) -> bool
[src]
Check if a menu item was deleted
Trait Implementations
impl Clone for MenuItem
[src]
impl Debug for MenuItem
[src]
impl Drop for MenuItem
[src]
impl Send for MenuItem
[src]
impl Sync for MenuItem
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,