Added links to Wiki to documentation. Also replaced screenshot with GIF screencast.

This commit is contained in:
Oliver 2018-01-07 16:39:06 +01:00
parent 7b5ab63e8c
commit e4f97a6436
16 changed files with 30 additions and 4 deletions

View File

@ -5,7 +5,7 @@
This Go package provides commonly needed components for terminal based user interfaces.
![Screenshot](screenshot.jpg)
![Screenshot](tview.gif)
Among these components are:

2
box.go
View File

@ -7,6 +7,8 @@ import (
// Box implements Primitive with a background and optional elements such as a
// border and a title. Most subclasses keep their content contained in the box
// but don't necessarily have to.
//
// See https://github.com/rivo/tview/wiki/Box for an example.
type Box struct {
// The position of the rect.
x, y, width, height int

View File

@ -5,6 +5,8 @@ import (
)
// Button is labeled box that triggers an action when selected.
//
// See https://github.com/rivo/tview/wiki/Button for an example.
type Button struct {
*Box

View File

@ -4,8 +4,10 @@ import (
"github.com/gdamore/tcell"
)
// Checkbox is a one-line box (three lines if there is a title) where the
// user can enter text.
// Checkbox implements a simple box for boolean values which can be checked and
// unchecked.
//
// See https://github.com/rivo/tview/wiki/Checkbox for an example.
type Checkbox struct {
*Box

View File

@ -12,6 +12,8 @@ type dropDownOption struct {
// DropDown is a one-line box (three lines if there is a title) where the
// user can enter text.
//
// See https://github.com/rivo/tview/wiki/DropDown for an example.
type DropDown struct {
*Box

View File

@ -18,7 +18,9 @@ type flexItem struct {
Focus bool // Whether or not this item attracts the layout's focus.
}
// Flex is a basic implementation of a flexbox layout.
// Flex is a basic implementation of the Flexbox layout.
//
// See https://github.com/rivo/tview/wiki/Flex for an example.
type Flex struct {
*Box

View File

@ -25,6 +25,8 @@ type FormItem interface {
}
// Form is a Box which contains multiple input fields, one per row.
//
// See https://github.com/rivo/tview/wiki/Form for an example.
type Form struct {
*Box

View File

@ -14,6 +14,8 @@ type frameText struct {
// Frame is a wrapper which adds a border around another primitive. The top area
// (header) and the bottom area (footer) may also contain text.
//
// See https://github.com/rivo/tview/wiki/Frame for an example.
type Frame struct {
*Box

View File

@ -9,6 +9,8 @@ import (
// InputField is a one-line box (three lines if there is a title) where the
// user can enter text.
//
// See https://github.com/rivo/tview/wiki/InputField for an example.
type InputField struct {
*Box

View File

@ -15,6 +15,8 @@ type listItem struct {
}
// List displays rows of items, each of which can be selected.
//
// See https://github.com/rivo/tview/wiki/List for an example.
type List struct {
*Box

View File

@ -7,6 +7,8 @@ import (
// Modal is a centered message window used to inform the user or prompt them
// for an immediate decision. It needs to have at least one button (added via
// AddButtons()) or it will never disappear.
//
// See https://github.com/rivo/tview/wiki/Modal for an example.
type Modal struct {
*Box

View File

@ -15,6 +15,8 @@ type page struct {
// Pages is a container for other primitives often used as the application's
// root primitive. It allows to easily switch the visibility of the contained
// primitives.
//
// See https://github.com/rivo/tview/wiki/Pages for an example.
type Pages struct {
*Box

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

View File

@ -84,6 +84,8 @@ func (c *TableCell) GetLastPosition() (x, y, width int) {
// When there is no selection, this affects the entire table (except for fixed
// rows and columns). When there is a selection, the user moves the selection.
// The class will attempt to keep the selection from moving out of the screen.
//
// See https://github.com/rivo/tview/wiki/Table for an example.
type Table struct {
*Box

View File

@ -94,6 +94,8 @@ type textViewIndex struct {
//
// The ScrollToHighlight() function can be used to jump to the currently
// highlighted region once when the text view is drawn the next time.
//
// See https://github.com/rivo/tview/wiki/TextView for an example.
type TextView struct {
sync.Mutex
*Box

BIN
tview.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB