pub trait MenuControllerLeaf: Sized + 'static {
// Required methods
fn menu_controller_data(
self: Handle<Self>,
app: &App,
) -> &MenuControllerData;
fn menu_controller_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut MenuControllerData;
// Provided methods
fn is_open(self: Handle<Self>, app: &App) -> bool { ... }
fn open(self: Handle<Self>, app: &mut App, position: Option<Offset>) { ... }
fn close(self: Handle<Self>, app: &mut App) { ... }
fn close_children(self: Handle<Self>, app: &mut App) { ... }
fn as_menu_controller(self: Handle<Self>) -> AnyMenuController { ... }
}Expand description
The trait every menu-controller leaf implements: MenuController, and a type an app
writes where Dart extends MenuController.
The members a subclass overrides are the ones with a default body here; the shared bodies
are associated functions on MenuController, which an override calls where Dart writes
super.….
Required Methods§
Dart’s MenuController fields, held under the field menu_controller
(menu_controller_accessors!).
See menu_controller_data.
Provided Methods§
Sourcefn is_open(self: Handle<Self>, app: &App) -> bool
fn is_open(self: Handle<Self>, app: &App) -> bool
Whether or not the menu associated with this MenuController is open.
Sourcefn open(self: Handle<Self>, app: &mut App, position: Option<Offset>)
fn open(self: Handle<Self>, app: &mut App, position: Option<Offset>)
Opens the menu that this MenuController is associated with.
If position is given, then the menu will open at the position given, in the
coordinate space of the RawMenuAnchor that this controller is attached to.
If the menu’s anchor point is scrolled by an ancestor, or the view changes size, then any open menu will automatically close.
Sourcefn close(self: Handle<Self>, app: &mut App)
fn close(self: Handle<Self>, app: &mut App)
Close the menu that this MenuController is associated with.
Associating with a menu is done by passing a MenuController to a RawMenuAnchor
or a RawMenuAnchorGroup.
If the menu’s anchor point is scrolled by an ancestor, or the view changes size, then any open menu will automatically close.
Sourcefn close_children(self: Handle<Self>, app: &mut App)
fn close_children(self: Handle<Self>, app: &mut App)
Close the children of the menu associated with this MenuController, without closing
the menu itself.
This controller as the erased AnyMenuController: what to pass where a Dart API takes
a MenuController.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".