Documentation
¶
Overview ¶
Библитека TUI для Go
Библитека TUI для Go ¶
Библитека TUI для Go ¶
Библитека TUI для Go ¶
Библитека TUI для Go
Index ¶
- func EnableANSI()
- type App
- type Button
- type Color
- type ColorProgress
- type Component
- type DisplayMode
- type Label
- func (lbl *Label) Blink() *Label
- func (lbl *Label) Bold() *Label
- func (lbl *Label) ColorizeBackground(clr Color) *Label
- func (lbl *Label) ColorizeBackgroundRGB(r, g, b uint8) *Label
- func (lbl *Label) ColorizeForeground(clr Color) *Label
- func (lbl *Label) ColorizeForegroundRGB(r, g, b uint8) *Label
- func (lbl *Label) DisplayMode() DisplayMode
- func (lbl *Label) Italic() *Label
- func (lbl *Label) MaxWidth() int
- func (lbl *Label) Reverse() *Label
- func (lbl *Label) Underline() *Label
- type Window
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App interface {
Components() []Component
Redraw()
RedrawComponent(int)
AddComponents(...Component)
Clear()
Run()
Quit()
OnQuit() <-chan struct{}
Window() Window
AddKeyHandler(key keyboard.Key, h func())
LogInfo(message string, args ...any)
LogFatal(message string, args ...any)
}
Объект приложения
type Button ¶
type Button struct {
OnClick func()
Component
// contains filtered or unexported fields
}
Объект кнопки, нажимающейся от нажатия её клавиши. Обработчик в OnClick.
type ColorProgress ¶ added in v1.2.1
type ColorProgress struct {
// contains filtered or unexported fields
}
func NewColorProgress ¶ added in v1.2.1
func NewColorProgress(len int, on, off Color) *ColorProgress
func (*ColorProgress) DisplayMode ¶ added in v1.2.1
func (p *ColorProgress) DisplayMode() DisplayMode
func (*ColorProgress) MaxWidth ¶ added in v1.2.1
func (p *ColorProgress) MaxWidth() int
func (*ColorProgress) SetValue ¶ added in v1.2.1
func (p *ColorProgress) SetValue(f float64)
type Component ¶
type Component interface {
MaxWidth() int
DisplayMode() DisplayMode
// contains filtered or unexported methods
}
Объект компонента приложения.
type DisplayMode ¶
type DisplayMode int
const ( DisplayInline DisplayMode = iota // В одну строку DisplayBlock // На отдельной строке DisplayNewLine // Перенос строки )
type Label ¶
Текст. Может быть декорирован
func NewDynamicLabel ¶
Создание объекта текста с возможностью изменения содержимого в будущем. maxLength это место, зарезервированное под метку в символах.
func NewStaticLabel ¶
Создание объекта текста без возможности изменения.
func (*Label) Blink ¶ added in v1.1.0
Сделать текст мигающим(работает не во всем терминалах). Добавлено в TUI v1.1.0
func (*Label) ColorizeBackground ¶ added in v1.1.0
Окрасить фон текста в один из стандартных цветов. Добавлено в TUI v1.1.0
func (*Label) ColorizeBackgroundRGB ¶ added in v1.1.0
Окрасить фон текста в RGB. Добавлено в TUI v1.1.0
func (*Label) ColorizeForeground ¶ added in v1.1.0
Окрасить текст в один из стандартных цветов. Добавлено в TUI v1.1.0
func (*Label) ColorizeForegroundRGB ¶ added in v1.1.0
Окрасить текст в RGB. Добавлено в TUI v1.1.0