BTUI - Bruce's Terminal User Interface
This is an extremely lightweight, but powerful Tomo library for making terminal user interfaces based on the C library BTUI.
Usage
Add this to your modules.ini:
[btui]
version=v1.1
git=https://github.com/bruce-hill/tomo-btui
Example program
use btui
func main()
set_mode(TUI)
size := get_size()
style(bold=yes)
write("Welcome to BTUI", size/2, Center)
style(bold=no, faint=yes)
write("Press 'q' or 'Ctrl-c' to quit", size/2 + ScreenVec2(0,1), Center)
style(bold=no)
repeat
key := get_key()
pos := size/2 + ScreenVec2(0,2)
clear(Line, pos=pos)
style(Magenta)
write("Your input: $key", pos, Center)
if key == "q" or key == "Ctrl-c"
stop
disable()
A more complex example program can be found at examples/picker.tm
License
This code is licensed under the MIT license with the Commons Clause. See LICENSE.md for full details.
1 # BTUI - Bruce's Terminal User Interface3 This is an extremely lightweight, but powerful Tomo library for making terminal6 ## Usage10 ```11 [btui]12 version=v1.113 git=https://github.com/bruce-hill/tomo-btui14 ```16 ## Example program18 ```19 use btui21 func main()22 set_mode(TUI)23 size := get_size()24 style(bold=yes)25 write("Welcome to BTUI", size/2, Center)26 style(bold=no, faint=yes)27 write("Press 'q' or 'Ctrl-c' to quit", size/2 + ScreenVec2(0,1), Center)28 style(bold=no)29 repeat30 key := get_key()31 pos := size/2 + ScreenVec2(0,2)32 clear(Line, pos=pos)33 style(Magenta)34 write("Your input: $key", pos, Center)35 if key == "q" or key == "Ctrl-c"36 stop38 disable()39 ```43 ## License45 This code is licensed under the MIT license with the Commons Clause.