cview/README.md

90 lines
3.0 KiB
Markdown
Raw Normal View History

2020-09-23 23:14:14 +00:00
# cview - Terminal-based user interface toolkit
[![GoDoc](https://code.rocketnine.space/tslocum/godoc-static/raw/branch/master/badge.svg)](https://docs.rocketnine.space/code.rocketnine.space/tslocum/cview)
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
This package is a fork of [tview](https://github.com/rivo/tview).
See [FORK.md](https://code.rocketnine.space/tslocum/cview/src/branch/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
[![Recording of presentation demo](https://code.rocketnine.space/tslocum/cview/raw/branch/master/cview.svg)](https://code.rocketnine.space/tslocum/cview/src/branch/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__
2020-04-19 03:00:36 +00:00
- Selectable __lists__ with __context menus__
2020-09-24 15:09:55 +00:00
- Modal __dialogs__
2020-01-23 16:03:22 +00:00
- Horizontal and vertical __progress bars__
2020-10-16 04:28:54 +00:00
- __Grid__, __Flexbox__ and __tabbed panel layouts__
2020-09-24 15:09:55 +00:00
- Sophisticated navigable __table views__
- Flexible __tree views__
- Draggable and resizable __windows__
- An __application__ wrapper
Widgets may be customized and extended to suit any application.
[Mouse support](https://docs.rocketnine.space/code.rocketnine.space/tslocum/cview#hdr-Mouse_Support) is available.
2020-01-05 17:14:15 +00:00
2021-01-05 22:29:02 +00:00
## Applications
A list of applications powered by cview is available via [pkg.go.dev](https://pkg.go.dev/code.rocketnine.space/tslocum/cview?tab=importedby).
2021-01-05 22:29:02 +00:00
## Installation
```bash
go get code.rocketnine.space/tslocum/cview
```
## Hello World
This basic example creates a TextView titled "Hello, World!" and displays it in your terminal:
```go
package main
import (
"code.rocketnine.space/tslocum/cview"
)
func main() {
2020-10-12 17:19:41 +00:00
app := cview.NewApplication()
tv := cview.NewTextView()
tv.SetBorder(true)
tv.SetTitle("Hello, world!")
tv.SetText("Lorem ipsum dolor sit amet")
2020-10-12 17:19:41 +00:00
app.SetRoot(tv, true)
2020-10-12 17:19:41 +00:00
if err := app.Run(); err != nil {
panic(err)
}
}
```
Examples are available via [godoc](https://docs.rocketnine.space/code.rocketnine.space/tslocum/cview#pkg-examples)
and in the [demos](https://code.rocketnine.space/tslocum/cview/src/branch/master/demos) directory.
For a presentation highlighting the features of this package, compile and run
the program in the [demos/presentation](https://code.rocketnine.space/tslocum/cview/src/branch/master/demos/presentation) directory.
## Documentation
Package documentation is available via [godoc](https://docs.rocketnine.space/code.rocketnine.space/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
[CONTRIBUTING.md](https://code.rocketnine.space/tslocum/cview/src/branch/master/CONTRIBUTING.md) describes how to share
issues, suggestions and patches (pull requests).