pub struct MenuBar { /* private fields */ }Expand description
A row of menu titles: a press on one opens its Menu below it, and while one is open
the pointer coming over another title switches to it. Left and Right switch menus from
the keyboard. The bar is not in the Tab order: give it the keyboard with
MenuBar::activate (on F10, say).
Implementations§
Source§impl MenuBar
impl MenuBar
The bar with a menu titled title of items after the others.
Sourcepub fn activate(&mut self, cx: &mut EventCx<'_>)
pub fn activate(&mut self, cx: &mut EventCx<'_>)
Gives the bar the keyboard, its first title highlighted: Left and Right move, Down, Enter or Space open, Escape lets go.
Sourcepub fn set_items(
&mut self,
index: usize,
items: impl IntoIterator<Item = MenuItem>,
) -> bool
pub fn set_items( &mut self, index: usize, items: impl IntoIterator<Item = MenuItem>, ) -> bool
Replaces the entries of menu number index (a check mark that follows a setting);
shown from the next time the menu opens. false if there is no such menu.
The title of the menu open, by index.
Trait Implementations§
Source§impl Widget for MenuBar
impl Widget for MenuBar
Source§fn measure(&mut self, cx: &mut LayoutCx<'_>, _: Constraints) -> Size
fn measure(&mut self, cx: &mut LayoutCx<'_>, _: Constraints) -> Size
The size the widget wants within
constraints, for a widget without children (one
with children is sized by its style and its children). Physical pixels.Source§fn paint(&mut self, cx: &PaintCx<'_>, canvas: &mut Canvas<'_>)
fn paint(&mut self, cx: &PaintCx<'_>, canvas: &mut Canvas<'_>)
Paints the widget below its children.
Source§fn event(&mut self, cx: &mut EventCx<'_>, event: &Event<'_>) -> Handled
fn event(&mut self, cx: &mut EventCx<'_>, event: &Event<'_>) -> Handled
Handles
event. An event the widget does not handle goes on to its parent.Source§fn accessibility(&self, cx: &PaintCx<'_>, node: &mut AccessNode)
fn accessibility(&self, cx: &PaintCx<'_>, node: &mut AccessNode)
Describes the widget to assistive technology: fills
node, which starts as a
Role::Group with the widget’s rectangle. Called only while
assistive technology is listening; it may allocate.Source§fn access_action(
&mut self,
cx: &mut EventCx<'_>,
request: &AccessRequest<'_>,
) -> Handled
fn access_action( &mut self, cx: &mut EventCx<'_>, request: &AccessRequest<'_>, ) -> Handled
Does what assistive technology asks (only actions the widget’s node lists are asked
of it). Focus and scrolling into view are done for every widget; a request the widget
does not handle goes on to its parent if it is a scroll.
Source§fn layout(&mut self, cx: &mut LayoutCx<'_>, size: Size)
fn layout(&mut self, cx: &mut LayoutCx<'_>, size: Size)
Layout decided the widget’s size: re-wrap text or recompute anything that depends on
it. Called after every layout pass that changed the size.
Source§fn paint_over(&mut self, cx: &PaintCx<'_>, canvas: &mut Canvas<'_>)
fn paint_over(&mut self, cx: &PaintCx<'_>, canvas: &mut Canvas<'_>)
Paints the widget over its children: scroll bars, focus rings, overlays.
Source§fn accepts_focus(&self) -> bool
fn accepts_focus(&self) -> bool
Whether the widget takes keyboard focus, by click or by Tab.
Source§fn focus_on_press(&self) -> bool
fn focus_on_press(&self) -> bool
Whether a press on the widget, or on a widget inside it that takes no focus, focuses
it (if it accepts focus). A container reachable by Tab, such
as a dock’s tab list, says no, so clicks on its contents do not focus it; it can still
ask for focus itself.
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