Versions in this module Expand all Collapse all v1 v1.2.1 Jan 15, 2020 Changes in this version + const AutoSize + const ButtonBottom + const ButtonClose + const ButtonDefault + const ButtonMaximize + const ColorBack + const ColorBarChartBack + const ColorBarChartText + const ColorBlack + const ColorBlackBold + const ColorBlue + const ColorBlueBold + const ColorButtonActiveBack + const ColorButtonActiveText + const ColorButtonBack + const ColorButtonDisabledBack + const ColorButtonDisabledText + const ColorButtonShadow + const ColorButtonText + const ColorControlActiveBack + const ColorControlActiveText + const ColorControlBack + const ColorControlDisabledBack + const ColorControlDisabledText + const ColorControlShadow + const ColorControlText + const ColorCyan + const ColorCyanBold + const ColorDefault + const ColorDisabledBack + const ColorDisabledText + const ColorEditActiveBack + const ColorEditActiveText + const ColorEditBack + const ColorEditText + const ColorGreen + const ColorGreenBold + const ColorMagenta + const ColorMagentaBold + const ColorProgressActiveBack + const ColorProgressActiveText + const ColorProgressBack + const ColorProgressText + const ColorProgressTitleText + const ColorRed + const ColorRedBold + const ColorScrollBack + const ColorScrollText + const ColorSelectionBack + const ColorSelectionText + const ColorSparkChartBack + const ColorSparkChartBarBack + const ColorSparkChartBarText + const ColorSparkChartMaxBack + const ColorSparkChartMaxText + const ColorSparkChartText + const ColorTableActiveCellBack + const ColorTableActiveCellText + const ColorTableBack + const ColorTableHeaderBack + const ColorTableHeaderText + const ColorTableLineText + const ColorTableSelectedBack + const ColorTableSelectedText + const ColorTableText + const ColorText + const ColorThumbBack + const ColorThumbText + const ColorViewBack + const ColorViewText + const ColorWhite + const ColorWhiteBold + const ColorYellow + const ColorYellowBold + const DialogAlive + const DialogButton1 + const DialogButton2 + const DialogButton3 + const DialogClosed + const ElemBackColor + const ElemEndOfText + const ElemLineBreak + const ElemPrintable + const ElemTextColor + const EventActivate + const EventActivateChild + const EventChanged + const EventClick + const EventClose + const EventCloseWindow + const EventDialogClose + const EventError + const EventInterrupt + const EventKey + const EventLayout + const EventMouse + const EventMove + const EventNone + const EventQuit + const EventRaw + const EventRedraw + const EventResize + const Fixed + const Horizontal + const KeepValue + const LoginCanceled + const LoginInvalid + const LoginOk + const ObjBarChart + const ObjButton + const ObjCheckBox + const ObjDoubleBorder + const ObjEdit + const ObjProgressBar + const ObjRadio + const ObjScrollBar + const ObjSingleBorder + const ObjSparkChart + const ObjTableView + const ObjViewButtons + const Vertical + var ButtonsOK = []string + var ButtonsYesNo = []string + var ButtonsYesNoCancel = []string + func ActivateControl(parent, control Control) bool + func AlignColorizedText(str string, width int, align Align) (int, string) + func AlignText(str string, width int, align Align) (shift int, out string) + func BackColor() term.Attribute + func CalcClipper(c Control) (int, int, int, int) + func ClipRect() (x int, y int, w int, h int) + func ColorToString(attr term.Attribute) string + func ControlInRect(c Control, x int, y int, w int, h int) bool + func CurrentTheme() string + func CutText(str string, maxWidth int) string + func DeactivateControls(parent Control) + func DeinitLibrary() + func DrawFrame(x, y, w, h int, border BorderStyle) + func DrawHorizontalLine(x, y, w int, r rune) + func DrawRawText(x, y int, text string) + func DrawRawTextVertical(x, y int, text string) + func DrawScrollBar(x, y, w, h, pos int) + func DrawText(x, y int, text string) + func DrawTextVertical(x, y int, text string) + func DrawVerticalLine(x, y, h int, r rune) + func Ellipsize(str string, maxWidth int) string + func FillRect(x, y, w, h int, r rune) + func Flush() + func GetColorMap() map[string]term.Attribute + func GrabEvents(c Control) + func InClipRect(x, y int) bool + func InitLibrary() bool + func InitLogger() + func IsDeadKey(key term.Key) bool + func IsMouseClickEvent(ev Event) bool + func ItemByThumbPosition(position, itemCount, length int) int + func Logger() *log.Logger + func MainLoop() + func PopAttributes() + func PopClip() + func ProcessEvent(ev Event) + func PushAttributes() + func PushClip() + func PutChar(x, y int, r rune) bool + func PutEvent(ev Event) + func RealColor(clr term.Attribute, style string, id string) term.Attribute + func RefreshScreen() + func ReleaseEvents() + func ReloadTheme(name string) + func Reset() + func ScreenSize() (width int, height int) + func SendEventToChild(parent Control, ev Event) bool + func SetBackColor(clr term.Attribute) + func SetClipRect(x, y, w, h int) + func SetColorMap(cmap map[string]term.Attribute) + func SetCurrentTheme(name string) bool + func SetCursorPos(x int, y int) + func SetScreenSize(width int, height int) + func SetTextColor(clr term.Attribute) + func SetThemePath(path string) + func SliceColorized(str string, start, end int) string + func Stop() + func StringToColor(str string) term.Attribute + func Symbol(x, y int) (term.Cell, bool) + func SysColor(color string) term.Attribute + func SysObject(object string) string + func TextColor() term.Attribute + func TextExtent(text string) (int, int) + func ThemeNames() []string + func ThemePath() string + func ThemeReset() + func ThumbPosition(itemNo, itemCount, length int) int + func UnColorizeText(str string) string + type Align int + const AlignCenter + const AlignLeft + const AlignRight + type BarChart struct + func CreateBarChart(parent Control, w, h int, scale int) *BarChart + func (b *BarChart) AddData(val BarData) + func (b *BarChart) AutoSize() bool + func (b *BarChart) BarGap() int32 + func (b *BarChart) ClearData() + func (b *BarChart) Draw() + func (b *BarChart) LegendWidth() int32 + func (b *BarChart) MinBarWidth() int32 + func (b *BarChart) OnDrawCell(fn func(*BarDataCell)) + func (b *BarChart) SetAutoSize(auto bool) + func (b *BarChart) SetBarGap(gap int32) + func (b *BarChart) SetData(data []BarData) + func (b *BarChart) SetLegendWidth(width int32) + func (b *BarChart) SetMinBarWidth(size int32) + func (b *BarChart) SetShowMarks(show bool) + func (b *BarChart) SetShowTitles(show bool) + func (b *BarChart) SetValueWidth(width int32) + func (b *BarChart) ShowMarks() bool + func (b *BarChart) ShowTitles() bool + func (b *BarChart) ValueWidth() int32 + type BarData struct + Bg term.Attribute + Ch rune + Fg term.Attribute + Title string + Value float64 + type BarDataCell struct + BarMax float64 + Bg term.Attribute + Ch rune + Fg term.Attribute + ID int + Item string + TotalMax float64 + Value float64 + type BaseControl struct + func NewBaseControl() BaseControl + func (c *BaseControl) Active() bool + func (c *BaseControl) ActiveColors() (term.Attribute, term.Attribute) + func (c *BaseControl) AddChild(control Control) + func (c *BaseControl) Align() Align + func (c *BaseControl) BackColor() term.Attribute + func (c *BaseControl) ChildExists(control Control) bool + func (c *BaseControl) Children() []Control + func (c *BaseControl) ChildrenScale() int + func (c *BaseControl) Clipped() bool + func (c *BaseControl) Clipper() (int, int, int, int) + func (c *BaseControl) Constraints() (minw int, minh int) + func (c *BaseControl) Destroy() + func (c *BaseControl) Draw() + func (c *BaseControl) DrawChildren() + func (c *BaseControl) Enabled() bool + func (c *BaseControl) Gaps() (dx int, dy int) + func (c *BaseControl) HitTest(x, y int) HitResult + func (c *BaseControl) MinimalSize() (w int, h int) + func (c *BaseControl) Modal() bool + func (c *BaseControl) OnActive(fn func(active bool)) + func (c *BaseControl) Pack() PackType + func (c *BaseControl) Paddings() (px int, py int) + func (c *BaseControl) Parent() Control + func (c *BaseControl) PlaceChildren() + func (c *BaseControl) Pos() (x int, y int) + func (c *BaseControl) ProcessEvent(ev Event) bool + func (c *BaseControl) RefID() int64 + func (c *BaseControl) ResizeChildren() + func (c *BaseControl) Scale() int + func (c *BaseControl) SetActive(active bool) + func (c *BaseControl) SetActiveBackColor(clr term.Attribute) + func (c *BaseControl) SetActiveTextColor(clr term.Attribute) + func (c *BaseControl) SetAlign(align Align) + func (c *BaseControl) SetBackColor(clr term.Attribute) + func (c *BaseControl) SetClipped(clipped bool) + func (c *BaseControl) SetConstraints(minw, minh int) + func (c *BaseControl) SetEnabled(enabled bool) + func (c *BaseControl) SetGaps(dx, dy int) + func (c *BaseControl) SetModal(modal bool) + func (c *BaseControl) SetPack(pack PackType) + func (c *BaseControl) SetPaddings(px, py int) + func (c *BaseControl) SetParent(parent Control) + func (c *BaseControl) SetPos(x, y int) + func (c *BaseControl) SetScale(scale int) + func (c *BaseControl) SetSize(width, height int) + func (c *BaseControl) SetStyle(style string) + func (c *BaseControl) SetTabStop(tabstop bool) + func (c *BaseControl) SetTextColor(clr term.Attribute) + func (c *BaseControl) SetTitle(title string) + func (c *BaseControl) SetVisible(visible bool) + func (c *BaseControl) Size() (widht int, height int) + func (c *BaseControl) Style() string + func (c *BaseControl) TabStop() bool + func (c *BaseControl) TextColor() term.Attribute + func (c *BaseControl) Title() string + func (c *BaseControl) Visible() bool + type BorderStyle int + const BorderAuto + const BorderNone + const BorderThick + const BorderThin + type Button struct + func CreateButton(parent Control, width, height int, title string, scale int) *Button + func (b *Button) Draw() + func (b *Button) OnClick(fn func(Event)) + func (b *Button) ProcessEvent(event Event) bool + func (b *Button) SetShadowType(sh ButtonShadow) + func (b *Button) ShadowType() ButtonShadow + type ButtonShadow int + const ShadowFull + const ShadowHalf + const ShadowNone + type Canvas struct + type CheckBox struct + func CreateCheckBox(parent Control, width int, title string, scale int) *CheckBox + func (c *CheckBox) Allow3State() bool + func (c *CheckBox) Draw() + func (c *CheckBox) OnChange(fn func(int)) + func (c *CheckBox) ProcessEvent(event Event) bool + func (c *CheckBox) SetAllow3State(enable bool) + func (c *CheckBox) SetSize(width, height int) + func (c *CheckBox) SetState(val int) + func (c *CheckBox) State() int + type ColorParser struct + func NewColorParser(str string, defText, defBack term.Attribute) *ColorParser + func (p *ColorParser) NextElement() TextElement + type Column struct + Alignment Align + Bg term.Attribute + Fg term.Attribute + Sort SortOrder + Title string + Width int + type ColumnDrawInfo struct + Alignment Align + Bg term.Attribute + CellSelected bool + Col int + Fg term.Attribute + Row int + RowSelected bool + Text string + Width int + type Composer struct + func WindowManager() *Composer + func (c *Composer) BeginUpdate() + func (c *Composer) BorderStyle() BorderStyle + func (c *Composer) DestroyWindow(view Control) + func (c *Composer) EndUpdate() + func (c *Composer) SetBorder(border BorderStyle) + type ConfirmationDialog struct + View *Window + func CreateAlertDialog(title, message string, button string) *ConfirmationDialog + func CreateConfirmationDialog(title, question string, buttons []string, defaultButton int) *ConfirmationDialog + func (d *ConfirmationDialog) OnClose(fn func()) + func (d *ConfirmationDialog) Result() int + type Control interface + Active func() bool + ActiveColors func() (term.Attribute, term.Attribute) + AddChild func(control Control) + Align func() Align + BackColor func() term.Attribute + ChildExists func(control Control) bool + Children func() []Control + ChildrenScale func() int + Clipped func() bool + Clipper func() (int, int, int, int) + Constraints func() (minw int, minh int) + Destroy func() + Draw func() + DrawChildren func() + Enabled func() bool + Gaps func() (dx int, dy int) + HitTest func(x, y int) HitResult + MinimalSize func() (w int, h int) + Modal func() bool + Pack func() PackType + Paddings func() (px int, py int) + Parent func() Control + PlaceChildren func() + Pos func() (x int, y int) + ProcessEvent func(ev Event) bool + RefID func() int64 + ResizeChildren func() + Scale func() int + SetActive func(active bool) + SetActiveBackColor func(term.Attribute) + SetActiveTextColor func(term.Attribute) + SetAlign func(align Align) + SetBackColor func(clr term.Attribute) + SetClipped func(clipped bool) + SetConstraints func(minw, minh int) + SetEnabled func(enabled bool) + SetGaps func(dx, dy int) + SetModal func(modal bool) + SetPack func(pack PackType) + SetPaddings func(px, py int) + SetParent func(parent Control) + SetPos func(x, y int) + SetScale func(scale int) + SetSize func(width, height int) + SetStyle func(style string) + SetTabStop func(tabstop bool) + SetTextColor func(clr term.Attribute) + SetTitle func(title string) + SetVisible func(enabled bool) + Size func() (widht int, height int) + Style func() string + TabStop func() bool + TextColor func() term.Attribute + Title func() string + Visible func() bool + func ActiveControl(parent Control) Control + func ChildAt(parent Control, x, y int) Control + func ClippedParent(c Control) Control + func FindChild(parent, control Control) Control + func FindFirstActiveControl(parent Control) Control + func FindFirstControl(parent Control, fn func(Control) bool) Control + func FindLastControl(parent Control, fn func(Control) bool) Control + func NextControl(parent Control, curr Control, next bool) Control + type Direction int + type DragType int + const DragMove + const DragNone + const DragResizeBottom + const DragResizeBottomLeft + const DragResizeBottomRight + const DragResizeLeft + const DragResizeRight + const DragResizeTopLeft + const DragResizeTopRight + type EditField struct + func CreateEditField(parent Control, width int, text string, scale int) *EditField + func (e *EditField) Clear() + func (e *EditField) Draw() + func (e *EditField) MaxWidth() int + func (e *EditField) OnChange(fn func(Event)) + func (e *EditField) OnKeyPress(fn func(term.Key, rune) bool) + func (e *EditField) PasswordMode() bool + func (e *EditField) ProcessEvent(event Event) bool + func (e *EditField) SetMaxWidth(w int) + func (e *EditField) SetPasswordMode(pass bool) + func (e *EditField) SetSize(width, height int) + func (e *EditField) SetTitle(title string) + type Event struct + Ch rune + Err error + Height int + Key term.Key + Mod term.Modifier + Msg string + Target Control + Type EventType + Width int + X int + Y int + type EventType int + type FileSelectDialog struct + Exists bool + FilePath string + Selected bool + View *Window + func CreateFileSelectDialog(title, fileMasks, initPath string, selectDir, mustExist bool) *FileSelectDialog + func (d *FileSelectDialog) OnClose(fn func()) + type Frame struct + func CreateFrame(parent Control, width, height int, bs BorderStyle, scale int) *Frame + func (f *Frame) Draw() + func (f *Frame) ProcessEvent(ev Event) bool + func (f *Frame) ScrollTo(x int, y int) + func (f *Frame) Scrollable() bool + func (f *Frame) SetScrollable(scrollable bool) + type HitResult int + const HitBorder + const HitBottom + const HitBottomLeft + const HitBottomRight + const HitButtonBottom + const HitButtonClose + const HitButtonMaximize + const HitInside + const HitLeft + const HitOutside + const HitRight + const HitTop + const HitTopLeft + const HitTopRight + type Label struct + func CreateLabel(parent Control, w, h int, title string, scale int) *Label + func (l *Label) Direction() Direction + func (l *Label) Draw() + func (l *Label) Multiline() bool + func (l *Label) SetDirection(dir Direction) + func (l *Label) SetMultiline(multi bool) + func (l *Label) SetTextDisplay(align Align) + func (l *Label) TextDisplay() Align + type ListBox struct + func CreateListBox(parent Control, width, height int, scale int) *ListBox + func (l *ListBox) AddItem(item string) bool + func (l *ListBox) Clear() + func (l *ListBox) Draw() + func (l *ListBox) EnsureVisible() + func (l *ListBox) FindItem(text string, caseSensitive bool) int + func (l *ListBox) Item(id int) (string, bool) + func (l *ListBox) ItemCount() int + func (l *ListBox) OnKeyPress(fn func(term.Key) bool) + func (l *ListBox) OnSelectItem(fn func(Event)) + func (l *ListBox) PartialFindItem(text string, caseSensitive bool) int + func (l *ListBox) ProcessEvent(event Event) bool + func (l *ListBox) RemoveItem(id int) bool + func (l *ListBox) SelectItem(id int) bool + func (l *ListBox) SelectedItem() int + func (l *ListBox) SelectedItemText() string + type LoginDialog struct + Action int + Password string + Username string + View *Window + func CreateLoginDialog(title, userName string) *LoginDialog + func (d *LoginDialog) OnCheck(fn func(string, string) bool) + func (d *LoginDialog) OnClose(fn func()) + type PackType int + type ProgressBar struct + func CreateProgressBar(parent Control, width, height int, scale int) *ProgressBar + func (b *ProgressBar) Draw() + func (b *ProgressBar) Limits() (int, int) + func (b *ProgressBar) SecondaryColors() (term.Attribute, term.Attribute) + func (b *ProgressBar) SetLimits(min, max int) + func (b *ProgressBar) SetSecondaryColors(fg, bg term.Attribute) + func (b *ProgressBar) SetTitleColor(clr term.Attribute) + func (b *ProgressBar) SetValue(pos int) + func (b *ProgressBar) Step() int + func (b *ProgressBar) TitleColor() term.Attribute + func (b *ProgressBar) Value() int + type Radio struct + func CreateRadio(parent Control, width int, title string, scale int) *Radio + func (c *Radio) Draw() + func (c *Radio) OnChange(fn func(bool)) + func (c *Radio) ProcessEvent(event Event) bool + func (c *Radio) Selected() bool + func (c *Radio) SetGroup(group *RadioGroup) + func (c *Radio) SetSelected(val bool) + type RadioGroup struct + func CreateRadioGroup() *RadioGroup + func (c *RadioGroup) AddItem(r *Radio) + func (c *RadioGroup) SelectItem(r *Radio) bool + func (c *RadioGroup) Selected() int + func (c *RadioGroup) SetSelected(id int) bool + type SelectDialog struct + View *Window + func CreateEditDialog(title, message, initialText string) *SelectDialog + func CreateSelectDialog(title string, items []string, selectedItem int, typ SelectDialogType) *SelectDialog + func (d *SelectDialog) EditResult() string + func (d *SelectDialog) OnClose(fn func()) + func (d *SelectDialog) Result() int + func (d *SelectDialog) Value() int + type SelectDialogType uint + const SelectDialogEdit + const SelectDialogList + const SelectDialogRadio + type SortOrder int + const SortAsc + const SortDesc + const SortNone + type SparkChart struct + func CreateSparkChart(parent Control, w, h int, scale int) *SparkChart + func (b *SparkChart) AddData(val float64) + func (b *SparkChart) AutoScale() bool + func (b *SparkChart) ClearData() + func (b *SparkChart) Draw() + func (b *SparkChart) HilitePeaks() bool + func (b *SparkChart) SetAutoScale(auto bool) + func (b *SparkChart) SetData(data []float64) + func (b *SparkChart) SetHilitePeaks(hilite bool) + func (b *SparkChart) SetTop(top float64) + func (b *SparkChart) SetValueWidth(width int) + func (b *SparkChart) Top() float64 + func (b *SparkChart) ValueWidth() int + type TableAction int + const TableActionDelete + const TableActionEdit + const TableActionNew + const TableActionSort + type TableEvent struct + Action TableAction + Col int + Row int + Sort SortOrder + type TableView struct + func CreateTableView(parent Control, width, height int, scale int) *TableView + func (l *TableView) Columns() []Column + func (l *TableView) Draw() + func (l *TableView) EnsureColVisible() + func (l *TableView) EnsureRowVisible() + func (l *TableView) FullRowSelect() bool + func (l *TableView) OnAction(fn func(TableEvent)) + func (l *TableView) OnBeforeDraw(fn func(int, int, int, int)) + func (l *TableView) OnDrawCell(fn func(*ColumnDrawInfo)) + func (l *TableView) OnKeyPress(fn func(term.Key) bool) + func (l *TableView) OnSelectCell(fn func(int, int)) + func (l *TableView) ProcessEvent(event Event) bool + func (l *TableView) RowCount() int + func (l *TableView) SelectedCol() int + func (l *TableView) SelectedRow() int + func (l *TableView) SetColumnInfo(id int, col Column) + func (l *TableView) SetColumns(cols []Column) + func (l *TableView) SetFullRowSelect(fullRow bool) + func (l *TableView) SetRowCount(count int) + func (l *TableView) SetSelectedCol(col int) + func (l *TableView) SetSelectedRow(row int) + func (l *TableView) SetShowLines(show bool) + func (l *TableView) SetShowRowNumber(show bool) + func (l *TableView) ShowLines() bool + func (l *TableView) ShowRowNumber() bool + func (l *TableView) VisibleArea() (firstCol, firstRow, colCount, rowCount int) + type TextDisplay struct + func CreateTextDisplay(parent Control, width, height int, scale int) *TextDisplay + func CreateTextReader(parent Control, width, height int, scale int) *TextDisplay + func (l *TextDisplay) Draw() + func (l *TextDisplay) LineCount() int + func (l *TextDisplay) OnDrawLine(fn func(int) string) + func (l *TextDisplay) OnPositionChanged(fn func(int, int)) + func (l *TextDisplay) ProcessEvent(event Event) bool + func (l *TextDisplay) SetLineCount(lineNo int) + func (l *TextDisplay) SetTopLine(top int) + func (l *TextDisplay) TopLine() int + type TextElement struct + Bg term.Attribute + Ch rune + Fg term.Attribute + Type TextElementType + type TextElementType int + type TextReader = TextDisplay + type TextView struct + func CreateTextView(parent Control, width, height int, scale int) *TextView + func (l *TextView) AddText(text []string) + func (l *TextView) AutoScroll() bool + func (l *TextView) Draw() + func (l *TextView) ItemCount() int + func (l *TextView) LoadFile(filename string) bool + func (l *TextView) MaxItems() int + func (l *TextView) ProcessEvent(event Event) bool + func (l *TextView) SetAutoScroll(auto bool) + func (l *TextView) SetMaxItems(max int) + func (l *TextView) SetText(text []string) + func (l *TextView) SetWordWrap(wrap bool) + func (l *TextView) WordWrap() bool + type ThemeDesc struct + func ThemeInfo(name string) ThemeDesc + type ThemeManager struct + type ViewButton int + type Window struct + func AddWindow(posX, posY, width, height int, title string) *Window + func CreateWindow(x, y, w, h int, title string) *Window + func (c *Window) HitTest(x, y int) HitResult + func (c *Window) ProcessEvent(ev Event) bool + func (w *Window) Border() BorderStyle + func (w *Window) Maximized() bool + func (w *Window) Movable() bool + func (w *Window) OnClose(fn func(Event) bool) + func (w *Window) OnKeyDown(fn func(Event, interface{}) bool, data interface{}) + func (w *Window) OnScreenResize(fn func(Event)) + func (w *Window) SetBorder(border BorderStyle) + func (w *Window) SetMaximized(maximize bool) + func (w *Window) SetMovable(movable bool) + func (w *Window) SetSizable(sizable bool) + func (w *Window) SetTitleButtons(buttons ViewButton) + func (w *Window) SetVisible(visible bool) + func (w *Window) Sizable() bool + func (w *Window) TitleButtons() ViewButton + func (w *Window) Visible() bool + func (wnd *Window) Draw()