2019-12-30 23:12:17 +00:00
# Terminal-based user interface toolkit
[![GoDoc ](https://godoc.org/git.sr.ht/~tslocum/cview?status.svg )](https://godoc.org/git.sr.ht/~tslocum/cview)
[![builds.sr.ht status ](https://builds.sr.ht/~tslocum/cview.svg )](https://builds.sr.ht/~tslocum/cview)
2017-12-15 14:29:21 +00:00
2019-12-30 23:12:17 +00:00
This package is a [fork ](https://man.sr.ht/~tslocum/cview/FORK.md ) of [tview ](https://github.com/rivo/tview ).
It allows the creation of rich terminal-based user interfaces.
2017-12-15 14:29:21 +00:00
2020-01-02 04:14:14 +00:00
[![Screenshot of presentation demo ](https://git.sr.ht/~tslocum/cview/blob/master/cview.gif )](https://git.sr.ht/~tslocum/cview/tree/master/demos/presentation)
2018-01-06 21:49:12 +00:00
2020-01-04 22:58:58 +00:00
Try the cview presentation demo: ```ssh rocketnine.space -p 20000```
2019-12-30 23:12:17 +00:00
Available widgets:
2018-01-06 21:49:12 +00:00
2019-12-30 23:12:17 +00:00
- __Input forms__ (including __input/password fields__ , __drop-down selections__ , __checkboxes__ , and __buttons__ )
2018-01-07 13:11:26 +00:00
- Navigable multi-color __text views__
- Sophisticated navigable __table views__
2018-06-20 08:06:05 +00:00
- Flexible __tree views__
2018-01-06 21:49:12 +00:00
- Selectable __lists__
2018-02-20 10:19:30 +00:00
- __Grid__, __Flexbox__ and __page layouts__
2018-01-06 21:49:12 +00:00
- Modal __message windows__
- An __application__ wrapper
2019-12-30 23:12:17 +00:00
Widgets may be customized and extended to suit any application.
2018-01-06 21:49:12 +00:00
## Installation
```bash
2020-01-02 04:14:14 +00:00
go get git.sr.ht/~tslocum/cview
2018-01-06 21:49:12 +00:00
```
## Hello World
This basic example creates a box titled "Hello, World!" and displays it in your terminal:
```go
package main
import (
2019-12-30 23:12:17 +00:00
"git.sr.ht/~tslocum/cview"
2018-01-06 21:49:12 +00:00
)
func main() {
2019-12-30 23:12:17 +00:00
box := cview.NewBox().SetBorder(true).SetTitle("Hello, world!")
if err := cview.NewApplication().SetRoot(box, true).Run(); err != nil {
2018-01-06 21:49:12 +00:00
panic(err)
}
}
```
2019-12-30 23:12:17 +00:00
Examples are available in the "demos" subdirectory.
2018-01-06 21:49:12 +00:00
2019-12-30 23:12:17 +00:00
For a presentation highlighting the features of this package, compile and run
the program in the "demos/presentation" subdirectory.
2018-01-06 21:49:12 +00:00
## Documentation
2019-12-30 23:12:17 +00:00
Package documentation is available on [godoc ](https://godoc.org/git.sr.ht/~tslocum/cview ).
2018-01-06 21:49:12 +00:00
## Dependencies
2019-12-30 23:12:17 +00:00
This package is based on [github.com/gdamore/tcell ](https://github.com/gdamore/tcell )
(and its dependencies) and [github.com/rivo/uniseg ](https://github.com/rivo/uniseg ).
## Support
[CONTRIBUTING.md ](https://man.sr.ht/~tslocum/cview/CONTRIBUTING.md ) describes how to share
issues, suggestions and patches (pull requests).
cview has two mailing lists:
- [cview-discuss ](https://lists.sr.ht/~tslocum/cview-discuss ) for general discussion
- [cview-dev ](https://lists.sr.ht/~tslocum/cview-dev ) for development discussion