Skip to main content

ferroui_base/input/
i_main_menu.rs

1use crate::interactivity::RoutedEventArgs;
2use crate::reactive::IDisposable;
3use std::rc::Rc;
4
5/// Defines the interface for a top-level menu.
6pub trait IMainMenu {
7    /// Whether the menu is open.
8    fn is_open(&self) -> bool;
9
10    /// Closes the menu.
11    fn close(&self);
12
13    /// Opens the menu in response to the Alt/F10 key.
14    fn open(&self);
15
16    /// Occurs when the main menu closes. Disposing the returned handle
17    /// unsubscribes.
18    fn closed(&self, handler: Rc<dyn Fn(&RoutedEventArgs)>) -> Rc<dyn IDisposable>;
19}