Terminal UI widget based on illwill
The widgets is currently in alpha version. API is getting stable and you're welcome to build yout own text based application.
Note Experimental feature in 0.1.1 branch.
-
merged textarea autocomplete from 0.1.1
-
refactor textarea
It feels like an old school software, let's stick with the keyboard :D, it is navigate by [tab]
button between widgets.
TerminalApp
supports auto-resize and dynamic grid layout of adding widgets too. Check out the docs / examples for how-tos.
git clone https://github.com/jaar23/tui_widget.git
cd tui_widget && nimble install
Dependencies
# base
nimble install illwill@0.4.0
# for paste event
nimble install nimclipboard
# for chart widget
# instead of nimble install asciigraph, use the following backup repo
nimble install https://github.com/nimbackup/asciigraph
# for multi-thread
nimble install threading
nimble install malebolgia
import tui_widget, illwill
var inputBox = newInputBox(1, 1, consoleWidth(), 3, "message")
var display = newDisplay(1, 4, consoleWidth(), 16, "display panel")
let enterEv = proc(ib: InputBox, arg: varargs[string]) =
display.add(inputBox.value & "\n")
inputBox.value("")
inputBox.onEnter = enterEv
var app = newTerminalApp(title="tui widget")
app.addWidget(inputBox)
app.addWidget(display)
app.run()
Getting Started, learn how to create a terminal application with tui_widget
by simple examples.
Widgets, widgets API
Events, explain how tui_widget
's events works
TerminalApp, bootstrap widget with TerminalApp
.
Refers to tests / examples folder for example.