pub struct Menubar { /* private fields */ }Expand description
A row of menus, at most one of them open.
Implementations§
Source§impl Menubar
impl Menubar
pub fn new( ident: impl Into<Ident>, menus: impl IntoIterator<Item = MenubarMenu>, window: &mut Window, cx: &mut Context<'_, Self>, ) -> Self
pub fn control_size(self, size: ControlSize) -> Self
The menu standing open, if any.
Replaces the titles, closing anything that was open.
Sourcepub fn open(
&mut self,
id: &str,
window: &mut Window,
cx: &mut Context<'_, Self>,
)
pub fn open( &mut self, id: &str, window: &mut Window, cx: &mut Context<'_, Self>, )
Opens one title, closing whatever stood open. A title the host refused has no menu and opens nothing.
The old menu is closed before the new one opens rather than in reaction to it, because closing hands the keyboard back to its own trigger, and doing that after the new menu had taken focus would pull the keyboard back out of the menu the typist just opened.
pub fn close(&mut self, window: &mut Window, cx: &mut Context<'_, Self>)
Trait Implementations§
impl EventEmitter<MenubarEvent> for Menubar
Auto Trait Implementations§
impl !RefUnwindSafe for Menubar
impl !UnwindSafe for Menubar
impl Freeze for Menubar
impl Send for Menubar
impl Sync for Menubar
impl Unpin for Menubar
impl UnsafeUnpin for Menubar
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more