pub struct NativeMenuHandle { /* private fields */ }Expand description
Per-app native-menu service. Registered in app-state by
TeksiloAppBuilder::install_native_menu (or .app_state(NativeMenuHandle::new(..))
for a custom backend). Cloneable; clones share one backend + activation map.
Implementations§
Source§impl NativeMenuHandle
impl NativeMenuHandle
Sourcepub fn new<B: NativeMenuBackend + 'static>(backend: B) -> Self
pub fn new<B: NativeMenuBackend + 'static>(backend: B) -> Self
Build a handle wrapping the given backend.
Install window_id’s menu, recording the per-item activations so a later
click can be routed. Replaces any prior menu for that window.
Sourcepub fn activate_window(&self, window_id: TeksiloWindowId)
pub fn activate_window(&self, window_id: TeksiloWindowId)
Make window_id’s menu the visible one (focus-follows-window).
Sourcepub fn clear_window(&self, window_id: TeksiloWindowId)
pub fn clear_window(&self, window_id: TeksiloWindowId)
Forget a window’s menu + activations (window closed).
Sourcepub fn update_item(&self, id: MenuItemId, delta: MenuItemDelta)
pub fn update_item(&self, id: MenuItemId, delta: MenuItemDelta)
Apply a reactive delta to one installed item.
Sourcepub fn activation(
&self,
window_id: TeksiloWindowId,
id: MenuItemId,
) -> Option<NativeMenuActivation>
pub fn activation( &self, window_id: TeksiloWindowId, id: MenuItemId, ) -> Option<NativeMenuActivation>
Look up (and clone) the activation for a chosen item, for the router.
Trait Implementations§
Source§impl Clone for NativeMenuHandle
impl Clone for NativeMenuHandle
Source§fn clone(&self) -> NativeMenuHandle
fn clone(&self) -> NativeMenuHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for NativeMenuHandle
impl !Send for NativeMenuHandle
impl !Sync for NativeMenuHandle
impl !UnwindSafe for NativeMenuHandle
impl Freeze for NativeMenuHandle
impl Unpin for NativeMenuHandle
impl UnsafeUnpin for NativeMenuHandle
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.