Documentation ¶
Index ¶
- Constants
- func LogFile(str ...string)
- func StringToCells(s string) [][]Cell
- func StringToCellsWithColor(s string, fg, bg termbox.Attribute) [][]Cell
- type Cell
- type Cursor
- type Event
- type Mode
- type Pane
- func (p *Pane) AppendCellFromString(s string)
- func (p *Pane) AppendCellFromStringWithColor(s string, fg, bg termbox.Attribute)
- func (p *Pane) GetLine(y int) []Cell
- func (p *Pane) Line() []Cell
- func (p *Pane) MoveCursor(x, y int)
- func (p *Pane) Rendering()
- func (p *Pane) ResetCellPosition()
- func (p *Pane) ResetPageSize()
- func (p *Pane) ResetViewCells()
- func (p *Pane) SetCellBeforeCursor(ch rune, fg, bg termbox.Attribute)
- func (p *Pane) SetMode(m Mode)
- func (p *Pane) Size() (int, int)
- type Terminal
- func (t *Terminal) AddPaneLandscape(s string)
- func (t *Terminal) AppendCellFromString(str string)
- func (t *Terminal) AppendCellFromStringWithColor(str string, fg, bg termbox.Attribute)
- func (t *Terminal) Close()
- func (t *Terminal) Delete(length int)
- func (t *Terminal) HasCursorPane() *Pane
- func (t *Terminal) Insert(ch rune)
- func (t *Terminal) ListenKeyBoardLikeVim(e termbox.Event)
- func (t *Terminal) ListenKeyBorad(e termbox.Event)
- func (t *Terminal) MoveCursorDown()
- func (t *Terminal) MoveCursorLeft()
- func (t *Terminal) MoveCursorRight()
- func (t *Terminal) MoveCursorToFirstLine()
- func (t *Terminal) MoveCursorToLastCell()
- func (t *Terminal) MoveCursorToLastLine()
- func (t *Terminal) MoveCursorToLineBegin()
- func (t *Terminal) MoveCursorToLineEnd()
- func (t *Terminal) MoveCursorUp()
- func (t *Terminal) PollEvent() termbox.Event
- func (t *Terminal) Rendering()
- func (t *Terminal) Resize(w, h int)
- func (t *Terminal) Run(onCh func(ch rune), onKey func(key termbox.Key))
- func (t *Terminal) SetCursor(x, y int)
- func (t *Terminal) SetLineRange(begin, end int)
- func (t *Terminal) SetMode(m Mode)
- func (t *Terminal) Size() (int, int)
Constants ¶
View Source
const ( DefaultCursorX int = 0 DefaultCursorY DefaultXBegin DefaultXEnd ColorDefault termbox.Attribute = termbox.ColorDefault ColorBlack termbox.Attribute = termbox.ColorBlack ColorRed termbox.Attribute = termbox.ColorRed ColorGreen termbox.Attribute = termbox.ColorGreen ColorYellow termbox.Attribute = termbox.ColorYellow ColorBlue termbox.Attribute = termbox.ColorBlue ColorMagenta termbox.Attribute = termbox.ColorMagenta ColorCyan termbox.Attribute = termbox.ColorCyan ColorWhite termbox.Attribute = termbox.ColorWhite )
Variables ¶
This section is empty.
Functions ¶
func StringToCells ¶
func StringToCellsWithColor ¶
Types ¶
type Cell ¶
type Cell struct { Ch rune Fg termbox.Attribute // 文字颜色 Bg termbox.Attribute // 背景颜色 // contains filtered or unexported fields }
type Pane ¶
type Pane struct {
Width, Height int // 窗口的宽高
CursorX, CursorY int // 光标坐标
PageWidth, PageHeight int // 内容的宽高
PageOffsetX, PageOffsetY int // 内容和窗口的偏移坐标
E *Event
Mode Mode
// contains filtered or unexported fields
}
func (*Pane) AppendCellFromString ¶
func (*Pane) AppendCellFromStringWithColor ¶
func (*Pane) ResetCellPosition ¶
func (p *Pane) ResetCellPosition()
func (*Pane) ResetPageSize ¶
func (p *Pane) ResetPageSize()
func (*Pane) SetCellBeforeCursor ¶
type Terminal ¶
type Terminal struct {
CursorX, CursorY int
PageWidth, PageHeight int
PageOffsetX, PageOffsetY int
E *Event
Mode Mode
// contains filtered or unexported fields
}
func (*Terminal) AddPaneLandscape ¶
func (*Terminal) AppendCellFromString ¶
func (*Terminal) AppendCellFromStringWithColor ¶
func (*Terminal) HasCursorPane ¶
func (*Terminal) ListenKeyBoardLikeVim ¶
func (t *Terminal) ListenKeyBoardLikeVim(e termbox.Event)
func (*Terminal) ListenKeyBorad ¶
func (t *Terminal) ListenKeyBorad(e termbox.Event)
func (*Terminal) MoveCursorDown ¶
func (t *Terminal) MoveCursorDown()
func (*Terminal) MoveCursorLeft ¶
func (t *Terminal) MoveCursorLeft()
func (*Terminal) MoveCursorRight ¶
func (t *Terminal) MoveCursorRight()
func (*Terminal) MoveCursorToFirstLine ¶
func (t *Terminal) MoveCursorToFirstLine()
func (*Terminal) MoveCursorToLastCell ¶
func (t *Terminal) MoveCursorToLastCell()
func (*Terminal) MoveCursorToLastLine ¶
func (t *Terminal) MoveCursorToLastLine()
func (*Terminal) MoveCursorToLineBegin ¶
func (t *Terminal) MoveCursorToLineBegin()
func (*Terminal) MoveCursorToLineEnd ¶
func (t *Terminal) MoveCursorToLineEnd()
func (*Terminal) MoveCursorUp ¶
func (t *Terminal) MoveCursorUp()
func (*Terminal) SetLineRange ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.