diff --git a/README.md b/README.md index 2c03ace..9758c37 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/box.go b/box.go index 7069ed7..fc5273a 100644 --- a/box.go +++ b/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 diff --git a/button.go b/button.go index 99789a3..d438d0a 100644 --- a/button.go +++ b/button.go @@ -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 diff --git a/checkbox.go b/checkbox.go index c9da33b..83d4dc4 100644 --- a/checkbox.go +++ b/checkbox.go @@ -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 diff --git a/dropdown.go b/dropdown.go index 8d0fd9c..c232856 100644 --- a/dropdown.go +++ b/dropdown.go @@ -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 diff --git a/flex.go b/flex.go index db5b3ac..6c46212 100644 --- a/flex.go +++ b/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 diff --git a/form.go b/form.go index 875790f..7043f88 100644 --- a/form.go +++ b/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 diff --git a/frame.go b/frame.go index 473df78..77c5316 100644 --- a/frame.go +++ b/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 diff --git a/inputfield.go b/inputfield.go index 2292567..047d386 100644 --- a/inputfield.go +++ b/inputfield.go @@ -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 diff --git a/list.go b/list.go index adbc533..8f1fdac 100644 --- a/list.go +++ b/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 diff --git a/modal.go b/modal.go index 51d3e6b..132c980 100644 --- a/modal.go +++ b/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 diff --git a/pages.go b/pages.go index 6e83d2c..9814867 100644 --- a/pages.go +++ b/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 diff --git a/screenshot.jpg b/screenshot.jpg deleted file mode 100644 index b35daab..0000000 Binary files a/screenshot.jpg and /dev/null differ diff --git a/table.go b/table.go index bbb583a..8a8b988 100644 --- a/table.go +++ b/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 diff --git a/textview.go b/textview.go index 6c87fd5..f063ebe 100644 --- a/textview.go +++ b/textview.go @@ -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 diff --git a/tview.gif b/tview.gif new file mode 100644 index 0000000..0583d7b Binary files /dev/null and b/tview.gif differ