[][src]Struct vgtk::MenuBuilder

pub struct MenuBuilder { /* fields omitted */ }

Makes a gtk::Menu for you.

Examples

use vgtk::menu;
let menu_bar = menu()
    .section_label("File",
        menu()
            .item("Open...", "win.open")
            .item("Save", "win.save")
            .item("Quit", "app.quit")
    )
    .section_label("Help",
        menu()
            .item("About...", "app.about")
    ).build();

Methods

impl MenuBuilder[src]

pub fn item(self, label: &str, action: &str) -> Self[src]

Add a MenuItem to this menu.

pub fn section(self, section: MenuBuilder) -> Self[src]

Add a section to this menu.

pub fn section_label(self, label: &str, section: MenuBuilder) -> Self[src]

Add a section with a label to this menu.

pub fn sub(self, label: &str, submenu: MenuBuilder) -> Self[src]

Add a submenu to this menu.

pub fn build(self) -> Menu[src]

Finalise the MenuBuilder and get your Menu.

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, 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.