Menu

Struct

AppItem

kurogane::AppItemSource
pub struct AppItem { /* private fields */ }

An item of the application’s in a ContextMenu.

Methods

#pub fn new(id: impl Into<String>, label: impl Into<String>) -> Self

An item that reports id when chosen, shown as label (see MenuItem::new).

#pub fn enabled(self, enabled: bool) -> Self

Shown greyed out and not chosen, when enabled is false.

#pub fn checked(self, checked: bool) -> Self

A check item, shown checked when checked is true. Choosing it does not change the mark; the application shows it as it decides.

#pub fn id(&self) -> &str

The id it reports when chosen.

#pub fn label(&self) -> &str

#pub fn is_enabled(&self) -> bool

#pub fn is_checked(&self) -> Option<bool>

Whether it is checked, for a check item.

Trait implementations