module BBS::Windows::ButtonBar

Lays out a row of buttons at the bottom of a window.

A button descriptor is a Hash:

key

a name for looking the button up in the by_key result

label

the button text; +&+ marks the hotkey letter

on_click

called with the window

primary

marks the button that should get the initial focus

cancel

informational only

align

:left, :right or :center

keep_open

never close the window after the handler

on_click receives the BBS::Window as its only argument and may return :keep to keep the window open. Any other return value (or nil) causes the window to be closed after the handler.

primary: true gets initial focus on the button. cancel: true is informational only: ESC closes the window through the standard Window#close_key path. If you also want a cancel-specific side effect on ESC, set window.on_close = ... manually. align: :left | :right | :center: default is :center for a single button, :right otherwise. Left-aligned buttons stack from the left edge; right-aligned buttons stack flush against the right edge in declaration order (so the last right-aligned button sits closest to the edge).