[−][src]Trait fltk::prelude::MenuExt
Defines the methods implemented by all menu widgets
Required methods
fn find_item(&self, name: &str) -> Option<MenuItem>
Get a menu item by name
fn set_item(&mut self, item: &MenuItem) -> bool
Set selected item
fn find_index(&self, label: &str) -> u32
Find an item's index by its label
fn text_font(&self) -> Font
Return the text font
fn set_text_font(&mut self, c: Font)
Sets the text font
fn text_size(&self) -> u32
Return the text size
fn set_text_size(&mut self, c: u32)
Sets the text size
fn text_color(&self) -> Color
Return the text color
fn set_text_color(&mut self, c: Color)
Sets the text color
fn add(
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
Add a menu item along with its callback
fn insert(
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
Inserts a menu item at an index along with its callback
fn add_emit<T: 'static + Copy + Send + Sync>(
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
Add a menu item along with an emit (sender and message)
fn insert_emit<T: 'static + Copy + Send + Sync>(
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
Inserts a menu item along with an emit (sender and message)
fn remove(&mut self, idx: u32)
Remove a menu item by index
fn add_choice(&mut self, text: &str)
Adds a simple text option to the Choice and MenuButton widgets
fn choice(&self) -> Option<String>
Gets the user choice from the Choice and MenuButton widgets
fn value(&self) -> i32
Get index into menu of the last item chosen
fn set_value(&mut self, v: i32) -> bool
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)
Clears the items in a menu, effectively deleting them.
fn clear_submenu(&mut self, idx: u32) -> Result<(), FltkError>
Clears a submenu by index, failure return FltkErrorKind::FailedOperation
unsafe fn unsafe_clear(&mut self)
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: u32) -> Result<(), FltkError>
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
fn size(&self) -> u32
Get the size of the menu widget
fn text(&self, idx: u32) -> Option<String>
Get the text label of the menu item at index idx
fn at(&self, idx: u32) -> Option<MenuItem>
Get the menu item at an index
fn mode(&self, idx: u32) -> MenuFlag
Set the mode of a menu item by index and flag
fn set_mode(&mut self, idx: u32, flag: MenuFlag)
Get the mode of a menu item
Implementors
impl MenuExt for Choice
[src]
fn add(
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
[src]
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
fn insert(
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
[src]
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
fn add_emit<T: 'static + Copy + Send + Sync>(
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
[src]
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
fn insert_emit<T: 'static + Copy + Send + Sync>(
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
[src]
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
fn remove(&mut self, idx: u32)
[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) -> u32
[src]
fn text_font(&self) -> Font
[src]
fn set_text_font(&mut self, c: Font)
[src]
fn text_size(&self) -> u32
[src]
fn set_text_size(&mut self, c: u32)
[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: u32) -> Result<(), FltkError>
[src]
unsafe fn unsafe_clear_submenu(&mut self, idx: u32) -> Result<(), FltkError>
[src]
fn size(&self) -> u32
[src]
fn text(&self, idx: u32) -> Option<String>
[src]
fn at(&self, idx: u32) -> Option<MenuItem>
[src]
fn mode(&self, idx: u32) -> MenuFlag
[src]
fn set_mode(&mut self, idx: u32, flag: MenuFlag)
[src]
impl MenuExt for MenuBar
[src]
fn add(
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
[src]
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
fn insert(
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
[src]
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
fn add_emit<T: 'static + Copy + Send + Sync>(
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
[src]
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
fn insert_emit<T: 'static + Copy + Send + Sync>(
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
[src]
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
fn remove(&mut self, idx: u32)
[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) -> u32
[src]
fn text_font(&self) -> Font
[src]
fn set_text_font(&mut self, c: Font)
[src]
fn text_size(&self) -> u32
[src]
fn set_text_size(&mut self, c: u32)
[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: u32) -> Result<(), FltkError>
[src]
unsafe fn unsafe_clear_submenu(&mut self, idx: u32) -> Result<(), FltkError>
[src]
fn size(&self) -> u32
[src]
fn text(&self, idx: u32) -> Option<String>
[src]
fn at(&self, idx: u32) -> Option<MenuItem>
[src]
fn mode(&self, idx: u32) -> MenuFlag
[src]
fn set_mode(&mut self, idx: u32, flag: MenuFlag)
[src]
impl MenuExt for MenuButton
[src]
fn add(
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
[src]
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
fn insert(
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
[src]
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
fn add_emit<T: 'static + Copy + Send + Sync>(
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
[src]
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
fn insert_emit<T: 'static + Copy + Send + Sync>(
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
[src]
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
fn remove(&mut self, idx: u32)
[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) -> u32
[src]
fn text_font(&self) -> Font
[src]
fn set_text_font(&mut self, c: Font)
[src]
fn text_size(&self) -> u32
[src]
fn set_text_size(&mut self, c: u32)
[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: u32) -> Result<(), FltkError>
[src]
unsafe fn unsafe_clear_submenu(&mut self, idx: u32) -> Result<(), FltkError>
[src]
fn size(&self) -> u32
[src]
fn text(&self, idx: u32) -> Option<String>
[src]
fn at(&self, idx: u32) -> Option<MenuItem>
[src]
fn mode(&self, idx: u32) -> MenuFlag
[src]
fn set_mode(&mut self, idx: u32, flag: MenuFlag)
[src]
impl MenuExt for SysMenuBar
[src]
fn add(
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
[src]
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
fn insert(
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
[src]
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
cb: Box<dyn FnMut()>
)
fn add_emit<T: 'static + Copy + Send + Sync>(
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
[src]
&mut self,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
fn insert_emit<T: 'static + Copy + Send + Sync>(
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)
[src]
&mut self,
idx: u32,
name: &str,
shortcut: Shortcut,
flag: MenuFlag,
sender: Sender<T>,
msg: T
)