Documentation
¶
Index ¶
- Constants
- Variables
- func Close()
- func HandleEvent(ev IEvent)
- func Init() error
- type IAction
- type IEvent
- type TAbstractAction
- type TAction
- type TAlignment
- type TBorder
- type TColor
- type TEvent
- type TEventHandler
- type TEventStream
- type TKeyboardAction
- type TKeyboardEvent
- type TKeyboardHandler
- type TMouseEvent
- type TScreen
- func (scr *TScreen) BgColor() TColor
- func (scr *TScreen) Clear(ch rune, fg, bg TColor)
- func (scr *TScreen) Close()
- func (scr *TScreen) DrawAlignedString(x, y, w int, str string)
- func (scr *TScreen) DrawBorder(x, y, w, h int)
- func (scr *TScreen) DrawRune(x, y int, ch rune)
- func (scr *TScreen) DrawString(x, y int, str string)
- func (scr *TScreen) EnableShadow(mode bool)
- func (scr *TScreen) FgColor() TColor
- func (scr *TScreen) FillRect(x, y, w, h int, ch rune)
- func (scr *TScreen) Flush()
- func (scr *TScreen) Height() int
- func (scr *TScreen) InvertColor()
- func (scr *TScreen) MoveCursor(x, y int)
- func (scr *TScreen) SelectBorder(name string)
- func (scr *TScreen) SetAlignment(alignment TAlignment)
- func (scr *TScreen) SetBgColor(bg TColor)
- func (scr *TScreen) SetCellColor(x, y int, fg, bg TColor)
- func (scr *TScreen) SetColor(fg, bg TColor)
- func (scr *TScreen) SetFgColor(fg TColor)
- func (scr *TScreen) ShowCursor(enable bool)
- func (scr *TScreen) Width() int
- type TWindowEvent
Constants ¶
View Source
const ( KeyEscape = 27 KeyEsc = KeyEscape KeyDown = 65516 KeyUp = 65517 KeyLeft = 65515 KeyRight = 65514 KeyHome = 65521 KeyEnd = 65520 KeyPageUp = 65519 KeyPgUp = KeyPageUp KeyPageDown = 65518 KeyPgDn = KeyPageDown )
KeyEscape -
View Source
const ( AlignLeft = TAlignment(iota) AlignRight AlignCenter )
AlignLeft -
Variables ¶
View Source
var ( ColorDefault = TColor{int32(termbox.ColorDefault)} ColorBlack = TColor{int32(termbox.ColorBlack)} ColorRed = TColor{int32(termbox.ColorRed)} ColorGreen = TColor{int32(termbox.ColorGreen)} ColorYellow = TColor{int32(termbox.ColorYellow)} ColorBlue = TColor{int32(termbox.ColorBlue)} ColorMagenta = TColor{int32(termbox.ColorMagenta)} ColorCyan = TColor{int32(termbox.ColorCyan)} ColorWhite = TColor{int32(termbox.ColorWhite)} ColorDarkGray = TColor{int32(termbox.ColorBlack | termbox.AttrBold)} )
Colors -
View Source
var ActionMap tActionMap
ActionMap -
View Source
var BorderMap tBorderMap
BorderMap -
Functions ¶
Types ¶
type TAbstractAction ¶
type TAbstractAction struct {
// contains filtered or unexported fields
}
TAbstractAction -
func (*TAbstractAction) Description ¶
func (act *TAbstractAction) Description() string
Description -
type TAction ¶
type TAction struct {
TAbstractAction
// contains filtered or unexported fields
}
TAction -
func NewAction ¶
func NewAction(name, eventKey, descr string, handler TEventHandler) *TAction
NewAction -
type TEventStream ¶
type TEventStream struct {
}
TEventStream -
func (*TEventStream) HasEvent ¶
func (evs *TEventStream) HasEvent() bool
HasEvent - returns true if key was pressed
func (*TEventStream) ReadEvent ¶
func (evs *TEventStream) ReadEvent() IEvent
ReadEvent - reads a key. Blocking
type TKeyboardAction ¶
type TKeyboardAction struct {
TAbstractAction
// contains filtered or unexported fields
}
TKeyboardAction -
func NewKeyboardAction ¶
func NewKeyboardAction(name, eventKey, descr string, handler TKeyboardHandler) *TKeyboardAction
NewKeyboardAction -
type TKeyboardEvent ¶
type TKeyboardEvent struct {
TEvent
// contains filtered or unexported fields
}
TKeyboardEvent -
type TMouseEvent ¶
type TMouseEvent struct {
TEvent
// contains filtered or unexported fields
}
TMouseEvent -
type TScreen ¶
type TScreen struct {
// contains filtered or unexported fields
}
TScreen -
func (*TScreen) DrawAlignedString ¶
DrawAlignedString -
func (*TScreen) SetAlignment ¶
func (scr *TScreen) SetAlignment(alignment TAlignment)
SetAlignment -
func (*TScreen) SetCellColor ¶
SetCellColor -
type TWindowEvent ¶
type TWindowEvent struct {
TEvent
// contains filtered or unexported fields
}
TWindowEvent -
Click to show internal directories.
Click to hide internal directories.