Versions in this module Expand all Collapse all v1 v1.6.8 Sep 14, 2021 v1.6.7 Sep 14, 2021 v1.6.6 Aug 22, 2021 v1.6.5 Apr 26, 2021 v1.6.4 Apr 25, 2021 v1.6.3 Feb 26, 2021 v1.6.2 Feb 20, 2021 v1.6.1 Feb 19, 2021 v1.6.0 Feb 12, 2021 Changes in this version + const BOTTOM_LEFT + const BOTTOM_RIGHT + const HDASH + const HORIZONTAL_DOWN + const HORIZONTAL_LINE + const HORIZONTAL_UP + const NumberofColors + const ORIGIN + const QUOTA_LEFT + const QUOTA_RIGHT + const TOP_LEFT + const TOP_RIGHT + const VDASH + const VERTICAL_LEFT + const VERTICAL_LINE + const VERTICAL_RIGHT + var ColorMap = map[string]Attribute + var DefaultEvtStream = NewEvtStream() + var DefaultHandler = func(e Event) + var DefaultTxBuilder = NewMarkdownTxBuilder() + func AlignArea(parent, child image.Rectangle, a Align) image.Rectangle + func CellsToStr(cs []Cell) string + func Clear() + func ClearArea(r image.Rectangle, bg Attribute) + func Close() + func GenId() string + func Handle(path string, handler func(Event)) + func Init() error + func Loop() + func Merge(name string, ec chan Event) + func MoveArea(a image.Rectangle, dx, dy int) image.Rectangle + func NewSysEvtCh() chan Event + func NewTimerCh(du time.Duration) chan Event + func Render(bs ...Bufferer) + func ResetHandlers() + func SendCustomEvt(path string, data interface{}) + func StopLoop() + func TermHeight() int + func TermRect() image.Rectangle + func TermWidth() int + func TrimStr2Runes(s string, w int) []rune + func TrimStrIfAppropriate(s string, w int) string + type Align uint + const AlignBottom + const AlignCenter + const AlignCenterHorizontal + const AlignCenterVertical + const AlignLeft + const AlignNone + const AlignRight + const AlignTop + type Attribute uint16 + const AttrBold + const AttrReverse + const AttrUnderline + const ColorBlack + const ColorBlue + const ColorCyan + const ColorDefault + const ColorGreen + const ColorMagenta + const ColorRed + const ColorUndef + const ColorWhite + const ColorYellow + func ColorRGB(r, g, b int) Attribute + func StringToAttribute(text string) Attribute + func ThemeAttr(name string) Attribute + type BarChart struct + BarColor Attribute + BarGap int + BarWidth int + CellChar rune + Data []int + DataLabels []string + NumColor Attribute + TextColor Attribute + func NewBarChart() *BarChart + func (bc *BarChart) Buffer() Buffer + func (bc *BarChart) SetMax(max int) + type Block struct + Bg Attribute + Border bool + BorderBg Attribute + BorderBottom bool + BorderFg Attribute + BorderLabel string + BorderLabelBg Attribute + BorderLabelFg Attribute + BorderLeft bool + BorderRight bool + BorderTop bool + Display bool + Float Align + Height int + PaddingBottom int + PaddingLeft int + PaddingRight int + PaddingTop int + Width int + X int + Y int + func NewBlock() *Block + func (b *Block) Align() + func (b *Block) Buffer() Buffer + func (b *Block) Handle(path string, handler func(Event)) + func (b *Block) InnerBounds() image.Rectangle + func (b *Block) SetWidth(w int) + func (b *Block) SetX(x int) + func (b *Block) SetY(y int) + func (b Block) GetHeight() int + func (b Block) Id() string + func (b Block) InnerHeight() int + func (b Block) InnerWidth() int + func (b Block) InnerX() int + func (b Block) InnerY() int + type Buffer struct + Area image.Rectangle + CellMap map[image.Point]Cell + func NewBuffer() Buffer + func NewFilledBuffer(x0, y0, x1, y1 int, ch rune, fg, bg Attribute) Buffer + func (b *Buffer) Merge(bs ...Buffer) + func (b *Buffer) SetArea(r image.Rectangle) + func (b *Buffer) Sync() + func (b Buffer) At(x, y int) Cell + func (b Buffer) Bounds() image.Rectangle + func (b Buffer) Fill(ch rune, fg, bg Attribute) + func (b Buffer) Set(x, y int, c Cell) + type Bufferer interface + Buffer func() Buffer + type Canvas map[[2]int]rune + func NewCanvas() Canvas + func (c Canvas) Buffer() Buffer + func (c Canvas) Set(x, y int) + func (c Canvas) Unset(x, y int) + type Cell struct + Bg Attribute + Ch rune + Fg Attribute + func DTrimTxCls(cs []Cell, w int) []Cell + func NewCell(ch rune, fg, bg Attribute) Cell + func TextCells(s string, fg, bg Attribute) []Cell + func TrimTxCells(cs []Cell, w int) []Cell + func (c Cell) Copy() Cell + func (c Cell) Width() int + type Event struct + Data interface{} + From string + Path string + Time int64 + To string + Type string + type EvtErr error + type EvtKbd struct + KeyStr string + type EvtMouse struct + Press string + X int + Y int + type EvtStream struct + Handlers map[string]func(Event) + func NewEvtStream() *EvtStream + func (es *EvtStream) Handle(path string, handler func(Event)) + func (es *EvtStream) Hook(f func(Event)) + func (es *EvtStream) Init() + func (es *EvtStream) Loop() + func (es *EvtStream) Merge(name string, ec chan Event) + func (es *EvtStream) ResetHandlers() + func (es *EvtStream) StopLoop() + type EvtTimer struct + Count uint64 + Duration time.Duration + type EvtWnd struct + Height int + Width int + type Gauge struct + BarColor Attribute + Label string + LabelAlign Align + Percent int + PercentColor Attribute + PercentColorHighlighted Attribute + func NewGauge() *Gauge + func (g *Gauge) Buffer() Buffer + type Grid struct + BgColor Attribute + Rows []*Row + Width int + X int + Y int + var Body *Grid + func NewGrid(rows ...*Row) *Grid + func (g *Grid) AddRows(rs ...*Row) + func (g *Grid) Align() + func (g Grid) Buffer() Buffer + type GridBufferer interface + GetHeight func() int + SetWidth func(int) + SetX func(int) + SetY func(int) + type Hline struct + Bg Attribute + Fg Attribute + Len int + X int + Y int + func (l Hline) Buffer() Buffer + type LineChart struct + AxesColor Attribute + Data []float64 + DataLabels []string + DotStyle rune + LineColor Attribute + Mode string + func NewLineChart() *LineChart + func (lc *LineChart) Buffer() Buffer + type List struct + ItemBgColor Attribute + ItemFgColor Attribute + Items []string + Overflow string + func NewList() *List + func (l *List) Buffer() Buffer + type MBarChart struct + BarColor [NumberofColors]Attribute + BarGap int + BarWidth int + Data [NumberofColors][]int + DataLabels []string + NumColor [NumberofColors]Attribute + ShowScale bool + TextColor Attribute + func NewMBarChart() *MBarChart + func (bc *MBarChart) Buffer() Buffer + func (bc *MBarChart) SetMax(max int) + type MarkdownTxBuilder struct + func (mtb MarkdownTxBuilder) Build(s string, fg, bg Attribute) []Cell + type Par struct + Text string + TextBgColor Attribute + TextFgColor Attribute + WrapLength int + func NewPar(s string) *Par + func (p *Par) Buffer() Buffer + type Row struct + Cols []*Row + Height int + Offset int + Span int + Widget GridBufferer + Width int + X int + Y int + func NewCol(span, offset int, widgets ...GridBufferer) *Row + func NewRow(cols ...*Row) *Row + func (r *Row) Buffer() Buffer + func (r *Row) SetWidth(w int) + func (r *Row) SetX(x int) + func (r *Row) SetY(y int) + func (r Row) GetHeight() int + type Sparkline struct + Data []int + Height int + LineColor Attribute + Title string + TitleColor Attribute + func NewSparkline() Sparkline + type Sparklines struct + Lines []Sparkline + func NewSparklines(ss ...Sparkline) *Sparklines + func (s *Sparklines) Add(sl Sparkline) + func (sl *Sparklines) Buffer() Buffer + type Table struct + BgColor Attribute + BgColors []Attribute + CellWidth []int + FgColor Attribute + FgColors []Attribute + Rows [][]string + Separator bool + TextAlign Align + func NewTable() *Table + func (table *Table) Analysis() [][]Cell + func (table *Table) Buffer() Buffer + func (table *Table) CalculatePosition(x int, y int, coordinateX *int, coordinateY *int, cellStart *int) + func (table *Table) SetSize() + type TextBuilder interface + Build func(s string, fg, bg Attribute) []Cell + func NewMarkdownTxBuilder() TextBuilder + type Vline struct + Bg Attribute + Fg Attribute + Len int + X int + Y int + func (l Vline) Buffer() Buffer + type WgtInfo struct + Handlers map[string]func(Event) + Id string + WgtRef Widget + func NewWgtInfo(wgt Widget) WgtInfo + type WgtMgr map[string]WgtInfo + var DefaultWgtMgr WgtMgr + func NewWgtMgr() WgtMgr + func (wm WgtMgr) AddWgt(wgt Widget) + func (wm WgtMgr) AddWgtHandler(id, path string, h func(Event)) + func (wm WgtMgr) RmWgt(wgt Widget) + func (wm WgtMgr) RmWgtById(id string) + func (wm WgtMgr) RmWgtHandler(id, path string) + func (wm WgtMgr) WgtHandlersHook() func(Event) + type Widget interface + Id func() string