diff options
| author | dam <dam@gudinoff> | 2023-11-11 03:51:35 +0000 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2023-11-11 03:51:35 +0000 |
| commit | 90beac697609d7d4926e18a0eb0c576b9a22058b (patch) | |
| tree | 97b8a9f1e8afc8154cda569f224fe09fe6558f18 /ttt.jai | |
| parent | 70d3b82ca7817a066120ff88deb8b56e90d454ca (diff) | |
| download | task-time-tracker-90beac697609d7d4926e18a0eb0c576b9a22058b.tar.zst task-time-tracker-90beac697609d7d4926e18a0eb0c576b9a22058b.zip | |
Reading input was greatly simplified.
Diffstat (limited to 'ttt.jai')
| -rw-r--r-- | ttt.jai | 58 |
1 files changed, 40 insertions, 18 deletions
@@ -1221,7 +1221,17 @@ main :: () { return; } - #if 1 { + #if 0 { + print("testing select\n"); + TUI.start(); + TUI.test(); + TUI.test(); + TUI.test(); + TUI.stop(); + return; + } + + #if 0 { print("test 3\n"); TUI.start(); key: TUI.Key = #char "d"; @@ -1242,23 +1252,35 @@ main :: () { print("!\n\r"); return; } - - // TUI.start_new_mode(); - // sleep_milliseconds(3000); - xrows, xcolumns := TUI.get_terminal_size(); - TUI.draw_box(1, 1, xcolumns, xrows); - // print("<beep>"); - bbb: [64] u8; - - br, err, err_msg := TUI.OS_read_input(bbb.data, 5); - print(">%/%/%/%\n", cast(string)bbb, br, err, err_msg); - sleep_milliseconds(3000); - // coisa := TUI.get_str(); - // print("\n>%<\n", coisa); - print("stopping\n"); - // TUI.stop_new_mode(); - TUI.stop(); - return; + + #if 1 { + print("test 4\n", to_standard_error = true); + TUI.start(); + xcolumns, xrows: int; + key: TUI.Key = #char "d"; + while(key != #char "q") { + __mark := get_temporary_storage_mark(); + TUI.set_cursor_position(3, 3); + write_string("dam "); + print("%:%", xcolumns, xrows); + key = TUI.get_key(3000); + if key == xx TUI.Keys.None { + write_string(">bazinga<"); + sleep_milliseconds(1000); + } + else if key == xx TUI.Keys.Resize { + TUI.clear_terminal(); + xrows, xcolumns = TUI.get_terminal_size(); + TUI.draw_box(1, 1, xcolumns, xrows); + } + else { + print_character(key); + } + } + TUI.stop(); + print("size(CxR): %x%\n", xcolumns, xrows); + return; + } // -- -- -- TODO WIP Testing TUI -- START |
