class

Tryst::UI::MenuEntryAddressing

Inherits Tryst::UI::AddressingStrategy < Reference < Object

@api private

The WidgetType#addressing strategy for :menu_item/:menu_checkbox/ :menu_radio - a menu entry has no independent Tk path of its own, only the enclosing menu does. #configure resolves the entry's CURRENT position fresh on every call via Node#parent rather than caching an index, so an earlier sibling being inserted or removed can never leave this addressing the wrong entry (Tk menu entries are addressed purely by numeric index, and TkMenu.c renumbers every entry after the one that changed).

Constants

SHARED = Proc(Node, AddressingStrategy).new do |node| MenuEntryAddressing.new(node) end

The addressing: hook to register a menu-entry type with. Being an entry rather than a widget is a trait the three of them share, not something each decides for itself. Spelled as a bare Proc rather than WidgetType::AddressingHook so a strategy needn't require the descriptor that selects it.

Constructors

new(node : Node)
Source

Instance methods

configure

Raises NotRealizedError before the parent menu is realized.

Source
option_dump

Every current option/value Tk reports for this entry right now. Raises NotRealizedError before the parent menu is realized.

Source
virtual_path

The parent menu's real path, marked past the point a real Tk path stops applying - ! is illegal in a Tk path segment, so handing this to a raw Tk command fails loudly (an "invalid command name" Tcl error) instead of silently misbehaving.

Source