tui

package
v0.0.0-...-f492979 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Black   = 30
	Red     = 31
	Green   = 32
	Yellow  = 33
	Blue    = 34
	Magenta = 35
	Cyan    = 36
	White   = 37
	Default = 39

	BrightBlack   = 90
	BrightRed     = 91
	BrightGreen   = 92
	BrightYellow  = 93
	BrightBlue    = 94
	BrightMagenta = 95
	BrightCyan    = 96
	BrightWhite   = 97
	BrightDefault = 99

	Bold      = 1
	Dim       = 2
	Underline = 4
	Blink     = 5
	Reverse   = 7
	Hide      = 8

	BoldOff      = 21
	DimOff       = 22
	UnderlineOff = 24
	BlinkOff     = 25
	ReverseOff   = 27
	HideOff      = 28
)

Variables

View Source
var AsciiBorderStyle = BorderStyle{
	Horizontal:   "-",
	Vertical:     "|",
	TopLeft:      "+",
	TopRight:     "+",
	BottomLeft:   "+",
	BottomRight:  "+",
	InnerLeft:    "+",
	InnerRight:   "+",
	TopMiddle:    "+",
	InnerMiddle:  "+",
	BottomMiddle: "+",
}
View Source
var DefaultOptions = Options{BorderStyle: UnicodeBorderStyle, Border: true, TabWidth: 2}
View Source
var UnicodeBorderStyle = BorderStyle{
	Horizontal:   "\u2500",
	Vertical:     "\u2502",
	TopLeft:      "\u250C",
	TopRight:     "\u2510",
	BottomLeft:   "\u2514",
	BottomRight:  "\u2518",
	InnerLeft:    "\u251C",
	InnerRight:   "\u2524",
	TopMiddle:    "\u252C",
	InnerMiddle:  "\u253C",
	BottomMiddle: "\u2534",
}

Functions

func AlternativeScreenDisable

func AlternativeScreenDisable(OptionsMap ...map[string]any) string

Disable Alternative Screen

func AlternativeScreenEnable

func AlternativeScreenEnable(OptionsMap ...map[string]any) string

Enable Alternative Screen

func CR

func CR(OptionsMap ...map[string]any) string

carriage return

func CRLF

func CRLF(OptionsMap ...map[string]any) string

carriage return + line feed

func ClearLine

func ClearLine(OptionsMap ...map[string]any) string

clear line and return cursor to first column

func ClearScreen

func ClearScreen(OptionsMap ...map[string]any) string

Clear screen and scrollback buffer

func ClearScrollbackBuffer

func ClearScrollbackBuffer(OptionsMap ...map[string]any) string

func ClearWindow

func ClearWindow(OptionsMap ...map[string]any) string

clear visible screen only (not scrollback buffer)

func Colour

func Colour(effectValue byte, Background ...bool) string

func Colour256

func Colour256(colourValue byte, Background ...bool) string

func ColourRGB

func ColourRGB(R, G, B byte, Background ...bool) string

func CursorDown

func CursorDown(n int, OptionsMap ...map[string]any) string

func CursorHide

func CursorHide(OptionsMap ...map[string]any) string

func CursorHome

func CursorHome(OptionsMap ...map[string]any) string

func CursorLeft

func CursorLeft(n int, OptionsMap ...map[string]any) string

func CursorMove

func CursorMove(row int, col int, OptionsMap ...map[string]any) string

func CursorRestore

func CursorRestore(OptionsMap ...map[string]any) string

func CursorRight

func CursorRight(n int, OptionsMap ...map[string]any) string

func CursorRowCol

func CursorRowCol() (int, int, error)

func CursorSave

func CursorSave(OptionsMap ...map[string]any) string

func CursorShow

func CursorShow(OptionsMap ...map[string]any) string

func CursorUp

func CursorUp(n int, OptionsMap ...map[string]any) string

func Effect

func Effect(effectValue byte) string

func EscapeString

func EscapeString(outputString string) string

func LF

func LF(OptionsMap ...map[string]any) string

line feed

func Render

func Render(outputString string, OptionsMap ...map[string]any) string

func RenderTable

func RenderTable(rows [][]string, OptionsMap ...map[string]any) string

func RenderWindow

func RenderWindow(rows []string, OptionsMap ...map[string]any) string

func Reset

func Reset(OptionsMap ...map[string]any) string

func RuneCount

func RuneCount(outputString string) int

func ScrollDown

func ScrollDown(n int, OptionsMap ...map[string]any) string

func ScrollUp

func ScrollUp(n int, OptionsMap ...map[string]any) string

func TabwriterTable

func TabwriterTable(rows [][]string, OptionsMap ...map[string]any) string

func TermSize

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

func TruncateString

func TruncateString(outputString string, maxWidth int) string

Types

type BorderStyle

type BorderStyle struct {
	Horizontal   string
	Vertical     string
	TopLeft      string
	TopRight     string
	BottomLeft   string
	BottomRight  string
	InnerLeft    string
	InnerRight   string
	TopMiddle    string
	InnerMiddle  string
	BottomMiddle string
}

type Options

type Options struct {
	Header          bool
	Padding         int
	TabWidth        int
	MaxColumnWidth  int
	MaxColumnWidths []int
	MaxWidth        int
	MaxHeight       int
	Row             int
	Column          int
	Border          bool
	BorderStyle     BorderStyle
	RawMode         bool
	Writer          io.Writer
}

func ParseOptions

func ParseOptions(OptionsMap ...map[string]any) Options

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳