pub struct DefaultPlatformMenuDelegate { /* private fields */ }Expand description
The platform menu delegate that hands the menus to the host’s menu bar
(Platform::menu_bar), and dispatches a choice the host reports
(EmbedderClient::menu_selected) to the item chosen.
An instance of this is set on WidgetsBinding::platform_menu_delegate by default when the
WidgetsBinding is initialized.
Implementations§
Source§impl DefaultPlatformMenuDelegate
impl DefaultPlatformMenuDelegate
Sourcepub fn new(app: &mut App) -> Rc<DefaultPlatformMenuDelegate>
pub fn new(app: &mut App) -> Rc<DefaultPlatformMenuDelegate>
Creates a DefaultPlatformMenuDelegate, which hears the choices the host reports from
now on.
Trait Implementations§
Source§impl PlatformMenuDelegate for DefaultPlatformMenuDelegate
impl PlatformMenuDelegate for DefaultPlatformMenuDelegate
Clears any existing platform-rendered menus and leaves the application with no menus. Read more
Sets the entire menu hierarchy for a platform-rendered menu bar. Read more
Source§fn debug_lock_delegate(&self, context: BuildContext) -> bool
fn debug_lock_delegate(&self, context: BuildContext) -> bool
This is called by
PlatformMenuBar when it is initialized, to be sure that only one is
active at a time. Read moreSource§fn debug_unlock_delegate(&self, context: BuildContext) -> bool
fn debug_unlock_delegate(&self, context: BuildContext) -> bool
This is called by
PlatformMenuBar when it is disposed, so that another one can take
over. Read moreAuto Trait Implementations§
impl !Freeze for DefaultPlatformMenuDelegate
impl !RefUnwindSafe for DefaultPlatformMenuDelegate
impl !Send for DefaultPlatformMenuDelegate
impl !Sync for DefaultPlatformMenuDelegate
impl !UnwindSafe for DefaultPlatformMenuDelegate
impl Forget for DefaultPlatformMenuDelegate
impl Move for DefaultPlatformMenuDelegate
impl Unpin for DefaultPlatformMenuDelegate
impl UnsafeUnpin for DefaultPlatformMenuDelegatewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<(u32, Rc<dyn PlatformMenuItem>)>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
&'static ElementVTable: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more