Documentation
¶
Overview ¶
Package tuibind holds the MVVM binding adapters specific to the terminal-cell toolkit (github.com/go-widgets/tui) — widgets whose callback shape the generic mvvm adapters can't express, such as a Dropdown whose OnChange carries both the index and the value string. It is the ONLY MVVM package that imports tui; the core mvvm package stays backend-free.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindDropdown ¶
func BindDropdown(sel *mvvm.Observable[int], dd *tui.Dropdown, invalidate func()) (unbind func())
BindDropdown two-way-binds a Dropdown's Selected index to an observable. The Dropdown reports OnChange(idx, value) — a multi-argument shape the generic BindField can't take — so this adapter keeps the observable in sync with the index and pushes the index back. Loop-free (silent field write + equal-skip). Returns an unbind restoring the prior OnChange and detaching.
func BindTableSelection ¶
func BindTableSelection(sel *mvvm.Observable[int], tb *tui.Table, invalidate func()) (unbind func())
BindTableSelection two-way-binds a Table's Selected row to an observable. The Table's hook is OnSelect(row) (a distinct name from the generic OnChange), so it needs its own adapter. Returns an unbind restoring the prior OnSelect and detaching.
Types ¶
This section is empty.