Teek::UI::MenuBuilder Class
The build surface inside a menu_bar/menu/context_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 - see
WidgetDSL#[]. #separator stays unaddressable (nothing to
enable/disable/relabel on a divider).
Inherits: Object
Instance Methods ↑
checkbox(name nil, label:, bind:, **opts)
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.
Parameters
nameSymbol, nil— see#itemlabelStringbindVaroptsHash— extra Tk menu-entry options
Returns Handle
item(name nil, label:, **opts, &block)
A command entry.
Parameters
nameSymbol, nil— for `ui[:name]` lookup - addressable later as a Handle (`.enable`/`.disable`/`.configure`)labelStringoptsHash— extra Tk menu-entry options (e.g.accelerator:)
Returns Handle
@yield called when the entry is invoked
radio(name nil, label:, bind:, value:, **opts)
A radiobutton entry - bind: is shared across every radio entry in
the group, value: is what this one entry sets it to when chosen.
Parameters
nameSymbol, nil— see#itemlabelStringbindVarvalueObjectoptsHash— extra Tk menu-entry options
Returns Handle