Categorygithub.com/cceckman/tui-go
modulepackage
0.3.0-unofficial
Repository: https://github.com/cceckman/tui-go.git
Documentation: pkg.go.dev

# README

tui: Terminal UI for Go

Build Status GoDoc Go Report Card License MIT

A UI library for terminal applications.

tui (pronounced tooey) provides a higher-level programming model for building rich terminal applications. It lets you build layout-based user interfaces that (should) gracefully handle resizing for you.

IMPORTANT: tui-go is still in an experimental phase so please don't use it for anything other than experiments, yet.

Screenshot

Installation

go get github.com/marcusolsson/tui-go

Usage

package main

import "github.com/marcusolsson/tui-go"

func main() {
	box := tui.NewVBox(
		tui.NewLabel("tui-go"),
	)

	ui := tui.New(box)
	ui.SetKeybinding("Esc", func() { ui.Quit() })

	if err := ui.Run(); err != nil {
		panic(err)
	}
}

Getting started

If you want to know what it is like to build terminal applications with tui-go, check out some of the examples.

Documentation is available at godoc.org.

Related projects

tui-go is mainly influenced by Qt and offers a similar programming model that has been adapted to Go and the terminal.

For an overview of the alternatives for writing terminal user interfaces, check out this article by AppliedGo.

License

tui-go is released under the MIT License.

Contact

If you're interested in chatting with users and contributors, join #tui-go on the Gophers Slack. If you're not already a part of the Slack workspace, you can join here. If you prefer a lower-bandwidth interface, see this article on connecting to Slack via IRC or XMPP.

# Packages

No description provided by the author
No description provided by the author

# Functions

New returns a new UI with a root widget.
NewButton returns a new Button with the given text as the label.
NewEntry returns a new Entry.
NewGrid returns a new Grid.
NewHBox returns a new horizontally aligned Box.
NewLabel returns a new Label.
NewList returns a new List with no selection.
NewPadder returns a new Padder.
NewPainter returns a new instance of Painter.
NewProgress returns a new Progress.
NewScrollArea returns a new ScrollArea.
NewSpacer returns a new Spacer.
NewStatusBar returns a new StatusBar.
NewTable returns a new Table.
NewTestSurface returns a new TestSurface.
NewTextEdit returns a new TextEdit.
NewTheme return an empty theme.
NewVBox returns a new vertically aligned Box.

# Constants

Common colors.
Common colors.
Common colors.
Common colors.
Common colors.
Common colors.
Common colors.
Common colors.
Common colors.
Decoration modes: Inherit from parent widget, explicitly on, or explicitly off.
Decoration modes: Inherit from parent widget, explicitly on, or explicitly off.
Decoration modes: Inherit from parent widget, explicitly on, or explicitly off.
Expanding makes the widget expand to the available space.
Available alignment options.
These are the defined ASCII values for key codes.
These are aliases for other keys.
These are aliases for other keys.
These are named keys that can be handled.
These are the defined ASCII values for key codes.
These are the defined ASCII values for key codes.
These are the defined ASCII values for key codes.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are the defined ASCII values for key codes.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
Escape.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the supported control keys.
These are the defined ASCII values for key codes.
These are the defined ASCII values for key codes.
These are the defined ASCII values for key codes.
These are the defined ASCII values for key codes.
These are the defined ASCII values for key codes.
These are named keys that can be handled.
These are the defined ASCII values for key codes.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are the defined ASCII values for key codes.
These are named keys that can be handled.
These are the defined ASCII values for key codes.
These are aliases for other keys.
These are the defined ASCII values for key codes.
These are aliases for other keys.
These are the defined ASCII values for key codes.
These are aliases for other keys.
These are the defined ASCII values for key codes.
These are the defined ASCII values for key codes.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are the defined ASCII values for key codes.
These are the defined ASCII values for key codes.
These are the defined ASCII values for key codes.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are the defined ASCII values for key codes.
These are the defined ASCII values for key codes.
These are the defined ASCII values for key codes.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are the defined ASCII values for key codes.
These are named keys that can be handled.
These are the defined ASCII values for key codes.
These are the defined ASCII values for key codes.
These are the defined ASCII values for key codes.
These are the defined ASCII values for key codes.
These are the defined ASCII values for key codes.
These are the defined ASCII values for key codes.
These are aliases for other keys.
These are the defined ASCII values for key codes.
These are named keys that can be handled.
These are named keys that can be handled.
These are named keys that can be handled.
These are the defined ASCII values for key codes.
These are the defined ASCII values for key codes.
Maximum allows the widget to grow up to the size hint.
Minimum allows the widget to shrink down to the size hint.
Modifiers that can be sent with a KeyEvent or a MouseEvent.
Modifiers that can be sent with a KeyEvent or a MouseEvent.
Modifiers that can be sent with a KeyEvent or a MouseEvent.
Modifiers that can be sent with a KeyEvent or a MouseEvent.
Modifiers that can be sent with a KeyEvent or a MouseEvent.
Preferred interprets the size hint as the preferred size.
Available alignment options.

# Variables

DefaultFocusChain is the default focus chain.
DefaultTheme is a theme with reasonable defaults.

# Structs

Box is a layout for placing widgets either horizontally or vertically.
Button is a widget that can be activated to perform some action, or to answer a question.
Entry
Entry is a one-line text editor.
Grid is a widget that lays out widgets in a grid.
KeyEvent represents a key press.
Label is a widget to display read-only text.
List is a widget for displaying and selecting items.
MouseEvent represents the event where a mouse button was pressed or released.
Padder is a widget to fill out space.
Painter provides operations to paint on a surface.
Progress is a widget to display a progress bar.
RuneBuffer provides readline functionality for text widgets.
ScrollArea is a widget to fill out space.
SimpleFocusChain represents a ring of widgets where focus is loops to the first widget when it reaches the end.
Spacer is a widget to fill out space.
StatusBar is a widget to display status information.
Style determines how a cell should be painted.
Table is a widget that lays out widgets in a table.
A TestSurface implements the Surface interface with local buffers, and provides accessors to check the output of a draw operation on the Surface.
TextEdit is a multi-line text editor.
Theme defines the styles for a set of identifiers.
WidgetBase defines base attributes and operations for all widgets.

# Interfaces

FocusChain enables custom focus traversal when Tab or Backtab is pressed.
Surface defines a surface that can be painted on.
UI defines the operations needed by the underlying engine.
Widget defines common operations on widgets.

# Type aliases

Alignment is used to set the direction in which widgets are laid out.
Color represents a color.
Decoration represents a bold/underline/etc.
Key represents both normal and special keys.
ModMask is a mask of modifier keys.
SizePolicy determines the space occupied by a widget.