From 48c5f4a17840b8418cb64f6e1667da86d804ba02 Mon Sep 17 00:00:00 2001 From: Julian Hurst Date: Wed, 12 Mar 2025 10:21:02 +0100 Subject: Use H instead of f in gotoroot --- tui/widget/widget.ha | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tui/widget/widget.ha b/tui/widget/widget.ha index cb202be..77b6f88 100644 --- a/tui/widget/widget.ha +++ b/tui/widget/widget.ha @@ -10,15 +10,24 @@ export type resizefn = fn(w: *widget, ttysize: tty::ttysize) void; export type nosize = void; export type widgetsize = (tty::ttysize | nosize); +export type style = struct { + border: bool, +}; + +export def DEFAULT_STYLE: style = style { + border = false, +}; + export type widget = struct { out: io::file, print: *printfn, resize: *resizefn, pos: coords, sz: widgetsize, + style: style, }; -def gotoroot: str = "\x1B[1;1f"; +def gotoroot: str = "\x1B[1;1H"; export fn print(out: io::file, s: str, pos: coords) void = { fmt::fprintf(out, "\x1B[{};{}H", pos.0, pos.1)!; -- cgit v1.2.3