MenubarState is caller-owned top-level popup state. Its zero value is closed;
a nonzero value is the stable ID of the active trigger.
Methods
ActiveID#
func (state MenubarState) ActiveID() ui.ID
ActiveID returns the open trigger ID, or zero when the menubar is closed.
Close#
func (MenubarState) Close() MenubarState
Close returns the state with no active popup.
Dismiss#
func (MenubarState) Dismiss() MenubarState
Dismiss closes the active popup after selection or a dismiss action.
Escape#
func (MenubarState) Escape() MenubarState
Escape closes the active popup after the runtime routes an Escape key press.
IsOpen#
func (state MenubarState) IsOpen() bool
IsOpen reports whether any top-level menu is open.
IsOpenFor#
func (state MenubarState) IsOpenFor(triggerID ui.ID) bool
IsOpenFor reports whether triggerID owns the open popup.
Open#
func (state MenubarState) Open(triggerID ui.ID) MenubarState
Open returns the state with triggerID active. Zero IDs are ignored.
OutsidePress#
func (MenubarState) OutsidePress() MenubarState
OutsidePress closes the active popup after the runtime identifies an outside press.
Toggle#
func (state MenubarState) Toggle(triggerID ui.ID) MenubarState
Toggle closes the active trigger or opens a different nonzero trigger.