Documentation
¶
Index ¶
- Constants
- Variables
- func Run(app App)
- type App
- type Buffer
- func (b *Buffer) At(x, y int) (rune, TextStyle)
- func (b *Buffer) Clear()
- func (b *Buffer) CurrentPos() Vec
- func (b *Buffer) Debug()
- func (b *Buffer) EndCell()
- func (b *Buffer) EndGroup()
- func (b *Buffer) EndRow()
- func (b *Buffer) HasFocus(x, y int) bool
- func (b *Buffer) IsInside(x, y, w, h int) bool
- func (b *Buffer) PopID()
- func (b *Buffer) PushID(s string)
- func (b *Buffer) Set(x, y int, c rune, style TextStyle)
- func (b *Buffer) SetFocus()
- func (b *Buffer) StartCell()
- func (b *Buffer) StartCellWithHeader(title string)
- func (b *Buffer) StartGroup()
- func (b *Buffer) StartRow()
- func (b *Buffer) String() string
- func (b *Buffer) Write(txt string, style TextStyle, inline bool)
- func (b *Buffer) WriteEx(x, y int, txt string, style TextStyle)
- type ButtonStyle
- type Color
- type DrawCommand
- type GUI
- func (g *GUI) Begin()
- func (g *GUI) BeginMenu(label string) bool
- func (g *GUI) BeginMenuBar()
- func (g *GUI) Button(text string) bool
- func (g *GUI) ButtonEx(text string, bs ButtonStyle) bool
- func (g *GUI) Checkbox(label string, active bool) bool
- func (g *GUI) Debug()
- func (g *GUI) DropDown(label string, lines []string, selected int, active bool) (int, bool)
- func (g *GUI) End() string
- func (g *GUI) EndCell()
- func (g *GUI) EndGroup()
- func (g *GUI) EndMenu()
- func (g *GUI) EndMenuBar()
- func (g *GUI) EndRow()
- func (g *GUI) Input(label, text string, active bool, size int) (string, bool)
- func (g *GUI) IntSlider(label string, min, max, value, steps int) int
- func (g *GUI) MenuItem(label string) bool
- func (g *GUI) Radio(label string, entries []string, selected int) int
- func (g *GUI) Selection(label string, lines []string, selected int) int
- func (g *GUI) SendKey(s string)
- func (g *GUI) SetMouseEvent(e tea.MouseEvent)
- func (g *GUI) SetMousePos(e tea.MouseEvent)
- func (g *GUI) StartCell()
- func (g *GUI) StartCellWithHeader(title string)
- func (g *GUI) StartGroup()
- func (g *GUI) StartRow()
- func (g *GUI) StyledText(text string, st TextStyle)
- func (g *GUI) Table(rt *table.Table)
- func (g *GUI) Text(text string)
- type Menu
- type Stack
- type Style
- type TextStyle
- type Vec
Constants ¶
View Source
const ( // Escape character ESC = '\x1b' // Control Sequence Introducer CSI = string(ESC) + "[" )
View Source
const ( BLACK = "#0c0c0c" RED = "#cc0000" GREEN = "#4e9a06" YELLOW = "#c4a000" BLUE = "#3465a4" PURPLE = "#75507b" CYAN = "#06989a" WHITE = "#d3d7cf" GRAY = "#81858d" BRIGHT_BLACK = "#555753" BRIGHT_RED = "#ef2929" BRIGHT_GREEN = "#8ae234" BRIGHT_YELLOW = "#fce94f" BRIGHT_BLUE = "#729fcf" BRIGHT_PURPLE = "#ad7fa8" BRIGHT_CYAN = "#34e2e2" BRIGHT_WHITE = "#eeeeec" BACKGROUND = "#0c0c0c" BACKGROUND_ODD = "#0d0d0d" BACKGROUND_HIGHLIGHTED = "#2a2a2a" FOREGROUND = "#eeeeec" CURSOR = "#bbbbbb" SELECTION_BACKGROUND = "#b5d5ff" )
View Source
const (
ResetSeq = "0"
)
Variables ¶
View Source
var ANSI_COLORS = []string{} /* 256 elements not displayed */
View Source
var ANSI_STYLES = []Style{}/* 256 elements not displayed */
View Source
var STYLES = []Style{ NewStyle(WHITE, BACKGROUND_HIGHLIGHTED, true), NewStyle(WHITE, "#1a1a1a", true), NewStyle(WHITE, GREEN, true), NewAnsiStyle(220, 0, true), NewStyle(WHITE, BACKGROUND_HIGHLIGHTED, true), NewStyle("#a21a1a", "", true), NewStyle("#d56f1a", "", true), NewStyle("#1a7091", "", true), NewStyle("#287114", "", true), NewStyle("#389a1d", "", true), NewAnsiStyle(238, 0, true), NewStyle(WHITE, RED, true), NewStyle(WHITE, BLUE, true), }
Functions ¶
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
func (*Buffer) CurrentPos ¶
func (*Buffer) StartCellWithHeader ¶
func (*Buffer) StartGroup ¶
func (b *Buffer) StartGroup()
type ButtonStyle ¶
type ButtonStyle int
const ( OK_BUTTON ButtonStyle = 3 CANCEL_BUTTON ButtonStyle = 12 DEFAULT_BUTTON ButtonStyle = 13 )
type DrawCommand ¶
type DrawCommand struct {
// contains filtered or unexported fields
}
type GUI ¶
type GUI struct {
// contains filtered or unexported fields
}
func (*GUI) BeginMenuBar ¶
func (g *GUI) BeginMenuBar()
func (*GUI) EndMenuBar ¶
func (g *GUI) EndMenuBar()
func (*GUI) Selection ¶
Selection writes the label with an down and up arrow and the selected text Returns the index of the selected item
func (*GUI) SetMouseEvent ¶
func (g *GUI) SetMouseEvent(e tea.MouseEvent)
func (*GUI) SetMousePos ¶
func (g *GUI) SetMousePos(e tea.MouseEvent)
func (*GUI) StartCellWithHeader ¶
func (*GUI) StartGroup ¶
func (g *GUI) StartGroup()
func (*GUI) StyledText ¶
type Style ¶
type Style struct {
// contains filtered or unexported fields
}
func NewAnsiStyle ¶
func (Style) Background ¶
type TextStyle ¶
type TextStyle int
const ( NO_STYLE TextStyle = 0 INPUT_ACTIVE_STYLE TextStyle = 1 INPUT_STYLE TextStyle = 2 OK_BUTTON_STYLE TextStyle = 3 HEADER_STYLE TextStyle = 4 ARROW_STYLE TextStyle = 5 TABLE_RED TextStyle = 6 TABLE_ORANGE TextStyle = 7 TABLE_BLUE TextStyle = 8 TABLE_GREEN TextStyle = 9 TABLE_LIGHT_GREEN TextStyle = 10 BORDER TextStyle = 11 CANCEL_BUTTON_STYLE TextStyle = 12 DEFAULT_BUTTON_STYLE TextStyle = 13 )
Click to show internal directories.
Click to hide internal directories.