Documentation ¶
Index ¶
Constants ¶
View Source
const ( HAlignStart = byte(iota) HAlignCenter HAlignEnd VAlignStart VAlignCenter VAlignEnd )
Variables ¶
View Source
var BoardHeight = len(boardOutline)
BoardHeight is height of BoardOutline
View Source
var BoardWidth = len(boardOutline[0])
BoardWidth is width of BoardOutline
Functions ¶
This section is empty.
Types ¶
type BoardWidget ¶
BoardWidget is an ui widget for sudoku board representation
func (*BoardWidget) Draw ¶
func (bw *BoardWidget) Draw(context Context, x, y int)
Draw draws the board widget to the terminal
func (*BoardWidget) Height ¶
func (bw *BoardWidget) Height() int
Height returns the height of the board widget
func (*BoardWidget) Width ¶
func (bw *BoardWidget) Width() int
Width returns the width of the board widget
type BoxWidget ¶
type BoxWidget struct { Child Widget HAlign byte MinWidth int MinHeight int PaddingTop int PaddingBottom int PaddingLeft int PaddingRight int Fill bool Color theme.ColorPair }
BoxWidget is an simple ui wrapper for other widgets
type Client ¶
type Client interface { // Start starts the client Start() error // Stop stops the client Stop() // Size returns width and height of client screen Size() (int, int) // OnResize takes a function to run when the screen resized OnResize(func(width, height int)) // OnKeyPress takes a function to run when a key pressed OnKeyPress(func(key string)) // Draw draws the given widget at the given position Draw(x, y int, widget Widget) // Draw draws the given widget at the center of the screen DrawCenter(widget Widget) // Draw draws the given widget at the up right corner of the screen DrawAligned(widget Widget, alignments ...byte) // Context returns context to manipulate the screen Context() Context }
func NewTCellClient ¶
type Context ¶
type Context interface { // StyleFG sets the current foreground color StyleFG(color string) // StyleBG sets the current background color StyleBG(color string) // SetContent draws the given char to the given position // with the current style SetContent(x, y int, char rune) // Show makes all content changes visible Show() // Clear clears the screen Clear() }
type MenuWidget ¶
type MenuWidget struct { Options []string CursorIndex int HAlign byte MinWidth int Color theme.ColorPair Cursor theme.ColorPair // contains filtered or unexported fields }
MenuWidget is an ui widget for menu representations
func (*MenuWidget) Draw ¶
func (mw *MenuWidget) Draw(context Context, x, y int)
Draw draws the menu widget to the terminal
func (*MenuWidget) Height ¶
func (mw *MenuWidget) Height() int
Height returns the height of the menu widget
func (*MenuWidget) Width ¶
func (mw *MenuWidget) Width() int
Width returns the width of the menu widget
type TextWidget ¶
type TextWidget struct { String string AlignCenter bool AlignRight bool Color theme.ColorPair // contains filtered or unexported fields }
TextWidget is an ui widget for texts
func (*TextWidget) Draw ¶
func (tw *TextWidget) Draw(context Context, x, y int)
Draw draws the text to the terminal
func (*TextWidget) Width ¶
func (tw *TextWidget) Width() int
Width returns the width of the longest text line
Click to show internal directories.
Click to hide internal directories.