[][src]Trait fltk::prelude::MenuTrait

pub trait MenuTrait: WidgetTrait {
    fn get_item(&self, name: &str) -> Option<MenuItem>;
fn text_font(&self) -> Font;
fn set_text_font(&mut self, c: Font);
fn text_size(&self) -> u32;
fn set_text_size(&mut self, c: u32);
fn text_color(&self) -> Color;
fn set_text_color(&mut self, c: Color);
fn add<'a>(
        &'a mut self,
        name: &str,
        shortcut: Shortcut,
        flag: MenuFlag,
        cb: Box<dyn FnMut() + 'a>
    );
fn insert<'a>(
        &'a mut self,
        idx: u32,
        name: &str,
        shortcut: Shortcut,
        flag: MenuFlag,
        cb: Box<dyn FnMut() + 'a>
    );
fn add_choice(&mut self, text: &str);
fn get_choice(&self) -> Option<String>; }

Defines the methods implemented by all menu widgets

Required methods

fn get_item(&self, name: &str) -> Option<MenuItem>

Get a menu item by name

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<'a>(
    &'a mut self,
    name: &str,
    shortcut: Shortcut,
    flag: MenuFlag,
    cb: Box<dyn FnMut() + 'a>
)

Add a menu item along with its callback

fn insert<'a>(
    &'a mut self,
    idx: u32,
    name: &str,
    shortcut: Shortcut,
    flag: MenuFlag,
    cb: Box<dyn FnMut() + 'a>
)

Inserts a menu item at an index along with its callback

fn add_choice(&mut self, text: &str)

Adds a simple text option to the Choice and MenuButton widgets

fn get_choice(&self) -> Option<String>

Gets the user choice from the Choice and MenuButton widgets

Loading content...

Implementors

impl MenuTrait for Choice[src]

impl MenuTrait for MenuBar[src]

impl MenuTrait for MenuButton[src]

Loading content...