cview/README.md

81 lines
2.6 KiB
Markdown
Raw Normal View History

2020-01-05 17:14:15 +00:00
# cview
2020-02-07 00:06:47 +00:00
[![GoDoc](https://gitlab.com/tslocum/godoc-static/-/raw/master/badge.svg)](https://docs.rocketnine.space/gitlab.com/tslocum/cview)
2020-01-22 23:28:19 +00:00
[![CI status](https://gitlab.com/tslocum/cview/badges/master/pipeline.svg)](https://gitlab.com/tslocum/cview/commits/master)
2020-01-07 00:59:59 +00:00
[![Donate](https://img.shields.io/liberapay/receives/rocketnine.space.svg?logo=liberapay)](https://liberapay.com/rocketnine.space)
2020-01-05 17:14:15 +00:00
Terminal-based user interface toolkit
2020-01-05 17:14:15 +00:00
This package is a fork of [tview](https://github.com/rivo/tview).
2020-01-22 23:28:19 +00:00
See [FORK.md](https://gitlab.com/tslocum/cview/blob/master/FORK.md) for more information.
2020-01-05 17:14:15 +00:00
## Demo
2020-02-22 18:14:57 +00:00
`ssh cview.rocketnine.space -p 20000`
2020-01-05 17:14:15 +00:00
2020-02-07 00:06:47 +00:00
[![Recording of presentation demo](https://gitlab.com/tslocum/cview/-/raw/master/cview.gif)](https://gitlab.com/tslocum/cview/tree/master/demos/presentation)
2020-01-05 17:14:15 +00:00
## Features
2020-01-04 22:58:58 +00:00
Available widgets:
- __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__
- Selectable __lists__
- __Grid__, __Flexbox__ and __page layouts__
- Modal __message windows__
2020-01-23 16:03:22 +00:00
- Horizontal and vertical __progress bars__
- An __application__ wrapper
Widgets may be customized and extended to suit any application.
2020-02-07 00:06:47 +00:00
[Mouse support](https://docs.rocketnine.space/gitlab.com/tslocum/cview#hdr-Mouse_Support) is available.
2020-01-05 17:14:15 +00:00
## Installation
```bash
2020-01-22 23:28:19 +00:00
go get gitlab.com/tslocum/cview
```
## Hello World
This basic example creates a box titled "Hello, World!" and displays it in your terminal:
```go
package main
import (
2020-01-22 23:28:19 +00:00
"gitlab.com/tslocum/cview"
)
func main() {
box := cview.NewBox().SetBorder(true).SetTitle("Hello, world!")
if err := cview.NewApplication().SetRoot(box, true).Run(); err != nil {
panic(err)
}
}
```
2020-02-22 18:14:57 +00:00
Examples are available via [godoc](https://docs.rocketnine.space/gitlab.com/tslocum/cview#pkg-examples)
and in the "demos" subdirectory.
For a presentation highlighting the features of this package, compile and run
the program in the "demos/presentation" subdirectory.
## Documentation
2020-02-07 00:06:47 +00:00
Package documentation is available via [godoc](https://docs.rocketnine.space/gitlab.com/tslocum/cview).
2020-01-22 23:28:19 +00:00
2020-01-23 16:03:22 +00:00
An [introduction tutorial](https://rocketnine.space/post/tview-and-you/) is also available.
## Dependencies
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
2020-01-22 23:28:19 +00:00
[CONTRIBUTING.md](https://gitlab.com/tslocum/cview/blob/master/CONTRIBUTING.md) describes how to share
issues, suggestions and patches (pull requests).