Summary
Expose TextView's SetScrollable and SetChangedFunc in YAML config so views can be non-scrollable and trigger redraws or callbacks when content changes (e.g. for live-updating displays).
Background
Discovered while planning a tview presentation demo implementation via tviewyaml. The TextView1 slide uses SetScrollable(false) and SetChangedFunc for a live-updating counter that writes to the TextView from a goroutine.
Demo Usage
TextView1 uses SetScrollable(false) and SetChangedFunc for live updates.
Proposed Approach
- Add
scrollable: false (default true) and onChanged (template expression) to TextView primitive
- In
builder/properties.go, call SetScrollable and SetChangedFunc when configured
- For
onChanged, the callback can trigger app.Draw() or run a template action
Relevant Files
config/types.go – add scrollable, onChanged for textView
builder/properties.go – applyTextViewProperties
docs/tview-coverage.md – document once implemented
Summary
Expose TextView's
SetScrollableandSetChangedFuncin YAML config so views can be non-scrollable and trigger redraws or callbacks when content changes (e.g. for live-updating displays).Background
Discovered while planning a tview presentation demo implementation via tviewyaml. The TextView1 slide uses
SetScrollable(false)andSetChangedFuncfor a live-updating counter that writes to the TextView from a goroutine.Demo Usage
TextView1 uses
SetScrollable(false)andSetChangedFuncfor live updates.Proposed Approach
scrollable: false(default true) andonChanged(template expression) to TextView primitivebuilder/properties.go, callSetScrollableandSetChangedFuncwhen configuredonChanged, the callback can triggerapp.Draw()or run a template actionRelevant Files
config/types.go– addscrollable,onChangedfor textViewbuilder/properties.go–applyTextViewPropertiesdocs/tview-coverage.md– document once implemented