mirror of https://github.com/gizak/termui.git
ed219e8c05
Moved the PollEvents call outside of the for loop |
||
---|---|---|
_examples | ||
scripts | ||
test | ||
.gitignore | ||
.travis.yml | ||
CHANGELOG.md | ||
LICENSE | ||
README.md | ||
barchart.go | ||
block.go | ||
block_common.go | ||
block_test.go | ||
block_windows.go | ||
buffer.go | ||
buffer_test.go | ||
canvas.go | ||
canvas_test.go | ||
doc.go | ||
events.go | ||
events_test.go | ||
gauge.go | ||
go.mod | ||
go.sum | ||
grid.go | ||
grid_test.go | ||
helper.go | ||
helper_test.go | ||
linechart.go | ||
linechart_others.go | ||
linechart_windows.go | ||
list.go | ||
par_test.go | ||
paragraph.go | ||
piechart.go | ||
pos.go | ||
pos_test.go | ||
render.go | ||
sparkline.go | ||
stackedbarchart.go | ||
table.go | ||
tabpane.go | ||
textbuilder.go | ||
textbuilder_test.go | ||
theme.go | ||
theme_test.go | ||
widget.go |
README.md
termui
termui
is a cross-platform, easy-to-compile, and fully-customizable terminal dashboard built on top of termbox-go. It is inspired by blessed-contrib and written purely in Go.
termui is currently undergoing some API changes so make sure to check the changelog when upgrading
Installation
Installing from the master branch is recommended:
go get -u github.com/gizak/termui@master
Usage
Hello World
package main
import ui "github.com/gizak/termui"
func main() {
err := ui.Init()
if err != nil {
panic(err)
}
defer ui.Close()
p := ui.NewParagraph("Hello World!")
p.Width = 25
p.Height = 5
ui.Render(p)
uiEvents := ui.PollEvents()
for {
e := <-uiEvents
if e.Type == ui.KeyboardEvent {
return
}
}
}
Widgets
Click image to see the corresponding demo codes.
Examples
Examples can be found in _examples. Run with go run _examples/...
or run all of them consecutively with ./scripts/run_examples.py
.
Documentation
Uses
Related Works
License
This library is under the MIT License