Trait fltk::prelude::MenuExt [−][src]
pub unsafe trait MenuExt: WidgetExt {}Show methods
fn find_item(&self, name: &str) -> Option<MenuItem>; fn set_item(&mut self, item: &MenuItem) -> bool; fn find_index(&self, label: &str) -> i32; fn text_font(&self) -> Font; fn set_text_font(&mut self, c: Font); fn text_size(&self) -> i32; fn set_text_size(&mut self, c: i32); fn text_color(&self) -> Color; fn set_text_color(&mut self, c: Color); fn add<F: FnMut(&mut Self) + 'static>(
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
where
Self: Sized; fn insert<F: FnMut(&mut Self) + 'static>(
&mut self,
idx: i32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
where
Self: Sized; fn add_emit<T: 'static + Clone + Send + Sync>(
&mut self,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
where
Self: Sized; fn insert_emit<T: 'static + Clone + Send + Sync>(
&mut self,
idx: i32,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
where
Self: Sized; fn remove(&mut self, idx: i32); fn add_choice(&mut self, text: &str); fn choice(&self) -> Option<String>; fn value(&self) -> i32; fn set_value(&mut self, v: i32) -> bool; fn clear(&mut self); fn clear_submenu(&mut self, idx: i32) -> Result<(), FltkError>; unsafe fn unsafe_clear(&mut self); unsafe fn unsafe_clear_submenu(&mut self, idx: i32) -> Result<(), FltkError>; fn size(&self) -> i32; fn text(&self, idx: i32) -> Option<String>; fn at(&self, idx: i32) -> Option<MenuItem>; fn mode(&self, idx: i32) -> MenuFlag; fn set_mode(&mut self, idx: i32, flag: MenuFlag); fn end(&mut self); fn set_down_frame(&mut self, f: FrameType); fn down_frame(&self) -> FrameType; fn global(&mut self);
Expand description
Defines the methods implemented by all menu widgets
Required methods
fn find_item(&self, name: &str) -> Option<MenuItem>
[src]
fn find_item(&self, name: &str) -> Option<MenuItem>
[src]Get a menu item by name
fn set_item(&mut self, item: &MenuItem) -> bool
[src]
fn set_item(&mut self, item: &MenuItem) -> bool
[src]Set selected item
fn find_index(&self, label: &str) -> i32
[src]
fn find_index(&self, label: &str) -> i32
[src]Find an item’s index by its label
fn text_font(&self) -> Font
[src]
fn text_font(&self) -> Font
[src]Return the text font
fn set_text_font(&mut self, c: Font)
[src]
fn set_text_font(&mut self, c: Font)
[src]Sets the text font
fn text_size(&self) -> i32
[src]
fn text_size(&self) -> i32
[src]Return the text size
fn set_text_size(&mut self, c: i32)
[src]
fn set_text_size(&mut self, c: i32)
[src]Sets the text size
fn text_color(&self) -> Color
[src]
fn text_color(&self) -> Color
[src]Return the text color
fn set_text_color(&mut self, c: Color)
[src]
fn set_text_color(&mut self, c: Color)
[src]Sets the text color
fn add<F: FnMut(&mut Self) + 'static>(
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
) where
Self: Sized,
[src]
fn add<F: FnMut(&mut Self) + 'static>(
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
) where
Self: Sized,
[src]Add a menu item along with its callback. The characters “&”, “/”, “\”, and “_” (underscore) are treated as special characters in the label string. The “&” character specifies that the following character is an accelerator and will be underlined. The “\” character is used to escape the next character in the string. Labels starting with the “_” (underscore) character cause a divider to be placed after that menu item. Takes the menu item as a closure argument
fn insert<F: FnMut(&mut Self) + 'static>(
&mut self,
idx: i32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
) where
Self: Sized,
[src]
fn insert<F: FnMut(&mut Self) + 'static>(
&mut self,
idx: i32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
) where
Self: Sized,
[src]Inserts a menu item at an index along with its callback. The characters “&”, “/”, “\”, and “_” (underscore) are treated as special characters in the label string. The “&” character specifies that the following character is an accelerator and will be underlined. The “\” character is used to escape the next character in the string. Labels starting with the “_” (underscore) character cause a divider to be placed after that menu item. Takes the menu item as a closure argument
fn add_emit<T: 'static + Clone + Send + Sync>(
&mut self,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
) where
Self: Sized,
[src]
fn add_emit<T: 'static + Clone + Send + Sync>(
&mut self,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
) where
Self: Sized,
[src]Add a menu item along with an emit (sender and message). The characters “&”, “/”, “\”, and “_” (underscore) are treated as special characters in the label string. The “&” character specifies that the following character is an accelerator and will be underlined. The “\” character is used to escape the next character in the string. Labels starting with the “_” (underscore) character cause a divider to be placed after that menu item.
fn insert_emit<T: 'static + Clone + Send + Sync>(
&mut self,
idx: i32,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
) where
Self: Sized,
[src]
fn insert_emit<T: 'static + Clone + Send + Sync>(
&mut self,
idx: i32,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
) where
Self: Sized,
[src]Inserts a menu item along with an emit (sender and message). The characters “&”, “/”, “\”, and “_” (underscore) are treated as special characters in the label string. The “&” character specifies that the following character is an accelerator and will be underlined. The “\” character is used to escape the next character in the string. Labels starting with the “_” (underscore) character cause a divider to be placed after that menu item.
fn remove(&mut self, idx: i32)
[src]
fn remove(&mut self, idx: i32)
[src]Remove a menu item by index
fn add_choice(&mut self, text: &str)
[src]
fn add_choice(&mut self, text: &str)
[src]Adds a simple text option to the Choice and MenuButton
widgets.
The characters “&”, “/”, “\”, “|”, and “_” (underscore) are treated as special characters in the label string. The “&” character specifies that the following character is an accelerator and will be underlined.
The “\” character is used to escape the next character in the string. Labels starting with the “_” (underscore) character cause a divider to be placed after that menu item.
fn choice(&self) -> Option<String>
[src]
fn choice(&self) -> Option<String>
[src]Gets the user choice from the Choice and MenuButton
widgets
fn value(&self) -> i32
[src]
fn value(&self) -> i32
[src]Get index into menu of the last item chosen, returns -1 if no item was chosen
fn set_value(&mut self, v: i32) -> bool
[src]
fn set_value(&mut self, v: i32) -> bool
[src]Set index into menu of the last item chosen,return true if the new value is different than the old one
fn clear(&mut self)
[src]
fn clear(&mut self)
[src]Clears the items in a menu, effectively deleting them.
fn clear_submenu(&mut self, idx: i32) -> Result<(), FltkError>
[src]
fn clear_submenu(&mut self, idx: i32) -> Result<(), FltkError>
[src]Clears a submenu by index, failure return FltkErrorKind::FailedOperation
Errors
Errors on failure to clear the submenu
unsafe fn unsafe_clear(&mut self)
[src]
unsafe fn unsafe_clear(&mut self)
[src]Clears the items in a menu, effectively deleting them, and recursively force-cleans capturing callbacks
Safety
Deletes user_data
and any captured objects in the callback
unsafe fn unsafe_clear_submenu(&mut self, idx: i32) -> Result<(), FltkError>
[src]
unsafe fn unsafe_clear_submenu(&mut self, idx: i32) -> Result<(), FltkError>
[src]Clears a submenu by index, failure return FltkErrorKind::FailedOperation
. Also recursively force-cleans capturing callbacks
Safety
Deletes user_data
and any captured objects in the callback
Errors
Errors on failure to clear the submenu
fn size(&self) -> i32
[src]
fn size(&self) -> i32
[src]Get the size of the menu widget
fn text(&self, idx: i32) -> Option<String>
[src]
fn text(&self, idx: i32) -> Option<String>
[src]Get the text label of the menu item at index idx
fn at(&self, idx: i32) -> Option<MenuItem>
[src]
fn at(&self, idx: i32) -> Option<MenuItem>
[src]Get the menu item at an index
fn mode(&self, idx: i32) -> MenuFlag
[src]
fn mode(&self, idx: i32) -> MenuFlag
[src]Set the mode of a menu item by index and flag
Implementors
impl MenuExt for Choice
[src]
impl MenuExt for Choice
[src]fn add<F: FnMut(&mut Self) + 'static>(
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
[src]
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
fn insert<F: FnMut(&mut Self) + 'static>(
&mut self,
idx: i32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
[src]
&mut self,
idx: i32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
fn add_emit<T: 'static + Clone + Send + Sync>(
&mut self,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
[src]
&mut self,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
fn insert_emit<T: 'static + Clone + Send + Sync>(
&mut self,
idx: i32,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
[src]
&mut self,
idx: i32,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
fn remove(&mut self, idx: i32)
[src]
fn find_item(&self, name: &str) -> Option<MenuItem>
[src]
fn set_item(&mut self, item: &MenuItem) -> bool
[src]
fn find_index(&self, label: &str) -> i32
[src]
fn text_font(&self) -> Font
[src]
fn set_text_font(&mut self, c: Font)
[src]
fn text_size(&self) -> i32
[src]
fn set_text_size(&mut self, c: i32)
[src]
fn text_color(&self) -> Color
[src]
fn set_text_color(&mut self, c: Color)
[src]
fn add_choice(&mut self, text: &str)
[src]
fn choice(&self) -> Option<String>
[src]
fn value(&self) -> i32
[src]
fn set_value(&mut self, v: i32) -> bool
[src]
fn clear(&mut self)
[src]
unsafe fn unsafe_clear(&mut self)
[src]
fn clear_submenu(&mut self, idx: i32) -> Result<(), FltkError>
[src]
unsafe fn unsafe_clear_submenu(&mut self, idx: i32) -> Result<(), FltkError>
[src]
fn size(&self) -> i32
[src]
fn text(&self, idx: i32) -> Option<String>
[src]
fn at(&self, idx: i32) -> Option<MenuItem>
[src]
fn mode(&self, idx: i32) -> MenuFlag
[src]
fn set_mode(&mut self, idx: i32, flag: MenuFlag)
[src]
fn end(&mut self)
[src]
fn set_down_frame(&mut self, f: FrameType)
[src]
fn down_frame(&self) -> FrameType
[src]
fn global(&mut self)
[src]
impl MenuExt for MenuBar
[src]
impl MenuExt for MenuBar
[src]fn add<F: FnMut(&mut Self) + 'static>(
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
[src]
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
fn insert<F: FnMut(&mut Self) + 'static>(
&mut self,
idx: i32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
[src]
&mut self,
idx: i32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
fn add_emit<T: 'static + Clone + Send + Sync>(
&mut self,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
[src]
&mut self,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
fn insert_emit<T: 'static + Clone + Send + Sync>(
&mut self,
idx: i32,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
[src]
&mut self,
idx: i32,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
fn remove(&mut self, idx: i32)
[src]
fn find_item(&self, name: &str) -> Option<MenuItem>
[src]
fn set_item(&mut self, item: &MenuItem) -> bool
[src]
fn find_index(&self, label: &str) -> i32
[src]
fn text_font(&self) -> Font
[src]
fn set_text_font(&mut self, c: Font)
[src]
fn text_size(&self) -> i32
[src]
fn set_text_size(&mut self, c: i32)
[src]
fn text_color(&self) -> Color
[src]
fn set_text_color(&mut self, c: Color)
[src]
fn add_choice(&mut self, text: &str)
[src]
fn choice(&self) -> Option<String>
[src]
fn value(&self) -> i32
[src]
fn set_value(&mut self, v: i32) -> bool
[src]
fn clear(&mut self)
[src]
unsafe fn unsafe_clear(&mut self)
[src]
fn clear_submenu(&mut self, idx: i32) -> Result<(), FltkError>
[src]
unsafe fn unsafe_clear_submenu(&mut self, idx: i32) -> Result<(), FltkError>
[src]
fn size(&self) -> i32
[src]
fn text(&self, idx: i32) -> Option<String>
[src]
fn at(&self, idx: i32) -> Option<MenuItem>
[src]
fn mode(&self, idx: i32) -> MenuFlag
[src]
fn set_mode(&mut self, idx: i32, flag: MenuFlag)
[src]
fn end(&mut self)
[src]
fn set_down_frame(&mut self, f: FrameType)
[src]
fn down_frame(&self) -> FrameType
[src]
fn global(&mut self)
[src]
impl MenuExt for MenuButton
[src]
impl MenuExt for MenuButton
[src]fn add<F: FnMut(&mut Self) + 'static>(
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
[src]
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
fn insert<F: FnMut(&mut Self) + 'static>(
&mut self,
idx: i32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
[src]
&mut self,
idx: i32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
fn add_emit<T: 'static + Clone + Send + Sync>(
&mut self,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
[src]
&mut self,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
fn insert_emit<T: 'static + Clone + Send + Sync>(
&mut self,
idx: i32,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
[src]
&mut self,
idx: i32,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
fn remove(&mut self, idx: i32)
[src]
fn find_item(&self, name: &str) -> Option<MenuItem>
[src]
fn set_item(&mut self, item: &MenuItem) -> bool
[src]
fn find_index(&self, label: &str) -> i32
[src]
fn text_font(&self) -> Font
[src]
fn set_text_font(&mut self, c: Font)
[src]
fn text_size(&self) -> i32
[src]
fn set_text_size(&mut self, c: i32)
[src]
fn text_color(&self) -> Color
[src]
fn set_text_color(&mut self, c: Color)
[src]
fn add_choice(&mut self, text: &str)
[src]
fn choice(&self) -> Option<String>
[src]
fn value(&self) -> i32
[src]
fn set_value(&mut self, v: i32) -> bool
[src]
fn clear(&mut self)
[src]
unsafe fn unsafe_clear(&mut self)
[src]
fn clear_submenu(&mut self, idx: i32) -> Result<(), FltkError>
[src]
unsafe fn unsafe_clear_submenu(&mut self, idx: i32) -> Result<(), FltkError>
[src]
fn size(&self) -> i32
[src]
fn text(&self, idx: i32) -> Option<String>
[src]
fn at(&self, idx: i32) -> Option<MenuItem>
[src]
fn mode(&self, idx: i32) -> MenuFlag
[src]
fn set_mode(&mut self, idx: i32, flag: MenuFlag)
[src]
fn end(&mut self)
[src]
fn set_down_frame(&mut self, f: FrameType)
[src]
fn down_frame(&self) -> FrameType
[src]
fn global(&mut self)
[src]
impl MenuExt for SysMenuBar
[src]
impl MenuExt for SysMenuBar
[src]fn add<F: FnMut(&mut Self) + 'static>(
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
[src]
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
fn insert<F: FnMut(&mut Self) + 'static>(
&mut self,
idx: i32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
[src]
&mut self,
idx: i32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: F
)
fn add_emit<T: 'static + Clone + Send + Sync>(
&mut self,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
[src]
&mut self,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
fn insert_emit<T: 'static + Clone + Send + Sync>(
&mut self,
idx: i32,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
[src]
&mut self,
idx: i32,
label: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)