Versions in this module Expand all Collapse all v0 v0.0.1 Dec 1, 2019 Changes in this version + const KeyBackspace + const KeyBackspace2 + const KeyEnter + const KeyEsc + const KeyEscape + const KeyTab + var DefaultFocusChain = &SimpleFocusChain + var DefaultTheme = &Theme + func SetLogger(l Logger) + type Alignment int + const Horizontal + const Vertical + type Box struct + func NewHBox(c ...Widget) *Box + func NewVBox(c ...Widget) *Box + func (b *Box) Alignment() Alignment + func (b *Box) Append(w Widget) + func (b *Box) Draw(p *Painter) + func (b *Box) Insert(i int, w Widget) + func (b *Box) IsFocused() bool + func (b *Box) Length() int + func (b *Box) MinSizeHint() image.Point + func (b *Box) OnKeyEvent(ev KeyEvent) + func (b *Box) Prepend(w Widget) + func (b *Box) Remove(i int) + func (b *Box) Resize(size image.Point) + func (b *Box) SetBorder(enabled bool) + func (b *Box) SetTitle(title string) + func (b *Box) SizeHint() image.Point + type Button struct + func NewButton(text string) *Button + func (b *Button) Draw(p *Painter) + func (b *Button) OnActivated(fn func(b *Button)) + func (b *Button) OnKeyEvent(ev KeyEvent) + func (b *Button) SizeHint() image.Point + type Color int32 + const ColorBlack + const ColorBlue + const ColorCyan + const ColorDefault + const ColorGreen + const ColorMagenta + const ColorRed + const ColorWhite + const ColorYellow + type Decoration int + const DecorationInherit + const DecorationOff + const DecorationOn + type EchoMode int + const EchoModeNoEcho + const EchoModeNormal + const EchoModePassword + type Entry struct + func NewEntry() *Entry + func (e *Entry) Draw(p *Painter) + func (e *Entry) OnChanged(fn func(entry *Entry)) + func (e *Entry) OnKeyEvent(ev KeyEvent) + func (e *Entry) OnSubmit(fn func(entry *Entry)) + func (e *Entry) SetEchoMode(m EchoMode) + func (e *Entry) SetText(text string) + func (e *Entry) SizeHint() image.Point + func (e *Entry) Text() string + type FocusChain interface + FocusDefault func() Widget + FocusNext func(w Widget) Widget + FocusPrev func(w Widget) Widget + type Grid struct + func NewGrid(cols, rows int) *Grid + func (g *Grid) AppendRow(row ...Widget) + func (g *Grid) Draw(p *Painter) + func (g *Grid) MinSizeHint() image.Point + func (g *Grid) OnKeyEvent(ev KeyEvent) + func (g *Grid) RemoveRow(index int) + func (g *Grid) RemoveRows() + func (g *Grid) Resize(size image.Point) + func (g *Grid) SetBorder(enabled bool) + func (g *Grid) SetCell(pos image.Point, w Widget) + func (g *Grid) SetColumnStretch(col, stretch int) + func (g *Grid) SetRowStretch(row, stretch int) + func (g *Grid) SizeHint() image.Point + type Key int16 + const KeyACK + const KeyBEL + const KeyBS + const KeyBacktab + const KeyCAN + const KeyCR + const KeyCancel + const KeyCenter + const KeyClear + const KeyCtrlA + const KeyCtrlB + const KeyCtrlBackslash + const KeyCtrlC + const KeyCtrlCarat + const KeyCtrlD + const KeyCtrlE + const KeyCtrlF + const KeyCtrlG + const KeyCtrlH + const KeyCtrlI + const KeyCtrlJ + const KeyCtrlK + const KeyCtrlL + const KeyCtrlLeftSq + const KeyCtrlM + const KeyCtrlN + const KeyCtrlO + const KeyCtrlP + const KeyCtrlQ + const KeyCtrlR + const KeyCtrlRightSq + const KeyCtrlS + const KeyCtrlSpace + const KeyCtrlT + const KeyCtrlU + const KeyCtrlUnderscore + const KeyCtrlV + const KeyCtrlW + const KeyCtrlX + const KeyCtrlY + const KeyCtrlZ + const KeyDC1 + const KeyDC2 + const KeyDC3 + const KeyDC4 + const KeyDEL + const KeyDLE + const KeyDelete + const KeyDown + const KeyDownLeft + const KeyDownRight + const KeyEM + const KeyENQ + const KeyEOT + const KeyESC + const KeyETB + const KeyETX + const KeyEnd + const KeyExit + const KeyF1 + const KeyF10 + const KeyF11 + const KeyF12 + const KeyF13 + const KeyF14 + const KeyF15 + const KeyF16 + const KeyF17 + const KeyF18 + const KeyF19 + const KeyF2 + const KeyF20 + const KeyF21 + const KeyF22 + const KeyF23 + const KeyF24 + const KeyF25 + const KeyF26 + const KeyF27 + const KeyF28 + const KeyF29 + const KeyF3 + const KeyF30 + const KeyF31 + const KeyF32 + const KeyF33 + const KeyF34 + const KeyF35 + const KeyF36 + const KeyF37 + const KeyF38 + const KeyF39 + const KeyF4 + const KeyF40 + const KeyF41 + const KeyF42 + const KeyF43 + const KeyF44 + const KeyF45 + const KeyF46 + const KeyF47 + const KeyF48 + const KeyF49 + const KeyF5 + const KeyF50 + const KeyF51 + const KeyF52 + const KeyF53 + const KeyF54 + const KeyF55 + const KeyF56 + const KeyF57 + const KeyF58 + const KeyF59 + const KeyF6 + const KeyF60 + const KeyF61 + const KeyF62 + const KeyF63 + const KeyF64 + const KeyF7 + const KeyF8 + const KeyF9 + const KeyFF + const KeyFS + const KeyGS + const KeyHelp + const KeyHome + const KeyInsert + const KeyLF + const KeyLeft + const KeyNAK + const KeyNUL + const KeyPause + const KeyPgDn + const KeyPgUp + const KeyPrint + const KeyRS + const KeyRight + const KeyRune + const KeySI + const KeySO + const KeySOH + const KeySTX + const KeySUB + const KeySYN + const KeyTAB + const KeyUS + const KeyUp + const KeyUpLeft + const KeyUpRight + const KeyVT + type KeyEvent struct + Key Key + Modifiers ModMask + Rune rune + func (ev *KeyEvent) Name() string + type Label struct + func NewLabel(text string) *Label + func (l *Label) Draw(p *Painter) + func (l *Label) MinSizeHint() image.Point + func (l *Label) Resize(size image.Point) + func (l *Label) SetStyleName(style string) + func (l *Label) SetText(text string) + func (l *Label) SetWordWrap(enabled bool) + func (l *Label) SizeHint() image.Point + func (l *Label) Text() string + type List struct + func NewList() *List + func (l *List) AddItems(items ...string) + func (l *List) Draw(p *Painter) + func (l *List) Length() int + func (l *List) OnItemActivated(fn func(*List)) + func (l *List) OnKeyEvent(ev KeyEvent) + func (l *List) OnSelectionChanged(fn func(*List)) + func (l *List) RemoveItem(i int) + func (l *List) RemoveItems() + func (l *List) Select(i int) + func (l *List) Selected() int + func (l *List) SelectedItem() string + func (l *List) SetSelected(i int) + func (l *List) SizeHint() image.Point + type Logger interface + Printf func(format string, args ...interface{}) + type ModMask int16 + const ModAlt + const ModCtrl + const ModMeta + const ModNone + const ModShift + type MouseEvent struct + Pos image.Point + type Padder struct + func NewPadder(x, y int, w Widget) *Padder + func (p *Padder) Draw(painter *Painter) + func (p *Padder) IsFocused() bool + func (p *Padder) MinSizeHint() image.Point + func (p *Padder) OnKeyEvent(ev KeyEvent) + func (p *Padder) Resize(size image.Point) + func (p *Padder) SetFocused(f bool) + func (p *Padder) Size() image.Point + func (p *Padder) SizeHint() image.Point + func (p *Padder) SizePolicy() (SizePolicy, SizePolicy) + type Painter struct + func NewPainter(s Surface, p *Theme) *Painter + func (p *Painter) Begin() + func (p *Painter) DrawCursor(x, y int) + func (p *Painter) DrawHorizontalLine(x1, x2, y int) + func (p *Painter) DrawRect(x, y, w, h int) + func (p *Painter) DrawRune(x, y int, r rune) + func (p *Painter) DrawText(x, y int, text string) + func (p *Painter) DrawVerticalLine(x, y1, y2 int) + func (p *Painter) End() + func (p *Painter) FillRect(x, y, w, h int) + func (p *Painter) Repaint(w Widget) + func (p *Painter) Restore() + func (p *Painter) SetStyle(s Style) + func (p *Painter) Translate(x, y int) + func (p *Painter) WithMask(r image.Rectangle, fn func(*Painter)) + func (p *Painter) WithStyle(n string, fn func(*Painter)) + type Progress struct + func NewProgress(max int) *Progress + func (p *Progress) Draw(painter *Painter) + func (p *Progress) MinSizeHint() image.Point + func (p *Progress) SetCurrent(c int) + func (p *Progress) SetMax(m int) + func (p *Progress) SizeHint() image.Point + type RuneBuffer struct + func (r *RuneBuffer) Backspace() + func (r *RuneBuffer) CursorPos() image.Point + func (r *RuneBuffer) Delete() + func (r *RuneBuffer) Kill() + func (r *RuneBuffer) Len() int + func (r *RuneBuffer) MoveBackward() + func (r *RuneBuffer) MoveForward() + func (r *RuneBuffer) MoveToLineEnd() + func (r *RuneBuffer) MoveToLineStart() + func (r *RuneBuffer) Pos() int + func (r *RuneBuffer) Runes() []rune + func (r *RuneBuffer) Set(buf []rune) + func (r *RuneBuffer) SetMaxWidth(w int) + func (r *RuneBuffer) SetWithIdx(idx int, buf []rune) + func (r *RuneBuffer) SplitByLine() []string + func (r *RuneBuffer) String() string + func (r *RuneBuffer) Width() int + func (r *RuneBuffer) WriteRune(s rune) + func (r *RuneBuffer) WriteRunes(s []rune) + type ScrollArea struct + Widget Widget + func NewScrollArea(w Widget) *ScrollArea + func (s *ScrollArea) Draw(p *Painter) + func (s *ScrollArea) MinSizeHint() image.Point + func (s *ScrollArea) Resize(size image.Point) + func (s *ScrollArea) Scroll(dx, dy int) + func (s *ScrollArea) ScrollToBottom() + func (s *ScrollArea) ScrollToTop() + func (s *ScrollArea) SetAutoscrollToBottom(autoscroll bool) + func (s *ScrollArea) SizeHint() image.Point + type SimpleFocusChain struct + func (c *SimpleFocusChain) FocusDefault() Widget + func (c *SimpleFocusChain) FocusNext(current Widget) Widget + func (c *SimpleFocusChain) FocusPrev(current Widget) Widget + func (c *SimpleFocusChain) Set(ws ...Widget) + type SizePolicy int + const Expanding + const Maximum + const Minimum + const Preferred + type Spacer struct + func NewSpacer() *Spacer + func (s *Spacer) MinSizeHint() image.Point + func (s *Spacer) SizeHint() image.Point + func (s *Spacer) SizePolicy() (SizePolicy, SizePolicy) + type StatusBar struct + func NewStatusBar(text string) *StatusBar + func (b *StatusBar) Draw(p *Painter) + func (b *StatusBar) SetPermanentText(text string) + func (b *StatusBar) SetText(text string) + func (b *StatusBar) SizeHint() image.Point + func (b *StatusBar) SizePolicy() (SizePolicy, SizePolicy) + type Style struct + Bg Color + Bold Decoration + Fg Color + Reverse Decoration + Underline Decoration + type Surface interface + Begin func() + End func() + HideCursor func() + SetCell func(x, y int, ch rune, s Style) + SetCursor func(x, y int) + Size func() image.Point + type Table struct + func NewTable(cols, rows int) *Table + func (t *Table) Draw(p *Painter) + func (t *Table) OnItemActivated(fn func(*Table)) + func (t *Table) OnKeyEvent(ev KeyEvent) + func (t *Table) OnSelectionChanged(fn func(*Table)) + func (t *Table) RemoveRow(index int) + func (t *Table) RemoveRows() + func (t *Table) Select(i int) + func (t *Table) Selected() int + func (t *Table) SetSelected(i int) + type TestSurface struct + func NewTestSurface(w, h int) *TestSurface + func (s *TestSurface) Begin() + func (s *TestSurface) BgColors() string + func (s *TestSurface) Decorations() string + func (s *TestSurface) End() + func (s *TestSurface) FgColors() string + func (s *TestSurface) HideCursor() + func (s *TestSurface) SetCell(x, y int, ch rune, style Style) + func (s *TestSurface) SetCursor(x, y int) + func (s *TestSurface) Size() image.Point + func (s *TestSurface) String() string + type TextEdit struct + func NewTextEdit() *TextEdit + func (e *TextEdit) Draw(p *Painter) + func (e *TextEdit) OnKeyEvent(ev KeyEvent) + func (e *TextEdit) OnTextChanged(fn func(entry *TextEdit)) + func (e *TextEdit) SetText(text string) + func (e *TextEdit) SetWordWrap(enabled bool) + func (e *TextEdit) SizeHint() image.Point + func (e *TextEdit) Text() string + type Theme struct + func NewTheme() *Theme + func (p *Theme) HasStyle(name string) bool + func (p *Theme) SetStyle(n string, i Style) + func (p *Theme) Style(name string) Style + type UI interface + ClearKeybindings func() + Quit func() + Repaint func() + Run func() error + SetFocusChain func(ch FocusChain) + SetKeybinding func(seq string, fn func()) + SetTheme func(p *Theme) + SetWidget func(w Widget) + Update func(fn func()) + func New(root Widget) (UI, error) + type Widget interface + Draw func(p *Painter) + IsFocused func() bool + MinSizeHint func() image.Point + OnKeyEvent func(ev KeyEvent) + Resize func(size image.Point) + SetFocused func(bool) + Size func() image.Point + SizeHint func() image.Point + SizePolicy func() (SizePolicy, SizePolicy) + type WidgetBase struct + func (w *WidgetBase) Draw(p *Painter) + func (w *WidgetBase) IsFocused() bool + func (w *WidgetBase) MinSizeHint() image.Point + func (w *WidgetBase) OnKeyEvent(ev KeyEvent) + func (w *WidgetBase) Resize(size image.Point) + func (w *WidgetBase) SetFocused(f bool) + func (w *WidgetBase) SetSizePolicy(h, v SizePolicy) + func (w *WidgetBase) Size() image.Point + func (w *WidgetBase) SizeHint() image.Point + func (w *WidgetBase) SizePolicy() (SizePolicy, SizePolicy)