Download

tomo-btui

A Tomo library for Bruce's Terminal User Interface

  • Tomo
  • TUI
Code 1.2K linesC 851Tomo 310
Docs 731 wordsMarkdown 731
NameModifiedLinesSize
examples/ 86 lines6% of this folder's lines 2.4 KiB5% of this folder's bytes
CHANGES.md 17 lines1% of this folder's lines 334 B<1% of this folder's bytes
LICENSE.md 76 lines5% of this folder's lines 3.6 KiB8% of this folder's bytes
README.md 46 lines3% of this folder's lines 1 KiB2% of this folder's bytes
btui.c 922 lines65% of this folder's lines 27.1 KiB60% of this folder's bytes
btui.tm 271 lines19% of this folder's lines 10.4 KiB23% of this folder's bytes

README.md

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.