Documentation ¶
Index ¶
- Constants
- Variables
- func DimInt(x, y int) int
- func DrawBorder(c Canvas, style TextStyle)
- func LogEntry() *logrus.Entry
- func SetLogger(l *logrus.Logger)
- type Alignment
- type App
- type BaseLayer
- type BaseList
- func (l *BaseList) AddCells(cells ...Cell)
- func (l *BaseList) Backward() bool
- func (l *BaseList) Clear()
- func (l *BaseList) CurrentCell() (int, Cell)
- func (l *BaseList) Forward() bool
- func (l *BaseList) HandleEvent(ev Event) error
- func (l *BaseList) MoveTo(index int) bool
- func (l *BaseList) OnKeyEvent(fn KeyFn)
- func (l *BaseList) Resize(x, y, width, height int)
- func (l *BaseList) SetCanvas(canvas Canvas)
- type BaseWidget
- func (b *BaseWidget) HandleEvent(ev Event) error
- func (b *BaseWidget) Hidden(h bool)
- func (b *BaseWidget) Layout() Layout
- func (b *BaseWidget) Refresh()
- func (b *BaseWidget) Resize(x, y, width, height int)
- func (b *BaseWidget) SetCanvas(v Canvas)
- func (b *BaseWidget) SetLayout(l Layout) *BaseWidget
- func (b *BaseWidget) SetStyle(s TextStyle) *BaseWidget
- func (b *BaseWidget) Size() (int, int)
- func (b *BaseWidget) Style() TextStyle
- type Canvas
- type Cell
- type Event
- type EventError
- type EventInterrupt
- type EventKey
- type EventListener
- type EventPaste
- type EventResize
- type EventTime
- type HorizontalLayer
- type Key
- type KeyFn
- type Label
- type Layer
- type Layout
- type List
- type LogicCanvas
- func (v *LogicCanvas) Clear()
- func (v *LogicCanvas) Fill(style TextStyle)
- func (s *LogicCanvas) HideCursor()
- func (v *LogicCanvas) Id() string
- func (v *LogicCanvas) Refresh()
- func (v *LogicCanvas) Resize(x, y, width, height int)
- func (v *LogicCanvas) SetContent(x, y int, r rune, comb []rune, style TextStyle)
- func (v *LogicCanvas) SetString(x, y int, str string, style TextStyle) int
- func (v *LogicCanvas) ShowCursor(x, y int)
- func (v *LogicCanvas) Size() (int, int)
- func (v *LogicCanvas) Update()
- type ModMask
- type Padding
- type SimCanvas
- func (s *SimCanvas) Clear()
- func (s *SimCanvas) Fill(style TextStyle)
- func (s *SimCanvas) GetContent(x, y int) (rune, []rune, TextStyle, int)
- func (s *SimCanvas) HideCursor()
- func (s *SimCanvas) Id() string
- func (s *SimCanvas) InjectKey(key Key, r rune, mod ModMask)
- func (s *SimCanvas) Refresh()
- func (s *SimCanvas) Resize(x, y, width, height int)
- func (s *SimCanvas) SetContent(x, y int, r rune, comb []rune, style TextStyle)
- func (s *SimCanvas) SetParentView(view Canvas)
- func (s *SimCanvas) SetSize(width, height int)
- func (s *SimCanvas) SetString(x, y int, str string, style TextStyle) int
- func (s *SimCanvas) ShowCursor(x, y int)
- func (s *SimCanvas) Size() (int, int)
- func (s *SimCanvas) Update()
- type SimpleCell
- type Size
- type SizeType
- type TextStyle
- type VerticalLayer
- type View
- type Widget
Constants ¶
View Source
const ( AlignmentNone = 1 << iota AlignmentCenter AlignmentLeft AlignmentRight AlignmentTop AlignmentBottom )
View Source
const ( SizeAuto = iota SizeAbsolute SizeRelative )
View Source
const (
Percent = 0.01
)
Variables ¶
View Source
var LayoutDefault = Layout{}
View Source
var LogLevel = logrus.PanicLevel
View Source
var Logger *logrus.Logger
View Source
var TextStyleDefault = tcell.StyleDefault
Functions ¶
func DrawBorder ¶
=========================================
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func NewAppWithCanvas ¶
func (*App) AddEventListener ¶
func (app *App) AddEventListener(fn EventListener)
func (*App) HandleEvent ¶
func (*App) SetRootLayer ¶
func (*App) WaitForShutdown ¶
func (app *App) WaitForShutdown()
type BaseLayer ¶
type BaseLayer struct {
// contains filtered or unexported fields
}
type BaseList ¶
type BaseList struct { BaseWidget // contains filtered or unexported fields }
func (*BaseList) CurrentCell ¶
func (*BaseList) HandleEvent ¶
func (*BaseList) OnKeyEvent ¶
type BaseWidget ¶
type BaseWidget struct {
// contains filtered or unexported fields
}
func (*BaseWidget) HandleEvent ¶
func (b *BaseWidget) HandleEvent(ev Event) error
func (*BaseWidget) Hidden ¶
func (b *BaseWidget) Hidden(h bool)
func (*BaseWidget) Layout ¶
func (b *BaseWidget) Layout() Layout
func (*BaseWidget) Refresh ¶
func (b *BaseWidget) Refresh()
func (*BaseWidget) Resize ¶
func (b *BaseWidget) Resize(x, y, width, height int)
func (*BaseWidget) SetCanvas ¶
func (b *BaseWidget) SetCanvas(v Canvas)
func (*BaseWidget) SetLayout ¶
func (b *BaseWidget) SetLayout(l Layout) *BaseWidget
func (*BaseWidget) SetStyle ¶
func (b *BaseWidget) SetStyle(s TextStyle) *BaseWidget
func (*BaseWidget) Size ¶
func (b *BaseWidget) Size() (int, int)
func (*BaseWidget) Style ¶
func (b *BaseWidget) Style() TextStyle
type Cell ¶
type EventError ¶
type EventError = tcell.EventError
type EventInterrupt ¶
type EventInterrupt = tcell.EventInterrupt
type EventListener ¶
type EventPaste ¶
type EventPaste = tcell.EventPaste
type EventResize ¶
type EventResize = tcell.EventResize
type HorizontalLayer ¶
type HorizontalLayer struct {
BaseLayer
}
func NewHorizontalLayout ¶
func NewHorizontalLayout() *HorizontalLayer
=============== Horizontal Layout =======================
type Label ¶
type Label struct { BaseWidget // contains filtered or unexported fields }
func (*Label) HandleEvent ¶
type LogicCanvas ¶
type LogicCanvas struct {
// contains filtered or unexported fields
}
func NewLogicCanvas ¶
func NewLogicCanvas(parent Canvas) *LogicCanvas
============ LogicView ==============
func (*LogicCanvas) Clear ¶
func (v *LogicCanvas) Clear()
func (*LogicCanvas) Fill ¶
func (v *LogicCanvas) Fill(style TextStyle)
func (*LogicCanvas) HideCursor ¶
func (s *LogicCanvas) HideCursor()
func (*LogicCanvas) Id ¶
func (v *LogicCanvas) Id() string
func (*LogicCanvas) Refresh ¶
func (v *LogicCanvas) Refresh()
func (*LogicCanvas) Resize ¶
func (v *LogicCanvas) Resize(x, y, width, height int)
func (*LogicCanvas) SetContent ¶
func (v *LogicCanvas) SetContent( x, y int, r rune, comb []rune, style TextStyle, )
func (*LogicCanvas) SetString ¶
func (v *LogicCanvas) SetString(x, y int, str string, style TextStyle) int
func (*LogicCanvas) ShowCursor ¶
func (v *LogicCanvas) ShowCursor(x, y int)
func (*LogicCanvas) Size ¶
func (v *LogicCanvas) Size() (int, int)
func (*LogicCanvas) Update ¶
func (v *LogicCanvas) Update()
type SimCanvas ¶
type SimCanvas struct {
// contains filtered or unexported fields
}
func NewSimCanvas ¶
func NewSimCanvas() *SimCanvas
==================== SimView ====================
func (*SimCanvas) GetContent ¶
func (*SimCanvas) HideCursor ¶
func (s *SimCanvas) HideCursor()
func (*SimCanvas) SetContent ¶
func (*SimCanvas) SetParentView ¶
func (*SimCanvas) ShowCursor ¶
type SimpleCell ¶
type SimpleCell struct { Label // contains filtered or unexported fields }
func (*SimpleCell) Name ¶
func (c *SimpleCell) Name() string
func (*SimpleCell) SetName ¶
func (c *SimpleCell) SetName(name string)
func (*SimpleCell) SetTextStyle ¶
func (c *SimpleCell) SetTextStyle(style TextStyle)
func (*SimpleCell) SetValue ¶
func (c *SimpleCell) SetValue(value interface{})
func (*SimpleCell) TextStyle ¶
func (c *SimpleCell) TextStyle() TextStyle
func (*SimpleCell) Value ¶
func (c *SimpleCell) Value() interface{}
type Size ¶
type Size struct {
// contains filtered or unexported fields
}
func AbsoluteSize ¶
func RelativeSize ¶
type VerticalLayer ¶
type VerticalLayer struct {
BaseLayer
}
func NewVerticalLayout ¶
func NewVerticalLayout() *VerticalLayer
============== VerticalLayout =================
Source Files ¶
Click to show internal directories.
Click to hide internal directories.