Skip to main content

MenuFlyout

Struct MenuFlyout 

Source
pub struct MenuFlyout { /* private fields */ }
Expand description

Persistent owner of a collection displayed by a MenuFlyoutPresenter.

Keep the MenuFlyout for as long as its flyout (see as_flyout) is in use: the flyout’s closures name the menu without keeping it.

Implementations§

Source§

impl MenuFlyout

Source

pub fn new(app: &mut App, items: Vec<MenuFlyoutItem>) -> Ref<Self>

Creates a root menu; checked values follow the kit’s owner-state convention.

Source

pub fn as_flyout(self: Handle<Self>, app: &App) -> &Ref<Flyout>

Returns the shared flyout object for DropDownButton, placement and lifecycle callbacks.

Call .handle() to use it, or .clone() to keep it.

Source

pub fn items(self: Handle<Self>, app: &mut App, items: Vec<MenuFlyoutItem>)

Replaces the item configuration while preserving keyed item state.

Source

pub fn show_at(self: Handle<Self>, app: &mut App, target: BuildContext)

Shows from a context beneath FlyoutTarget.

Source

pub fn show_at_with_options( self: Handle<Self>, app: &mut App, target: BuildContext, options: FlyoutShowOptions, )

Shows with per-opening placement and input policy.

Source

pub fn hide(self: Handle<Self>, app: &mut App)

Hides this menu and its open descendants.

Source

pub fn is_open(self: Handle<Self>, app: &App) -> bool

Whether this menu is currently shown.

Source

pub fn dispose(self: Handle<Self>, app: &mut App)

Releases the retained presenter and its child menus.

Trait Implementations§

Source§

impl Debug for MenuFlyout

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for MenuFlyout

§

impl !Send for MenuFlyout

§

impl !Sync for MenuFlyout

§

impl !UnwindSafe for MenuFlyout

§

impl Forget for MenuFlyout

§

impl Freeze for MenuFlyout
where NonZero<u32>: Freeze, PhantomData<fn() -> Flyout>: Freeze, *const RcInner<Keep> is !null: Freeze, PhantomData<RcInner<Keep>>: Freeze, *const u8 is !null: Freeze, PhantomData<MenuFlyoutItem>: Freeze, PhantomData<fn() -> MenuFlyoutPresenterState>: Freeze, PhantomData<fn() -> MenuFlyout>: Freeze, PhantomData<fn() -> MenuItemState>: Freeze, *const RcInner<dyn Fn(&mut App, Handle<MenuFlyout>, &KeyEvent) -> KeyEventResult> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, Handle<MenuFlyout>, &KeyEvent) -> KeyEventResult>>: Freeze,

§

impl Move for MenuFlyout

§

impl Unpin for MenuFlyout
where NonZero<u32>: Unpin, Rc<Keep>: Unpin, *const u8 is !null: Unpin, Rc<dyn Widget>: Unpin, Rc<dyn Fn(&mut App)>: Unpin, *const (): Unpin, Rc<dyn Fn(&mut App, bool)>: Unpin, Rc<dyn Key>: Unpin, Rc<dyn Fn(&mut App, Handle<MenuFlyout>, &KeyEvent) -> KeyEventResult>: Unpin,

§

impl UnsafeUnpin for MenuFlyout
where NonZeroU32Inner: UnsafeUnpin, PhantomData<fn() -> Flyout>: UnsafeUnpin, *const RcInner<Keep> is !null: UnsafeUnpin, PhantomData<RcInner<Keep>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<MenuFlyoutItem>: UnsafeUnpin, PhantomData<fn() -> MenuFlyoutPresenterState>: UnsafeUnpin, PhantomData<fn() -> MenuFlyout>: UnsafeUnpin, PhantomData<fn() -> MenuItemState>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, Handle<MenuFlyout>, &KeyEvent) -> KeyEventResult> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, Handle<MenuFlyout>, &KeyEvent) -> KeyEventResult>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>