[][src]Struct fltk::menu::MenuItem

pub struct MenuItem { /* fields omitted */ }

Creates a menu item

Implementations

impl MenuItem[src]

pub fn new(choices: &[&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

Safety

Can return multiple mutable instances of the user data, which has a different lifetime than the object

pub unsafe fn set_user_data(&mut self, data: *mut c_void)[src]

Manually set the user data

Safety

Manually set the user data, the data validity can't be checked since it's opaque

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]

Use a sender to send a message during callback

pub unsafe fn unset_callback(&mut self)[src]

Manually unset a callback

Safety

Invoking the callback after being unset is undefined

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.