class

Tryst::UI::MenuBuilder

Inherits Reference < Object

The build surface inside a menu_bar/context_menu/menu block - a separate, small vocabulary from WidgetDSL (deliberately NOT mixed into Session/yielded as self the way ordinary containers are), since menu entries reuse names ordinary widgets already own (checkbox/radio are ttk widgets one level up, menu entry kinds one level down here) - a shared receiver would collide.

Menu structure realizes through Realizer#create_menu_tree rather than the generic per-node widget-creation path: nothing here is a Tk widget of its own except #menu (a nested cascade, itself a menu command) - #item/#checkbox/#radio are entries added to their parent's menu path, with no live Tk path of their own, addressed via their WidgetType#addressing strategy (MenuEntryAddressing) the same way Handle resolves any other type's. #separator stays unaddressable (nothing to enable/disable/relabel on a divider).

Constructors

new(document : Document, stack : Array(Node))
Source

Instance methods

checkbox(name : Symbol | Nil = nil, *, label : String, bind : Var, **opts) : Handle

A checkbutton entry, bound to a reactive Var - ticked when the var is true, unticked when false, the same bind: convention WidgetDSL's own checkbox widget uses.

Source
item(name : Symbol | Nil = nil, *, label : String, **opts, &block : Array(String), CallbackSignal -> Nil) : Handle

A command entry. name is for ui[:name] lookup (addressable later as a Handle - .enable/.disable/.configure); the block fires when the entry is invoked.

Source
item(name : Symbol | Nil = nil, *, label : String, **opts) : Handle
Source
radio(name : Symbol | Nil = nil, *, label : String, bind : Var, value : VarValue, **opts) : Handle

A radiobutton entry - bind: is shared across every radio entry in the group, value: is what this one entry sets it to when chosen.

Source
separator

A separator entry.

Source