diff options
| author | dam <dam@gudinoff> | 2023-12-20 10:00:44 +0000 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2023-12-20 10:00:44 +0000 |
| commit | 3a949ea9f18d06bbefc73da8ca0c1051252ca96d (patch) | |
| tree | 84df14797d7e608f7dc8e32d8a47cdc61c9eeba9 /ttt.jai | |
| parent | 6dcfeb56e6c65724a76afc8beedc277c8f4f7171 (diff) | |
| download | task-time-tracker-3a949ea9f18d06bbefc73da8ca0c1051252ca96d.tar.zst task-time-tracker-3a949ea9f18d06bbefc73da8ca0c1051252ca96d.zip | |
Trying to fix get_key to behave well when it's buffer is full.
Diffstat (limited to 'ttt.jai')
| -rw-r--r-- | ttt.jai | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -1179,7 +1179,6 @@ read_enter_confirmation :: inline (row: int, style: int, message: string) -> boo return read_input_char(row, style, message) == #char "\n"; } -// main :: () {} main :: () { // -- -- -- Testing TUI -- START @@ -1249,25 +1248,34 @@ main :: () { print("> success\n", to_standard_error = true); } - #if 0 { + #if 1 { print("test 5\n", to_standard_error = true); TUI.start(); TUI.set_terminal_title("bazinga"); xcolumns, xrows: int; key: TUI.Key = #char "d"; last_none_char := "X"; + drop_down := 0; while(key != #char "q") { // __mark := get_temporary_storage_mark(); if key == { - case xx TUI.Keys.None; { + case TUI.Keys.None; { TUI.set_cursor_position(2, 2); last_none_char = ifx last_none_char == "X" then "+" else "X"; write_string(last_none_char); } - case xx TUI.Keys.Resize; { + case TUI.Keys.Resize; #through; + case #char "c"; { TUI.clear_terminal(); + drop_down = 0; + } + + case; { + TUI.set_cursor_position(3+drop_down, 2); + write_string(TUI.to_string(key)); + drop_down += 1; } } size_r, size_c := TUI.get_terminal_size(); |
