mirror of
https://github.com/rivo/tview.git
synced 2025-04-26 13:49:06 +08:00
Added links to Wiki to documentation. Also replaced screenshot with GIF screencast.
This commit is contained in:
parent
7b5ab63e8c
commit
e4f97a6436
@ -5,7 +5,7 @@
|
||||
|
||||
This Go package provides commonly needed components for terminal based user interfaces.
|
||||
|
||||

|
||||

|
||||
|
||||
Among these components are:
|
||||
|
||||
|
2
box.go
2
box.go
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
4
flex.go
4
flex.go
@ -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
|
||||
|
||||
|
2
form.go
2
form.go
@ -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
|
||||
|
||||
|
2
frame.go
2
frame.go
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
2
list.go
2
list.go
@ -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
|
||||
|
||||
|
2
modal.go
2
modal.go
@ -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
|
||||
|
||||
|
2
pages.go
2
pages.go
@ -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
|
||||
|
||||
|
BIN
screenshot.jpg
BIN
screenshot.jpg
Binary file not shown.
Before Width: | Height: | Size: 175 KiB |
2
table.go
2
table.go
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user