Skip to content

jaar23/tui_widget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tui_widget

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

Quick preview

preview

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.

Usage

git clone https://github.com/jaar23/tui_widget.git

cd tui_widget && nimble install

Dependencies

# base
nimble install [email protected]

# 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

Simple Example

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()

Docs

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.

Examples

Refers to tests / examples folder for example.

About

terminal ui widget based on illwill

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages