summaryrefslogtreecommitdiff
path: root/tui
diff options
context:
space:
mode:
authorJulian Hurst <ark@mansus.space>2025-03-12 04:24:30 +0100
committerJulian Hurst <ark@mansus.space>2025-03-12 04:24:30 +0100
commit977f80f4b60983d03d069e11032e9cd15339b6d8 (patch)
treea1fb4a6433fcc0699f6895c616ab8f3cf216976c /tui
parentf5ebe6b7f42ca673c3fcd82207b3ef68e16ea21b (diff)
downloadhare-tui-977f80f4b60983d03d069e11032e9cd15339b6d8.tar.gz
Use nosize in list example and add docs to newlist
Diffstat (limited to 'tui')
-rw-r--r--tui/widget/list/list.ha3
1 files changed, 3 insertions, 0 deletions
diff --git a/tui/widget/list/list.ha b/tui/widget/list/list.ha
index 4da52d5..a4ec77e 100644
--- a/tui/widget/list/list.ha
+++ b/tui/widget/list/list.ha
@@ -15,6 +15,9 @@ export type list = struct {
frame: frame,
};
+// Return an instance of list. out is the tty file, pos the starting position,
+// sz is the size of the widget (if [[widget::nosize]] is used, the maximum possible
+// size is used), items is the slice of items of the list.
export fn newlist(out: io::file, pos: widget::coords, sz: widget::widgetsize, items: str...) (list | tty::error) = {
const tsz = tty::winsize(out)?;