Module menu

Source
Expand description

Menu bar functionality (very basic so far).

Usage:

fn show_menu(ui: &mut egui::Ui) {
    use egui::{menu, Button};

    menu::bar(ui, |ui| {
        ui.menu_button("File", |ui| {
            if ui.button("Open").clicked() {
                // …
            }
        });
    });
}

Structs§

BarState
What is saved between frames.
MenuRoot
Menu root associated with an Id from a Response
MenuRootManager
Stores the state for the context menu.
MenuState
Components of menu state, public for advanced usage.
SubMenu
SubMenuButton

Enums§

MenuResponse

Functions§

bar
The menu bar goes well in a crate::TopBottomPanel::top, but can also be placed in a crate::Window. In the latter case you may want to wrap it in Frame.
menu_button
Construct a top level menu in a menu bar. This would be e.g. “File”, “Edit” etc.
menu_custom_button
Construct a top level menu with a custom button in a menu bar.
menu_image_buttonDeprecated
Construct a top level menu with an image in a menu bar. This would be e.g. “File”, “Edit” etc.