Struct ui2::MenuHandle
source · pub struct MenuHandle<M: ManagedView> { /* private fields */ }
Implementations§
source§impl<M: ManagedView> MenuHandle<M>
impl<M: ManagedView> MenuHandle<M>
pub fn child<R: RenderOnce>(self, f: impl FnOnce(bool) -> R + 'static) -> Self
sourcepub fn anchor(self, anchor: AnchorCorner) -> Self
pub fn anchor(self, anchor: AnchorCorner) -> Self
anchor defines which corner of the menu to anchor to the attachment point (by default the cursor position, but see attach)
sourcepub fn attach(self, attach: AnchorCorner) -> Self
pub fn attach(self, attach: AnchorCorner) -> Self
attach defines which corner of the handle to attach the menu’s anchor to
Trait Implementations§
source§impl<M: ManagedView> Element for MenuHandle<M>
impl<M: ManagedView> Element for MenuHandle<M>
source§impl<M: ManagedView> RenderOnce for MenuHandle<M>
impl<M: ManagedView> RenderOnce for MenuHandle<M>
type Element = MenuHandle<M>
fn element_id(&self) -> Option<ElementId>
fn render_once(self) -> Self::Element
fn render_into_any(self) -> AnyElement
fn draw<T, R>( self, origin: Point<Pixels>, available_space: Size<T>, cx: &mut WindowContext<'_>, f: impl FnOnce(&mut <Self::Element as Element>::State, &mut WindowContext<'_>) -> R ) -> Rwhere T: Clone + Default + Debug + Into<AvailableSpace>,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere Self: Sized, U: RenderOnce,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere Self: Sized,
fn when_some<T>( self, option: Option<T>, then: impl FnOnce(Self, T) -> Self ) -> Selfwhere Self: Sized,
Auto Trait Implementations§
impl<M> !RefUnwindSafe for MenuHandle<M>
impl<M> !Send for MenuHandle<M>
impl<M> !Sync for MenuHandle<M>
impl<M> Unpin for MenuHandle<M>
impl<M> !UnwindSafe for MenuHandle<M>
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