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

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

Defines the methods implemented by all menu widgets

Required methods

fn get_item(&self, name: &str) -> 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) -> usize

Return the text size

fn set_text_size(&mut self, c: usize)

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: i32,
    flag: MenuFlag,
    cb: Box<dyn FnMut() + 'a>
)

Add a menu item 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) -> 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...