Found by DeslanStudio milestone 4b porting the studio's QMenuBar (File/Edit/View/Help with shortcut-labelled items).
The toolkit has the pull-down half (menu with [label, shortcut] items, separators, show_menu, click-away close via _close_menus) but no menu BAR: the consumer builds a toolbar of title buttons whose on_click calls show_menu of [m, btn._ax, bar_bottom], and must (a) position menus from cached _ax (valid only after a _layout pass), (b) add every menu widget LAST to the root's children so it renders above the content it overlaps, and (c) keep title-button and menu lists paired by hand.
Suggestion: a menu_bar(id, x, y, w, menus) widget — menus a list of {"title", "items", "on_select"} — that owns the title strip, popup positioning, z-order (render its open menu after children, like dropdown does), and open/close state.
Downstream reference implementation to steal from: DeslanStudio src/client/shell.eigs (_shell_build_menubar).
Found by DeslanStudio milestone 4b porting the studio's QMenuBar (File/Edit/View/Help with shortcut-labelled items).
The toolkit has the pull-down half (
menuwith[label, shortcut]items, separators,show_menu, click-away close via_close_menus) but no menu BAR: the consumer builds a toolbar of title buttons whose on_click callsshow_menu of [m, btn._ax, bar_bottom], and must (a) position menus from cached_ax(valid only after a_layoutpass), (b) add everymenuwidget LAST to the root's children so it renders above the content it overlaps, and (c) keep title-button and menu lists paired by hand.Suggestion: a
menu_bar(id, x, y, w, menus)widget —menusa list of{"title", "items", "on_select"}— that owns the title strip, popup positioning, z-order (render its open menu after children, like dropdown does), and open/close state.Downstream reference implementation to steal from: DeslanStudio
src/client/shell.eigs(_shell_build_menubar).