Documentation ¶
Index ¶
- Constants
- type BaseWidget
- func (b *BaseWidget) AskRedraw()
- func (b *BaseWidget) AskingRedraw(f func())
- func (b *BaseWidget) Clear()
- func (b *BaseWidget) GetViewPort() *views.ViewPort
- func (b *BaseWidget) HandleTransitions(ev *lib.Event) bool
- func (b *BaseWidget) HideCursor()
- func (b *BaseWidget) IsActiveTerm() bool
- func (b *BaseWidget) Messagef(msg string, args ...interface{})
- func (b *BaseWidget) OnMessage(f func(msg string, args ...interface{}))
- func (b *BaseWidget) OnSetViewPort(f func(view *views.ViewPort, screen tcell.Screen))
- func (b *BaseWidget) Print(x, y int, style tcell.Style, str string) int
- func (b *BaseWidget) Resize()
- func (b *BaseWidget) ScrollDown(rows int)
- func (b *BaseWidget) ScrollUp(rows int)
- func (b *BaseWidget) SetContent(x int, y int, mainc rune, combc []rune, style tcell.Style)
- func (b *BaseWidget) SetViewPort(view *views.ViewPort, screen tcell.Screen)
- func (b *BaseWidget) ShowCursor(x int, y int)
- func (b *BaseWidget) Size() (int, int)
- type ContentWithStyle
- type IStyled
- type ITreeLine
- type ListWidget
- type Terminal
- func (term *Terminal) Close(err error)
- func (term *Terminal) Destroy()
- func (term *Terminal) Draw()
- func (term *Terminal) Event(event tcell.Event) bool
- func (term *Terminal) Focus(focus bool)
- func (term *Terminal) HandleEvent(ks []*lib.KeyStroke) bool
- func (term *Terminal) Invalidate()
- func (term *Terminal) IsActiveTerm() bool
- func (term *Terminal) MouseEvent(localX int, localY int, event tcell.Event)
- type Text
- type TreeWidget
- type Widget
Constants ¶
View Source
const ARROW = '➤'
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseWidget ¶
type BaseWidget struct {
// contains filtered or unexported fields
}
func (*BaseWidget) AskRedraw ¶
func (b *BaseWidget) AskRedraw()
func (*BaseWidget) AskingRedraw ¶
func (b *BaseWidget) AskingRedraw(f func())
func (*BaseWidget) Clear ¶
func (b *BaseWidget) Clear()
func (*BaseWidget) GetViewPort ¶
func (b *BaseWidget) GetViewPort() *views.ViewPort
func (*BaseWidget) HandleTransitions ¶
func (b *BaseWidget) HandleTransitions(ev *lib.Event) bool
func (*BaseWidget) HideCursor ¶
func (b *BaseWidget) HideCursor()
func (*BaseWidget) IsActiveTerm ¶
func (b *BaseWidget) IsActiveTerm() bool
func (*BaseWidget) Messagef ¶
func (b *BaseWidget) Messagef(msg string, args ...interface{})
func (*BaseWidget) OnMessage ¶
func (b *BaseWidget) OnMessage(f func(msg string, args ...interface{}))
func (*BaseWidget) OnSetViewPort ¶
func (b *BaseWidget) OnSetViewPort(f func(view *views.ViewPort, screen tcell.Screen))
func (*BaseWidget) Resize ¶
func (b *BaseWidget) Resize()
func (*BaseWidget) ScrollDown ¶
func (b *BaseWidget) ScrollDown(rows int)
func (*BaseWidget) ScrollUp ¶
func (b *BaseWidget) ScrollUp(rows int)
func (*BaseWidget) SetContent ¶
func (b *BaseWidget) SetContent(x int, y int, mainc rune, combc []rune, style tcell.Style)
func (*BaseWidget) SetViewPort ¶
func (b *BaseWidget) SetViewPort(view *views.ViewPort, screen tcell.Screen)
func (*BaseWidget) ShowCursor ¶
func (b *BaseWidget) ShowCursor(x int, y int)
func (*BaseWidget) Size ¶
func (b *BaseWidget) Size() (int, int)
type ContentWithStyle ¶
type ContentWithStyle struct { Content string Style tcell.Style }
func NewContent ¶
func NewContent(c string) *ContentWithStyle
func (*ContentWithStyle) Reverse ¶
func (cs *ContentWithStyle) Reverse(should bool) tcell.Style
type IStyled ¶
type IStyled interface {
StyledContent() []*ContentWithStyle
}
type ListWidget ¶
type ListWidget struct { OnSelect func(IStyled) BaseWidget // contains filtered or unexported fields }
func NewList ¶
func NewList() *ListWidget
func (*ListWidget) AddLine ¶
func (l *ListWidget) AddLine(line IStyled)
func (*ListWidget) ClearLines ¶
func (l *ListWidget) ClearLines()
func (*ListWidget) Draw ¶
func (l *ListWidget) Draw()
func (*ListWidget) HandleEvent ¶
func (l *ListWidget) HandleEvent(ks []*lib.KeyStroke) bool
func (*ListWidget) SetSelected ¶
func (l *ListWidget) SetSelected(s int)
type Terminal ¶
type Terminal struct { BaseWidget OnClose func(err error) OnEvent func(event tcell.Event) bool OnStart func() OnTitle func(title string) // contains filtered or unexported fields }
func NewTerminal ¶
func (*Terminal) Invalidate ¶
func (term *Terminal) Invalidate()
func (*Terminal) IsActiveTerm ¶
func (*Terminal) MouseEvent ¶
type Text ¶
type Text struct { BaseWidget // contains filtered or unexported fields }
func (*Text) GetContent ¶
func (*Text) SetContent ¶
type TreeWidget ¶
type TreeWidget struct { OnSelect func(ITreeLine) ListWidget // contains filtered or unexported fields }
func NewTree ¶
func NewTree() *TreeWidget
func NewTreeWithInitSelected ¶
func NewTreeWithInitSelected(init int) *TreeWidget
func (*TreeWidget) AddLine ¶
func (t *TreeWidget) AddLine(line ITreeLine)
func (*TreeWidget) ClearLines ¶
func (t *TreeWidget) ClearLines()
func (*TreeWidget) Draw ¶
func (t *TreeWidget) Draw()
func (*TreeWidget) GetSelected ¶
func (t *TreeWidget) GetSelected() ITreeLine
func (*TreeWidget) HandleEvent ¶
func (t *TreeWidget) HandleEvent(ks []*lib.KeyStroke) bool
func (*TreeWidget) SetSelected ¶
func (t *TreeWidget) SetSelected(s int)
type Widget ¶
type Widget interface { HandleEvent(ks []*lib.KeyStroke) bool Draw() SetViewPort(view *views.ViewPort, screen tcell.Screen) GetViewPort() *views.ViewPort SetContent(x int, y int, mainc rune, combc []rune, style tcell.Style) IsActiveTerm() bool HandleTransitions(ev *lib.Event) bool AskRedraw() AskingRedraw(func()) OnMessage(f func(msg string, args ...interface{})) Resize() Size() (int, int) }
Click to show internal directories.
Click to hide internal directories.