diff options
Diffstat (limited to 'cmd/text.ha')
| -rw-r--r-- | cmd/text.ha | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/cmd/text.ha b/cmd/text.ha index 3ec0f2a..f7ce1fc 100644 --- a/cmd/text.ha +++ b/cmd/text.ha @@ -7,9 +7,9 @@ use fmt; use time; export fn main() void = { - const out = tui::init()!; - defer io::close(out)!; - let txt = text::newtext(out, "hello world", (50, 20), &widget::style { + const state = tui::init()!; + defer tui::finish(&state); + let txt = text::newtext(&state, "hello world", (50, 20), &widget::style { border = true, colorfg = widget::color::REDFG, colorbg = widget::color::REDBG, @@ -17,32 +17,46 @@ export fn main() void = { let l = layout::newvlayout(&txt); l.layout.print(&l); + tui::clear(&state); + time::sleep(1 * time::SECOND); let st = txt.widget.style as *widget::style; st.colorfg = widget::color::GREENFG; text::settext(&txt, "bye world"); l.layout.print(&l); + tui::clear(&state); + time::sleep(1 * time::SECOND); st.colorfg = widget::color::BROWNFG; l.layout.print(&l); + tui::clear(&state); + time::sleep(1 * time::SECOND); st.colorfg = widget::color::BLUEFG; l.layout.print(&l); + tui::clear(&state); + time::sleep(1 * time::SECOND); st.colorfg = widget::color::MAGENTAFG; l.layout.print(&l); + tui::clear(&state); + time::sleep(1 * time::SECOND); st.colorfg = widget::color::CYANFG; l.layout.print(&l); + tui::clear(&state); + time::sleep(1 * time::SECOND); st.colorfg = widget::color::WHITEFG; l.layout.print(&l); + tui::clear(&state); + time::sleep(1 * time::SECOND); st.colorfg = widget::color::DEFAULTFG; l.layout.print(&l); |
