tui

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Terminate = terminate{}

Functions

func BorderOptionBGColor added in v0.0.5

func BorderOptionBGColor(color uint8) func(*View)

func BorderOptionFGColor added in v0.0.5

func BorderOptionFGColor(color uint8) func(*View)

func If added in v0.0.5

func If[T any](condition bool, t T, f T) T

func Map added in v0.0.5

func Map[T1 any, T2 any](slice []T1, fn func(T1) T2) []T2

func MapN added in v0.0.5

func MapN[T any](number int, fn func(int) T) []T

func OptionChannel added in v0.0.2

func OptionChannel(ch chan any) func(*config) error

func OptionEventHandler added in v0.0.2

func OptionEventHandler(fn func(any) any) func(*config) error

func Run

func Run(createView func() *View, options ...option) error

func RuneWidth

func RuneWidth(r rune) int

func TermSize added in v0.0.5

func TermSize() (width int, height int, err error)

func UseRef added in v0.0.7

func UseRef[T any](initialState T) *T

func UseState added in v0.0.7

func UseState[T any](initialState T) (T, func(T))

Types

type Benchmarker added in v0.0.7

type Benchmarker struct {
	// contains filtered or unexported fields
}

type View

type View struct {
	// contains filtered or unexported fields
}

func Break added in v0.0.5

func Break() *View

func Cursor added in v0.0.5

func Cursor(s string) *View

func Fmt added in v0.0.5

func Fmt(format string, a ...any) *View

func HMap added in v0.0.5

func HMap[T any](slice []T, fn func(T) *View) *View

func HStack added in v0.0.2

func HStack(views ...*View) *View

func InlineMap added in v0.0.5

func InlineMap[T any](slice []T, fn func(T) *View) *View

func InlineMapN added in v0.0.5

func InlineMapN(number int, fn func(int) *View) *View

func InlineStack added in v0.0.5

func InlineStack(views ...*View) *View

func List added in v0.0.7

func List(selected *int, views ...*View) *View

func ListMap added in v0.0.7

func ListMap[T any](selected *int, slice []T, fn func(T) *View) *View

func ListMapN added in v0.0.7

func ListMapN(selected *int, number int, fn func(int) *View) *View

func ScrollView added in v0.0.7

func ScrollView(views ...*View) *View

func Spacer added in v0.0.3

func Spacer() *View

func String added in v0.0.5

func String(s string) *View

func TextView added in v0.0.2

func TextView(body string) *View

func VMap added in v0.0.5

func VMap[T any](slice []T, fn func(T) *View) *View

func VMapN added in v0.0.7

func VMapN(number int, fn func(int) *View) *View

func VStack added in v0.0.2

func VStack(views ...*View) *View

func ZMap added in v0.0.5

func ZMap[T any](slice []T, fn func(T) *View) *View

func ZStack added in v0.0.2

func ZStack(views ...*View) *View

func (*View) AbsoluteSize added in v0.0.2

func (v *View) AbsoluteSize(width, height int) *View

AbsoluteSize specifies absolute width and height of units that the view used. 0 means auto-resizing.

func (*View) AllowOverflow added in v0.0.7

func (v *View) AllowOverflow() *View

func (*View) BGColor added in v0.0.5

func (v *View) BGColor(color uint8) *View

BGColor sets a background color to the view.

func (*View) Bold added in v0.0.6

func (v *View) Bold() *View

Bold sets bold style to the view.

func (*View) Border added in v0.0.2

func (v *View) Border(options ...borderOption) *View

func (*View) FGColor added in v0.0.5

func (v *View) FGColor(color uint8) *View

FGColor sets a foreground color to the view.

func (*View) Hidden added in v0.0.3

func (v *View) Hidden(isHidden bool) *View

func (*View) If added in v0.0.6

func (v *View) If(condition bool, fn func(v *View) *View) *View

func (*View) Italic added in v0.0.6

func (v *View) Italic() *View

Italic sets italic style to the view.

func (*View) KeyHandler added in v0.0.6

func (v *View) KeyHandler(fn func(rune) any) *View

func (*View) OffsetY added in v0.0.7

func (v *View) OffsetY(i int) *View

func (*View) Padding added in v0.0.2

func (v *View) Padding(values ...uint8) *View

Padding sets padding values to the view. When one value is specified, it applies the same padding to all four sides. When two values are specified, the first padding applies to the top and bottom, the second to the left and right. When three values are specified, the first padding applies to the top, the second to the right and left, the third to the bottom. When four values are specified, the paddings apply to the top, right, bottom, and left in that order (clockwise).

func (*View) Priority added in v0.0.7

func (v *View) Priority(priority int8) *View

func (*View) RelativeSize added in v0.0.2

func (v *View) RelativeSize(width, height uint8) *View

RelativeSize specifies relative width and height of units that the view used. The maximum number allowed is 12(100% of the parent view), and 0 means auto-resizing.

func (*View) Reverse added in v0.0.6

func (v *View) Reverse() *View

Reverse sets Reverse style to the view.

func (*View) Strikethrough added in v0.0.6

func (v *View) Strikethrough() *View

Strikethrough sets strikethourgh style to the view.

func (*View) Title added in v0.0.2

func (v *View) Title(title string) *View

Title sets title to the view.

func (*View) Underline added in v0.0.6

func (v *View) Underline() *View

Underline sets underline style to the view.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL