tui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 7 Imported by: 0

README

TUI

Main tui building logic is located here

logo.go

Helps with logo building

TUI.go

Some fuctions for building tui

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildNumber

func BuildNumber(curLine int, n int, maxOffset int, rln bool) string

func BuildSpaces

func BuildSpaces(maxOffset int) string

func Colorise

func Colorise(data string, c ascii.Color) string

func VisibleSubString

func VisibleSubString(text string, start int, end int) string

* So here is where I build the actual line, including the ASCII escape sequences * If I just use line.data[start:end], I'll get something like this: * * 033[0m and some text * * Here I just ignore the escape sequences and don't count them, so I can use them

Types

type TUI

type TUI struct {
	XScroll   int
	YScroll   int
	CurRow    int
	CurOff    int
	W, H      int
	Save      bool
	ShowHello bool // show ascii art in empty Bard
	Message   string
	Hello     [][]rune // ascii art in empty Bard

	Redraw chan bool
	// contains filtered or unexported fields
}

func InitTUI

func InitTUI(h int, w int) *TUI

func (*TUI) BuidASCII

func (tui *TUI) BuidASCII()

func (*TUI) BuildCommandBar

func (ui *TUI) BuildCommandBar(curdata string) string

func (*TUI) BuildLine

func (ui *TUI) BuildLine(str []rune, show bool, start, end int, i int) string

func (*TUI) BuildLowerBar

func (ui *TUI) BuildLowerBar(x int, y int, curdata string, message string, cmd string) string

func (*TUI) BuildTabs

func (ui *TUI) BuildTabs(tabs []string, curTab int, show bool) string

func (*TUI) Center

func (ui *TUI) Center(l []rune) string

func (*TUI) GetASCIIInfo

func (tui *TUI) GetASCIIInfo(index int) []rune

func (*TUI) TermSizeMonitor

func (tui *TUI) TermSizeMonitor(fdOut int)

This function is called in the main.go file in a goroutine. Here I just recalculate the terminal size and adjust Bard to it

Jump to

Keyboard shortcuts

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