pub struct Menu { /* private fields */ }Implementations§
Source§impl Menu
impl Menu
pub fn new(id_salt: impl Hash) -> Self
pub fn width(self, w: f32) -> Self
pub fn item(self, label: impl Into<String>) -> Self
pub fn icon_item(self, icon: IconKind, label: impl Into<String>) -> Self
pub fn danger_item(self, label: impl Into<String>) -> Self
pub fn disabled_item(self, label: impl Into<String>) -> Self
Sourcepub fn shortcut(self, s: impl Into<String>) -> Self
pub fn shortcut(self, s: impl Into<String>) -> Self
Add a keyboard-shortcut hint shown right-aligned on the last item.
pub fn separator(self) -> Self
pub fn section_label(self, label: impl Into<String>) -> Self
Sourcepub fn show(self, ui: &mut Ui, trigger: &Response) -> Option<usize>
pub fn show(self, ui: &mut Ui, trigger: &Response) -> Option<usize>
Show as a dropdown anchored to trigger, toggled by its clicks.
Returns the clicked entry index, if any.
Show as a context menu (right-click trigger). Returns the clicked
entry index, if any.
Auto Trait Implementations§
impl Freeze for Menu
impl RefUnwindSafe for Menu
impl Send for Menu
impl Sync for Menu
impl Unpin for Menu
impl UnsafeUnpin for Menu
impl UnwindSafe for Menu
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