Skip to main content

ContextMenuManager

Trait ContextMenuManager 

Source
pub trait ContextMenuManager {
    // Required method
    fn ui(&self, ui: &mut Ui);
}
Expand description

Provides the contents of the widget’s right-click context menu.

Install an implementation with Map::set_context_manager.

§Examples

use egui_map::map::objects::ContextMenuManager;

struct MyMenu;

impl ContextMenuManager for MyMenu {
    fn ui(&self, ui: &mut egui::Ui) {
        ui.label("Hello from the map!");
    }
}

Required Methods§

Source

fn ui(&self, ui: &mut Ui)

Builds the menu contents; called every frame while the menu is open.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§