ui

package
v0.0.0-...-ee607de Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

View Source
const (
	BLACK ansiColor = iota
	RED
	GREEN
	YELLOW
	BLUE
	MAGENTA
	CYAN
	WHITE
)

Variables

View Source
var Input = false
View Source
var WindowStore = []*Window{}

Functions

func Bg

func Bg(s string, c ansiColor) string

func ClearScreen

func ClearScreen()

func ClosePopup

func ClosePopup()

func Fg

func Fg(s string, c ansiColor) string

func GetCurrentFocus

func GetCurrentFocus() (int, error)

TODO: remove this (for debug)

func HideCursor

func HideCursor()

func LoadAlternateScreen

func LoadAlternateScreen()

func MoveCursorTo

func MoveCursorTo(x, y int)

x: vertical, y: horizontal

func NextItem

func NextItem()

func NextPage

func NextPage()

func OpenPopup

func OpenPopup(title string, tw, th int, f func(line string)) string

func OpenPopupSelect

func OpenPopupSelect(tw, th int)

func PrevItem

func PrevItem()

func PrevPage

func PrevPage()

func Print

func Print(v ...interface{})

prints everything and append carriage return

func Println

func Println(v ...interface{})

prints everything and append carriage return and newline

func ReloadAll

func ReloadAll()

func RotateFocus

func RotateFocus()

func ScrollHalfDown

func ScrollHalfDown()

func ScrollHalfUp

func ScrollHalfUp()

func ScrollLeft

func ScrollLeft()

func ScrollRight

func ScrollRight()

func Select

func Select()

func SetBg

func SetBg(c ansiColor)

func SetFg

func SetFg(c ansiColor)

func ShowCursor

func ShowCursor()

func ShowKeyBindings

func ShowKeyBindings()

func UnloadAlternateScreen

func UnloadAlternateScreen()

Types

type Window

type Window struct {
	Meta *WindowMeta /* window metadata */
	// contains filtered or unexported fields
}
var LensWindow *Window
var PopupWindow *Window

func NewRoundWindow

func NewRoundWindow(x, y, h, w int) *Window

func NewWindow

func NewWindow(x, y, h, w int) *Window

x: vertical coordinate of window top-left point y: horizontal coordinate of window top-left point h: window's vertical length (including frame) w: window's horizontal length (including frame)

func (*Window) Append

func (w *Window) Append(line string) *Window

func (*Window) Clear

func (w *Window) Clear()

func (*Window) ClearWithFrame

func (w *Window) ClearWithFrame()

func (*Window) Close

func (w *Window) Close()

func (*Window) Content

func (w *Window) Content(content []string) *Window

func (*Window) Disable

func (w *Window) Disable() *Window

func (*Window) Enable

func (w *Window) Enable() *Window

func (*Window) Fill

func (w *Window) Fill()

func (*Window) Focus

func (w *Window) Focus() *Window

func (*Window) OnSelect

func (w *Window) OnSelect(fns []func()) *Window

func (*Window) Relocate

func (w *Window) Relocate(x, y int) *Window

func (*Window) Render

func (w *Window) Render()

func (*Window) Resize

func (w *Window) Resize(height, width int) *Window

func (*Window) Title

func (w *Window) Title(title string) *Window

type WindowMeta

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

WindowMeta includes information about window manipulation

Jump to

Keyboard shortcuts

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