tuibind

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL