Documentation ¶
Index ¶
- func ApplyStyling()
- type List
- func (l *List) AddItem(item ListItem) *List
- func (l *List) ClearItems() *List
- func (l *List) Draw(screen tcell.Screen)
- func (l *List) GetCurrentIdx() int
- func (l *List) GetCurrentItem() ListItem
- func (l *List) GetItemCount() int
- func (l *List) GetItems() []ListItem
- func (l *List) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (l *List) SetChangedFn(fn func(index int, item ListItem)) *List
- func (l *List) SetCurrentBackgroundColor(color tcell.Color) *List
- func (l *List) SetCurrentItem(index int) *List
- func (l *List) SetCurrentTextColor(color tcell.Color) *List
- func (l *List) SetDoneFn(fn func()) *List
- func (l *List) SetItems(items []ListItem, keepPosition bool) *List
- func (l *List) SetOverflow(overflow bool) *List
- func (l *List) SetSelectedFn(fn func(index int, item ListItem)) *List
- func (l *List) SetTextColor(color tcell.Color) *List
- func (l *List) TriggerChanged() *List
- type ListItem
- type Popup
- func (p *Popup) Blur()
- func (p *Popup) Draw(screen tcell.Screen)
- func (p *Popup) Focus(delegate func(p tview.Primitive))
- func (p *Popup) GetFocusable() tview.Focusable
- func (p *Popup) GetRect() (int, int, int, int)
- func (p *Popup) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (p *Popup) SetRect(x, y, width, height int)
- type SimpleListItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type List ¶
List is a simple selectable List with callback function
func (*List) GetCurrentIdx ¶
GetCurrentIdx returns the index of the current ListItem.
func (*List) GetCurrentItem ¶
GetCurrentItem returns the current ListItem
func (*List) InputHandler ¶
InputHandler implements tview.Primitive
func (*List) SetChangedFn ¶
SetChangedFn sets the callback function after the position of the current item has changed.
func (*List) SetCurrentBackgroundColor ¶
SetCurrentBackgroundColor set the color of the currently highlighted item background.
func (*List) SetCurrentItem ¶
SetCurrentItem sets the current ListItem to a specific index.
func (*List) SetCurrentTextColor ¶
SetCurrentTextColor sets the color of the currently highlighted item text.
func (*List) SetItems ¶
SetItems replaced the items. You can choose to keep the current position, with fallback to 0 if no longer valid.
func (*List) SetOverflow ¶
SetOverflow sets if the list should overflow after reaching the start/end.
func (*List) SetSelectedFn ¶
SetSelectedFn sets the callback function after interaction (enter/space) with the current item.
func (*List) SetTextColor ¶
SetTextColor sets the color of non-highlighted text.
func (*List) TriggerChanged ¶
TriggerChanged trigger the changedFn callback if set.
type ListItem ¶
type ListItem interface {
Label() string
}
ListItem represents the minimal item that a List can use.
func NewSimpleListItem ¶
NewSimpleListItem returns a new SimpleListItem
type Popup ¶
type Popup struct {
// contains filtered or unexported fields
}
Popup is a simple helper for centering a primitive horizontally/vertically. It contains the actual primitive and delegates all related calls to it.
func (*Popup) GetFocusable ¶
GetFocusable implements tview.Primitive
func (*Popup) InputHandler ¶
InputHandler implements tview.Primitive
type SimpleListItem ¶
type SimpleListItem struct {
// contains filtered or unexported fields
}
SimpleListItem is a helper for easier ListItem use.
func (SimpleListItem) Label ¶
func (i SimpleListItem) Label() string
Label implements the interface ListItem