summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Hurst <julian.hurst@digdash.com>2025-03-12 10:21:02 +0100
committerJulian Hurst <julian.hurst@digdash.com>2025-03-12 10:21:02 +0100
commit48c5f4a17840b8418cb64f6e1667da86d804ba02 (patch)
treed0a4e35fe227f8bd6d37bc71851cc52ff80df3b3
parent4eeda7244acbc97c2937ecb6768309539e28e35a (diff)
downloadhare-tui-48c5f4a17840b8418cb64f6e1667da86d804ba02.tar.gz
Use H instead of f in gotoroot
-rw-r--r--tui/widget/widget.ha11
1 files changed, 10 insertions, 1 deletions
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)!;