Terminal-based user interface toolkit
Go to file
Trevor Slocum b06b07dadb Add WordWrap test 2021-08-02 13:00:32 -07:00
demos Add TextView.SetVerticalAlign 2021-07-05 12:52:52 -07:00
.gitignore Document TextView region tag fix 2021-08-02 11:27:18 -07:00
CHANGELOG Document TextView region tag fix 2021-08-02 11:27:18 -07:00
CONTRIBUTING.md Add code.rocketnine.space migration notice 2021-04-03 08:11:20 -07:00
DESIGN.md Add code.rocketnine.space migration notice 2021-04-03 08:11:20 -07:00
FORK.md Add Application.Draw change to FORK.md 2021-07-17 11:43:54 -07:00
LICENSE Document TextView region tag fix 2021-08-02 11:27:18 -07:00
Makefile chore: Add makefile and use in `gitlab-ci.yml` 2020-09-23 20:54:48 +02:00
README.md Add Button.SetCursorRune and CheckBox.SetCursorRune 2021-06-05 10:24:43 -07:00
ansi.go Bugfixes in ANSI escape sequence handling as well as TextView, fixes #320, fixes #344 2020-06-09 14:52:59 -07:00
application.go Update Application.QueueUpdateDraw to accept one or more primitives to draw instead of the whole screen 2021-06-06 20:44:56 -07:00
borders.go Fork tview as cview 2019-12-30 15:18:26 -08:00
box.go Document how to prevent screen artifacts when using SetBackgroundTransparent 2020-12-15 10:40:06 -08:00
box_test.go Add comments to tests 2020-04-28 14:58:37 -07:00
button.go Improve Button cursor positioning 2021-06-05 11:00:31 -07:00
button_test.go Add comments to tests 2020-04-28 14:58:37 -07:00
checkbox.go Add Button.SetCursorRune and CheckBox.SetCursorRune 2021-06-05 10:24:43 -07:00
checkbox_test.go Add comments to tests 2020-04-28 14:58:37 -07:00
contextmenu.go Rename SetBorderPadding and GetBorderPadding as SetPadding and GetPadding 2020-10-26 10:41:47 -07:00
cview.svg Update presentation demo recording 2020-10-21 18:40:16 -07:00
doc.go Add TabbedPanels to doc.go 2021-07-04 01:09:44 -07:00
doc_test.go Add code.rocketnine.space migration notice 2021-04-03 08:11:20 -07:00
dropdown.go Add Button.SetCursorRune and CheckBox.SetCursorRune 2021-06-05 10:24:43 -07:00
flex.go Fill empty space in Flex with invisible Box 2021-07-04 01:30:23 -07:00
focus.go Add FocusManager 2020-10-16 09:25:21 -07:00
form.go Add Button.SetCursorRune and CheckBox.SetCursorRune 2021-06-05 10:24:43 -07:00
frame.go Add SetVisible and GetVisible to all widgets 2020-10-19 19:05:03 -07:00
go.mod Add Modal.SetButtonsAlign and Modal.SetTextAlign 2021-07-17 12:52:49 -07:00
go.sum Add Modal.SetButtonsAlign and Modal.SetTextAlign 2021-07-17 12:52:49 -07:00
grid.go Fix passing mouse events to Grid items 2021-07-05 17:51:57 -07:00
inputfield.go Fix drawing InputField cursor outside of the field 2021-07-08 17:35:19 -07:00
keys.go Add code.rocketnine.space migration notice 2021-04-03 08:11:20 -07:00
list.go Update List, Table and TreeView to not handle Tab or Backtab 2021-05-25 09:04:35 -07:00
list_test.go Remove return values from methods which return their primitive (breaks chaining) 2020-10-07 16:35:21 -07:00
modal.go Add Modal.SetButtonsAlign and Modal.SetTextAlign 2021-07-17 12:52:49 -07:00
mouse.go Print text using []byte instead of string, calculate string width using runewidth instead of uniseg 2020-10-06 13:16:37 -07:00
panels.go Preserve order of panels when updating panel 2021-01-05 14:53:40 -08:00
primitive.go Allow hiding form items 2020-10-19 21:12:22 -07:00
progressbar.go Add SetVisible and GetVisible to all widgets 2020-10-19 19:05:03 -07:00
progressbar_test.go Add comments to tests 2020-04-28 14:58:37 -07:00
semigraphics.go Upgrade tcell to v2 2020-08-30 08:37:17 -07:00
slider.go Improve Button cursor positioning 2021-06-05 11:00:31 -07:00
styles.go Add Button.SetCursorRune and CheckBox.SetCursorRune 2021-06-05 10:24:43 -07:00
tabbedpanels.go Add TextView highlight color options 2021-05-30 18:17:17 -07:00
table.go Update List, Table and TreeView to not handle Tab or Backtab 2021-05-25 09:04:35 -07:00
table_test.go Store ListItem text as []byte instead of string 2020-10-06 18:19:40 -07:00
textview.go Fixed missed tag at EOL in TextView 2021-08-02 11:22:20 -07:00
textview_test.go Remove return values from methods which return their primitive (breaks chaining) 2020-10-07 16:35:21 -07:00
treeview.go Update List, Table and TreeView to not handle Tab or Backtab 2021-05-25 09:04:35 -07:00
treeview_test.go Add comments to tests 2020-04-28 14:58:37 -07:00
util.go Document WordWrap bug 2021-08-02 12:59:40 -07:00
util_test.go Add WordWrap test 2021-08-02 13:00:32 -07:00
window.go Use SetRect to position Windows 2020-10-20 09:22:54 -07:00
windowmanager.go Fix WindowManager background not being drawn 2020-11-13 20:55:54 -08:00

README.md

cview - Terminal-based user interface toolkit

GoDoc Donate

This package is a fork of tview. See FORK.md for more information.

Demo

ssh cview.rocketnine.space -p 20000

Recording of presentation demo

Features

Available widgets:

  • Input forms (including input/password fields, drop-down selections, checkboxes, and buttons)
  • Navigable multi-color text views
  • Selectable lists with context menus
  • Modal dialogs
  • Horizontal and vertical progress bars
  • Grid, Flexbox and tabbed panel layouts
  • 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 is available.

Applications

A list of applications powered by cview is available via pkg.go.dev.

Installation

go get code.rocketnine.space/tslocum/cview

Hello World

This basic example creates a TextView titled "Hello, World!" and displays it in your terminal:

package main

import (
	"code.rocketnine.space/tslocum/cview"
)

func main() {
	app := cview.NewApplication()

	tv := cview.NewTextView()
	tv.SetBorder(true)
	tv.SetTitle("Hello, world!")
	tv.SetText("Lorem ipsum dolor sit amet")
	
	app.SetRoot(tv, true)
	if err := app.Run(); err != nil {
		panic(err)
	}
}

Examples are available via godoc and in the demos directory.

For a presentation highlighting the features of this package, compile and run the program in the demos/presentation directory.

Documentation

Package documentation is available via godoc.

An introduction tutorial is also available.

Dependencies

This package is based on github.com/gdamore/tcell (and its dependencies) and github.com/rivo/uniseg.

Support

CONTRIBUTING.md describes how to share issues, suggestions and patches (pull requests).