summaryrefslogtreecommitdiff
path: root/tui/widget/list/list.ha
diff options
context:
space:
mode:
Diffstat (limited to 'tui/widget/list/list.ha')
-rw-r--r--tui/widget/list/list.ha7
1 files changed, 4 insertions, 3 deletions
diff --git a/tui/widget/list/list.ha b/tui/widget/list/list.ha
index 50fb8df..ca7571b 100644
--- a/tui/widget/list/list.ha
+++ b/tui/widget/list/list.ha
@@ -1,3 +1,4 @@
+use tui;
use tui::widget;
use io;
use unix::tty;
@@ -18,9 +19,9 @@ export type list = struct {
// Return an instance of list. out is the tty file, pos the starting position,
// sz is the size of the widget (if void 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,
+export fn newlist(state: *tui::tui, pos: widget::coords, sz: widget::widgetsize,
style: (*widget::style | void), items: str...) (list | tty::error) = {
- const tsz = tty::winsize(out)?;
+ const tsz = tty::winsize(state.out)?;
let end = match (sz) {
case let sz: tty::ttysize =>
@@ -35,7 +36,7 @@ style: (*widget::style | void), items: str...) (list | tty::error) = {
return list {
widget = widget::widget {
- out = out,
+ state = state,
print = &printlist,
resize = &resizelist,
pos = pos,