Versions in this module Expand all Collapse all v0 v0.2.1 Nov 19, 2022 v0.2.0 Nov 13, 2022 Changes in this version + const AlignCenter + const AlignLeft + const AlignRight + const BoxDrawingsDoubleDownAndHorizontal + const BoxDrawingsDoubleDownAndLeft + const BoxDrawingsDoubleDownAndRight + const BoxDrawingsDoubleHorizontal + const BoxDrawingsDoubleUpAndHorizontal + const BoxDrawingsDoubleUpAndLeft + const BoxDrawingsDoubleUpAndRight + const BoxDrawingsDoubleVertical + const BoxDrawingsDoubleVerticalAndHorizontal + const BoxDrawingsDoubleVerticalAndLeft + const BoxDrawingsDoubleVerticalAndRight + const BoxDrawingsDownDoubleAndHorizontalSingle + const BoxDrawingsDownDoubleAndLeftSingle + const BoxDrawingsDownDoubleAndRightSingle + const BoxDrawingsDownHeacyAndRightUpLight + const BoxDrawingsDownHeavyAndHorizontalLight + const BoxDrawingsDownHeavyAndLeftLight + const BoxDrawingsDownHeavyAndLeftUpLight + const BoxDrawingsDownHeavyAndRightLight + const BoxDrawingsDownHeavyAndUpHorizontalLight + const BoxDrawingsDownLighAndLeftHeavy + const BoxDrawingsDownLighAndRightHeavy + const BoxDrawingsDownLightAnbdRightUpHeavy + const BoxDrawingsDownLightAndHorizontalHeavy + const BoxDrawingsDownLightAndLeftUpHeavy + const BoxDrawingsDownLightAndUpHorizontalHeavy + const BoxDrawingsDownSingleAndHorizontalDouble + const BoxDrawingsDownSingleAndLeftDouble + const BoxDrawingsDownSingleAndRightDouble + const BoxDrawingsHeavyDoubleDashHorizontal + const BoxDrawingsHeavyDoubleDashVertical + const BoxDrawingsHeavyDown + const BoxDrawingsHeavyDownAndHorizontal + const BoxDrawingsHeavyDownAndLeft + const BoxDrawingsHeavyDownAndRight + const BoxDrawingsHeavyHorizontal + const BoxDrawingsHeavyLeft + const BoxDrawingsHeavyLeftAndLightRight + const BoxDrawingsHeavyQuadrupleDashHorizontal + const BoxDrawingsHeavyQuadrupleDashVertical + const BoxDrawingsHeavyRight + const BoxDrawingsHeavyTripleDashHorizontal + const BoxDrawingsHeavyTripleDashVertical + const BoxDrawingsHeavyUp + const BoxDrawingsHeavyUpAndHorizontal + const BoxDrawingsHeavyUpAndLeft + const BoxDrawingsHeavyUpAndLightDown + const BoxDrawingsHeavyUpAndRight + const BoxDrawingsHeavyVertical + const BoxDrawingsHeavyVerticalAndHorizontal + const BoxDrawingsHeavyVerticalAndLeft + const BoxDrawingsHeavyVerticalAndRight + const BoxDrawingsLeftDownHeavyAndRightUpLight + const BoxDrawingsLeftHeavyAndRightDownLight + const BoxDrawingsLeftHeavyAndRightUpLight + const BoxDrawingsLeftHeavyAndRightVerticalLight + const BoxDrawingsLeftLightAndRightDownHeavy + const BoxDrawingsLeftLightAndRightUpHeavy + const BoxDrawingsLeftLightAndRightVerticalHeavy + const BoxDrawingsLeftUpHeavyAndRightDownLight + const BoxDrawingsLightArcDownAndLeft + const BoxDrawingsLightArcDownAndRight + const BoxDrawingsLightArcUpAndLeft + const BoxDrawingsLightArcUpAndRight + const BoxDrawingsLightDiagonalCross + const BoxDrawingsLightDiagonalUpperLeftToLowerRight + const BoxDrawingsLightDiagonalUpperRightToLowerLeft + const BoxDrawingsLightDoubleDashHorizontal + const BoxDrawingsLightDoubleDashVertical + const BoxDrawingsLightDown + const BoxDrawingsLightDownAndHorizontal + const BoxDrawingsLightDownAndLeft + const BoxDrawingsLightDownAndRight + const BoxDrawingsLightHorizontal + const BoxDrawingsLightLeft + const BoxDrawingsLightLeftAndHeavyRight + const BoxDrawingsLightQuadrupleDashHorizontal + const BoxDrawingsLightQuadrupleDashVertical + const BoxDrawingsLightRight + const BoxDrawingsLightTripleDashHorizontal + const BoxDrawingsLightTripleDashVertical + const BoxDrawingsLightUp + const BoxDrawingsLightUpAndHeavyDown + const BoxDrawingsLightUpAndHorizontal + const BoxDrawingsLightUpAndLeft + const BoxDrawingsLightUpAndRight + const BoxDrawingsLightVertical + const BoxDrawingsLightVerticalAndHorizontal + const BoxDrawingsLightVerticalAndLeft + const BoxDrawingsLightVerticalAndRight + const BoxDrawingsRightDownHeavyAndLeftUpLight + const BoxDrawingsRightHeavyAndLeftDownLight + const BoxDrawingsRightHeavyAndLeftUpLight + const BoxDrawingsRightHeavyAndLeftVerticalLight + const BoxDrawingsRightLightAndLeftDownHeavy + const BoxDrawingsRightLightAndLeftUpHeavy + const BoxDrawingsRightLightAndLeftVerticalHeavy + const BoxDrawingsRightUpHeavyAndLeftDownLight + const BoxDrawingsUpDobuleAndLeftSingle + const BoxDrawingsUpDoubleAndHorizontalSingle + const BoxDrawingsUpDoubleAndRightSingle + const BoxDrawingsUpHeavyAndDownHorizontalLight + const BoxDrawingsUpHeavyAndHorizontalLight + const BoxDrawingsUpHeavyAndLeftDownLight + const BoxDrawingsUpHeavyAndLeftLight + const BoxDrawingsUpHeavyAndRightDownLight + const BoxDrawingsUpHeavyAndRightLight + const BoxDrawingsUpLightAndDownHorizontalHeavy + const BoxDrawingsUpLightAndHorizontalHeavy + const BoxDrawingsUpLightAndLeftDownHeavy + const BoxDrawingsUpLightAndLeftHeavy + const BoxDrawingsUpLightAndRightDownHeavy + const BoxDrawingsUpLightAndRightHeavy + const BoxDrawingsUpSingleAndHorizontalDouble + const BoxDrawingsUpSingleAndLeftDouble + const BoxDrawingsUpSingleAndRightDouble + const BoxDrawingsVerticalDoubleAndHorizontalSingle + const BoxDrawingsVerticalDoubleAndLeftSingle + const BoxDrawingsVerticalDoubleAndRightSingle + const BoxDrawingsVerticalHeavyAndHorizontalLight + const BoxDrawingsVerticalHeavyAndRightLight + const BoxDrawingsVerticalLightAndHorizontalHeavy + const BoxDrawingsVerticalLightAndLeftHeavy + const BoxDrawingsVerticalLightAndRightHeavy + const BoxDrawingsVerticalSingleAndHorizontalDouble + const BoxDrawingsVerticalSingleAndLeftDouble + const BoxDrawingsVerticalSingleAndRightDouble + const BoxDrawingsVerticalheavyAndLeftLight + const SemigraphicsHorizontalEllipsis + var Backspace1RemovesWord = true + var Backspace2RemovesWord = false + var Blocks = [9]rune + var Borders = struct{ ... } + var InputFieldFloat func(text string, ch rune) bool + var InputFieldInteger func(text string, ch rune) bool + var InputFieldMaxLength func(maxLength int) func(text string, ch rune) bool + var SemigraphicJoints = map[string]rune + var Styles = struct{ ... } + var TabSize = 4 + func Escape(text string) string + func OffsetMouseEvent(evt MouseEvent, offsetX, offsetY int) *proxyEventMouse + func Print(screen Screen, text string, x, y, maxWidth, align int, color tcell.Color) (int, int) + func PrintJoinedSemigraphics(screen tcell.Screen, x, y int, ch rune, color tcell.Color) + func PrintSimple(screen Screen, text string, x, y int) + func PrintWithStyle(screen Screen, text string, x, y, maxWidth, align int, style tcell.Style) (int, int) + func SubstringBefore(s string, w int) string + func TaggedStringWidth(text string) int + func WordWrap(text string, width int) (lines []string) + type Application struct + func NewApplication() *Application + func (app *Application) ForceStop() + func (app *Application) Redraw() + func (app *Application) Screen() tcell.Screen + func (app *Application) SetAlwaysClear(always bool) + func (app *Application) SetRedrawTicker(tick time.Duration) + func (app *Application) SetRoot(view Component) + func (app *Application) Start() error + func (app *Application) Stop() + func (app *Application) Suspend(wait func()) + type Box struct + func NewBox(inner Component) *Box + func (box *Box) Blur() + func (box *Box) Draw(screen Screen) + func (box *Box) Focus() + func (box *Box) OnKeyEvent(event KeyEvent) bool + func (box *Box) OnMouseEvent(event MouseEvent) bool + func (box *Box) OnPasteEvent(event PasteEvent) bool + func (box *Box) SetBackgroundColor(color tcell.Color) *Box + func (box *Box) SetBlurCaptureFunc(blurCapture func() bool) *Box + func (box *Box) SetBorder(border bool) *Box + func (box *Box) SetBorderStyle(borderStyle tcell.Style) *Box + func (box *Box) SetFocusCaptureFunc(focusCapture func() bool) *Box + func (box *Box) SetInnerComponent(component Component) *Box + func (box *Box) SetKeyCaptureFunc(keyCapture KeyCaptureFunc) *Box + func (box *Box) SetMouseCaptureFunc(mouseCapture MouseCaptureFunc) *Box + func (box *Box) SetPasteCaptureFunc(pasteCapture PasteCaptureFunc) *Box + func (box *Box) SetTitle(title string) *Box + type Button struct + func NewButton(text string) *Button + func (b *Button) Blur() + func (b *Button) Draw(screen Screen) + func (b *Button) Focus() + func (b *Button) OnKeyEvent(event KeyEvent) bool + func (b *Button) OnMouseEvent(event MouseEvent) bool + func (b *Button) OnPasteEvent(event PasteEvent) bool + func (b *Button) SetBackgroundColor(color tcell.Color) *Button + func (b *Button) SetFocusedBackgroundColor(color tcell.Color) *Button + func (b *Button) SetFocusedForegroundColor(color tcell.Color) *Button + func (b *Button) SetFocusedStyle(style tcell.Style) *Button + func (b *Button) SetForegroundColor(color tcell.Color) *Button + func (b *Button) SetOnClick(fn func()) *Button + func (b *Button) SetStyle(style tcell.Style) *Button + func (b *Button) SetText(text string) *Button + func (b *Button) Submit(event KeyEvent) bool + type Centerer struct + func Center(target Component, width, height int) *Centerer + func (center *Centerer) Blur() + func (center *Centerer) Draw(screen Screen) + func (center *Centerer) Focus() + func (center *Centerer) OnKeyEvent(evt KeyEvent) bool + func (center *Centerer) OnMouseEvent(evt MouseEvent) bool + func (center *Centerer) OnPasteEvent(evt PasteEvent) bool + func (center *Centerer) SetAlwaysFocusChild(always bool) *Centerer + func (center *Centerer) SetHeight(height int) + func (center *Centerer) SetSize(width, height int) + func (center *Centerer) SetWidth(width int) + type Component interface + Draw func(screen Screen) + OnKeyEvent func(event KeyEvent) bool + OnMouseEvent func(event MouseEvent) bool + OnPasteEvent func(event PasteEvent) bool + type Flex struct + func NewFlex() *Flex + func (flex *Flex) AddFixedComponent(comp Component, size int) *Flex + func (flex *Flex) AddProportionalComponent(comp Component, size int) *Flex + func (flex *Flex) Blur() + func (flex *Flex) Draw(screen Screen) + func (flex *Flex) Focus() + func (flex *Flex) OnKeyEvent(event KeyEvent) bool + func (flex *Flex) OnMouseEvent(event MouseEvent) bool + func (flex *Flex) OnPasteEvent(event PasteEvent) bool + func (flex *Flex) RemoveComponent(comp Component) *Flex + func (flex *Flex) SetDirection(direction FlexDirection) *Flex + func (flex *Flex) SetFocused(comp Component) + type FlexDirection int + const FlexColumn + const FlexRow + type Focusable interface + Blur func() + Focus func() + type FocusableComponent interface + type Form struct + func NewForm() *Form + func (form *Form) AddFormItem(comp Component, x, y, width, height int) *Form + func (form *Form) Draw(screen Screen) + func (form *Form) FocusNextItem() + func (form *Form) FocusPreviousItem() + func (form *Form) OnKeyEvent(event KeyEvent) bool + func (form *Form) RemoveFormItem(comp Component) *Form + func (form *Form) SetOnFocusChanged(fn func(from, to Component)) *Form + type FormItem interface + Submit func(event KeyEvent) bool + type FractionalCenterer struct + func FractionalCenter(target Component, minWidth, minHeight int, ...) *FractionalCenterer + func (fc *FractionalCenterer) Blur() + func (fc *FractionalCenterer) Draw(screen Screen) + func (fc *FractionalCenterer) Focus() + func (fc *FractionalCenterer) OnKeyEvent(evt KeyEvent) bool + func (fc *FractionalCenterer) OnMouseEvent(evt MouseEvent) bool + func (fc *FractionalCenterer) OnPasteEvent(evt PasteEvent) bool + func (fc *FractionalCenterer) SetAlwaysFocusChild(always bool) *FractionalCenterer + type Grid struct + func NewGrid() *Grid + func (grid *Grid) AddComponent(comp Component, x, y, width, height int) *Grid + func (grid *Grid) Blur() + func (grid *Grid) Draw(screen Screen) + func (grid *Grid) Focus() + func (grid *Grid) OnKeyEvent(event KeyEvent) bool + func (grid *Grid) OnMouseEvent(event MouseEvent) bool + func (grid *Grid) OnPasteEvent(event PasteEvent) bool + func (grid *Grid) OnResize(width, height int) + func (grid *Grid) RemoveComponent(comp Component) *Grid + func (grid *Grid) SetColumn(col, width int) *Grid + func (grid *Grid) SetColumns(columns []int) *Grid + func (grid *Grid) SetRow(row, height int) *Grid + func (grid *Grid) SetRows(rows []int) *Grid + type InputArea struct + func NewInputArea() *InputArea + func (field *InputArea) Blur() + func (field *InputArea) Clear() + func (field *InputArea) ClearSelection() + func (field *InputArea) Copy() + func (field *InputArea) Cut() + func (field *InputArea) Draw(screen Screen) + func (field *InputArea) ExtendSelection(x, y int) + func (field *InputArea) Focus() + func (field *InputArea) GetCursorOffset() int + func (field *InputArea) GetCursorPos() (int, int) + func (field *InputArea) GetSelectedText() string + func (field *InputArea) GetSelection() (int, int) + func (field *InputArea) GetText() string + func (field *InputArea) GetTextHeight() int + func (field *InputArea) MoveCursorDown(extendSelection bool) + func (field *InputArea) MoveCursorEnd(extendSelection bool) + func (field *InputArea) MoveCursorHome(extendSelection bool) + func (field *InputArea) MoveCursorLeft(moveWord, extendSelection bool) + func (field *InputArea) MoveCursorRight(moveWord, extendSelection bool) + func (field *InputArea) MoveCursorUp(extendSelection bool) + func (field *InputArea) OnKeyEvent(event KeyEvent) bool + func (field *InputArea) OnMouseEvent(event MouseEvent) bool + func (field *InputArea) OnPasteEvent(event PasteEvent) bool + func (field *InputArea) Paste() + func (field *InputArea) PrepareDraw(width int) + func (field *InputArea) Redo() + func (field *InputArea) RemoveNextCharacter() + func (field *InputArea) RemovePreviousCharacter() + func (field *InputArea) RemovePreviousWord() + func (field *InputArea) RemoveSelection() + func (field *InputArea) SelectAll() + func (field *InputArea) SetBackgroundColor(color tcell.Color) *InputArea + func (field *InputArea) SetChangedFunc(handler func(text string)) *InputArea + func (field *InputArea) SetCursorOffset(offset int) + func (field *InputArea) SetCursorPos(x, y int) + func (field *InputArea) SetPlaceholder(text string) *InputArea + func (field *InputArea) SetPlaceholderTextColor(color tcell.Color) *InputArea + func (field *InputArea) SetPressKeyDownAtEndFunc(handler func()) *InputArea + func (field *InputArea) SetPressKeyUpAtStartFunc(handler func()) *InputArea + func (field *InputArea) SetSelection(start, end int) + func (field *InputArea) SetTabCompleteFunc(handler func(text string, cursorOffset int)) *InputArea + func (field *InputArea) SetText(text string) *InputArea + func (field *InputArea) SetTextAndMoveCursor(text string) *InputArea + func (field *InputArea) SetTextColor(color tcell.Color) *InputArea + func (field *InputArea) TypeRune(ch rune) + func (field *InputArea) Undo() + type InputField struct + func NewInputField() *InputField + func (field *InputField) Blur() + func (field *InputField) Clear() + func (field *InputField) Draw(screen Screen) + func (field *InputField) Focus() + func (field *InputField) GetCursorOffset() int + func (field *InputField) GetText() string + func (field *InputField) MoveCursorLeft(moveWord bool) + func (field *InputField) MoveCursorRight(moveWord bool) + func (field *InputField) OnKeyEvent(event KeyEvent) bool + func (field *InputField) OnMouseEvent(event MouseEvent) bool + func (field *InputField) OnPasteEvent(event PasteEvent) bool + func (field *InputField) RemoveNextCharacter() + func (field *InputField) RemovePreviousCharacter() + func (field *InputField) RemovePreviousWord() + func (field *InputField) SetBackgroundColor(color tcell.Color) *InputField + func (field *InputField) SetChangedFunc(handler func(text string)) *InputField + func (field *InputField) SetCursorOffset(offset int) *InputField + func (field *InputField) SetMaskCharacter(mask rune) *InputField + func (field *InputField) SetPlaceholder(text string) *InputField + func (field *InputField) SetPlaceholderTextColor(color tcell.Color) *InputField + func (field *InputField) SetTabCompleteFunc(handler func(text string, cursorOffset int)) *InputField + func (field *InputField) SetText(text string) *InputField + func (field *InputField) SetTextAndMoveCursor(text string) *InputField + func (field *InputField) SetTextColor(color tcell.Color) *InputField + func (field *InputField) Submit(event KeyEvent) bool + func (field *InputField) TypeRune(ch rune) + type KeyCaptureFunc func(event KeyEvent) KeyEvent + type KeyEvent interface + Key func() tcell.Key + Modifiers func() tcell.ModMask + Rune func() rune + type MouseCaptureFunc func(event MouseEvent) MouseEvent + type MouseEvent interface + Buttons func() tcell.ButtonMask + HasMotion func() bool + Modifiers func() tcell.ModMask + Position func() (int, int) + type NoopEventHandler struct + func (neh NoopEventHandler) OnKeyEvent(event KeyEvent) bool + func (neh NoopEventHandler) OnMouseEvent(event MouseEvent) bool + func (neh NoopEventHandler) OnPasteEvent(event PasteEvent) bool + type PasteCaptureFunc func(event PasteEvent) PasteEvent + type PasteEvent interface + Text func() string + type ProgressBar struct + func NewProgressBar() *ProgressBar + func (pb *ProgressBar) Draw(screen Screen) + func (pb *ProgressBar) Increment(increment int) *ProgressBar + func (pb *ProgressBar) SetIndeterminate(indeterminate bool) *ProgressBar + func (pb *ProgressBar) SetMax(max int) *ProgressBar + func (pb *ProgressBar) SetProgress(progress int) *ProgressBar + type ProxyScreen struct + Height int + OffsetX int + OffsetY int + Parent Screen + Style tcell.Style + Width int + func (ss *ProxyScreen) CanDisplay(r rune, checkFallbacks bool) bool + func (ss *ProxyScreen) CharacterSet() string + func (ss *ProxyScreen) Clear() + func (ss *ProxyScreen) Colors() int + func (ss *ProxyScreen) Fill(r rune, style tcell.Style) + func (ss *ProxyScreen) GetContent(x, y int) (mainc rune, combc []rune, style tcell.Style, width int) + func (ss *ProxyScreen) HasKey(key tcell.Key) bool + func (ss *ProxyScreen) HideCursor() + func (ss *ProxyScreen) IsInArea(x, y int) bool + func (ss *ProxyScreen) OffsetMouseEvent(event MouseEvent) MouseEvent + func (ss *ProxyScreen) SetCell(x, y int, style tcell.Style, ch ...rune) + func (ss *ProxyScreen) SetContent(x int, y int, mainc rune, combc []rune, style tcell.Style) + func (ss *ProxyScreen) SetStyle(style tcell.Style) + func (ss *ProxyScreen) ShowCursor(x, y int) + func (ss *ProxyScreen) Size() (width int, height int) + func (ss *ProxyScreen) XEnd() int + func (ss *ProxyScreen) YEnd() int + type Screen interface + CanDisplay func(r rune, checkFallbacks bool) bool + CharacterSet func() string + Clear func() + Colors func() int + Fill func(rune, tcell.Style) + GetContent func(x, y int) (mainc rune, combc []rune, style tcell.Style, width int) + HasKey func(tcell.Key) bool + HideCursor func() + SetCell func(x, y int, style tcell.Style, ch ...rune) + SetContent func(x int, y int, mainc rune, combc []rune, style tcell.Style) + SetStyle func(style tcell.Style) + ShowCursor func(x int, y int) + Size func() (int, int) + func NewProxyScreen(parent Screen, offsetX, offsetY, width, height int) Screen + type SimpleEventHandler struct + OnKey func(event KeyEvent) bool + OnMouse func(event MouseEvent) bool + OnPaste func(event PasteEvent) bool + func (seh *SimpleEventHandler) OnKeyEvent(event KeyEvent) bool + func (seh *SimpleEventHandler) OnMouseEvent(event MouseEvent) bool + func (seh *SimpleEventHandler) OnPasteEvent(event PasteEvent) bool + type TextField struct + func NewTextField() *TextField + func (tf *TextField) Draw(screen Screen) + func (tf *TextField) SetBackgroundColor(color tcell.Color) *TextField + func (tf *TextField) SetStyle(style tcell.Style) *TextField + func (tf *TextField) SetText(text string) *TextField + func (tf *TextField) SetTextColor(color tcell.Color) *TextField + type TextView struct + func NewTextView() *TextView + func (t *TextView) Clear() *TextView + func (t *TextView) Draw(screen Screen) + func (t *TextView) GetHighlights() (regionIDs []string) + func (t *TextView) GetRegionText(regionID string) string + func (t *TextView) GetScrollOffset() (row, column int) + func (t *TextView) Highlight(regionIDs ...string) *TextView + func (t *TextView) OnKeyEvent(event KeyEvent) bool + func (t *TextView) OnMouseEvent(event MouseEvent) bool + func (t *TextView) OnPasteEvent(event PasteEvent) bool + func (t *TextView) ScrollTo(row, column int) *TextView + func (t *TextView) ScrollToBeginning() *TextView + func (t *TextView) ScrollToEnd() *TextView + func (t *TextView) ScrollToHighlight() *TextView + func (t *TextView) SetBackgroundColor(color tcell.Color) *TextView + func (t *TextView) SetChangedFunc(handler func()) *TextView + func (t *TextView) SetDoneFunc(handler func(key tcell.Key)) *TextView + func (t *TextView) SetDynamicColors(dynamic bool) *TextView + func (t *TextView) SetRegions(regions bool) *TextView + func (t *TextView) SetScrollable(scrollable bool) *TextView + func (t *TextView) SetText(text string) *TextView + func (t *TextView) SetTextAlign(align int) *TextView + func (t *TextView) SetTextColor(color tcell.Color) *TextView + func (t *TextView) SetWordWrap(wrapOnWords bool) *TextView + func (t *TextView) SetWrap(wrap bool) *TextView + func (t *TextView) Submit(event KeyEvent) bool + func (t *TextView) Write(p []byte) (n int, err error)