Struct fltk::menu::MenuItem [−][src]
pub struct MenuItem { /* fields omitted */ }
Expand description
Creates a menu item
Implementations
impl MenuItem
[src]
impl MenuItem
[src]pub fn new(choices: &[&'static str]) -> MenuItem
[src]
pub fn new(choices: &[&'static str]) -> MenuItem
[src]Initializes a new window, useful for popup menus
pub fn popup(&self, x: i32, y: i32) -> Option<MenuItem>
[src]
pub fn popup(&self, x: i32, y: i32) -> Option<MenuItem>
[src]Creates a popup menu at the specified coordinates and returns its choice
pub fn label_type(&self) -> LabelType
[src]
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]
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]
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]
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]
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]
pub fn set_label_font(&mut self, font: Font)
[src]Sets the label font of the menu item
pub fn label_size(&self) -> i32
[src]
pub fn label_size(&self) -> i32
[src]Returns the label size of the menu item
pub fn set_label_size(&mut self, sz: i32)
[src]
pub fn set_label_size(&mut self, sz: i32)
[src]Sets the label size of the menu item
pub fn deactivate(&mut self)
[src]
pub fn deactivate(&mut self)
[src]Deactivates the menu item
pub fn is_submenu(&self) -> bool
[src]
pub fn is_submenu(&self) -> bool
[src]Returns whether a menu item is a submenu
pub fn is_checkbox(&self) -> bool
[src]
pub fn is_checkbox(&self) -> bool
[src]Returns whether a menu item is a checkbox
pub unsafe fn user_data(&self) -> Option<Box<dyn FnMut()>>
[src]
pub unsafe fn user_data(&self) -> Option<Box<dyn FnMut()>>
[src]Get the user data
Safety
Can return multiple mutable instances of the user data, which has a different lifetime than the object
pub fn set_callback<F: FnMut(&mut Self) + 'static>(&mut self, cb: F)
[src]
pub fn set_callback<F: FnMut(&mut Self) + 'static>(&mut self, cb: F)
[src]Set a callback for the menu item
pub fn emit<T: 'static + Clone + Send + Sync>(
&mut self,
sender: Sender<T>,
msg: T
)
[src]
pub fn emit<T: 'static + Clone + Send + Sync>(
&mut self,
sender: Sender<T>,
msg: T
)
[src]Use a sender to send a message during callback
pub fn was_deleted(&self) -> bool
[src]
pub fn was_deleted(&self) -> bool
[src]Check if a menu item was deleted
Trait Implementations
impl IntoIterator for MenuItem
[src]
impl IntoIterator for MenuItem
[src]impl Send for MenuItem
[src]
impl Sync for MenuItem
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more