Documentation ¶
Index ¶
- func BuildStars(data []Bar, maxStars int, starChar string) string
- func NewBillboardModal(text string, closeFunc func()) *tview.Frame
- type Bar
- type BarGraph
- type Base
- func (base *Base) BorderColor() string
- func (base *Base) Bordered() bool
- func (base *Base) CommonSettings() *cfg.Common
- func (base *Base) ConfigText() string
- func (base *Base) ContextualTitle(defaultStr string) string
- func (base *Base) Disable()
- func (base *Base) Disabled() bool
- func (base *Base) Enabled() bool
- func (base *Base) FocusChar() string
- func (base *Base) Focusable() bool
- func (base *Base) Name() string
- func (base *Base) QuitChan() chan bool
- func (base *Base) RefreshInterval() time.Duration
- func (base *Base) Refreshing() bool
- func (base *Base) SetFocusChar(char string)
- func (base *Base) SetView(view *tview.TextView)
- func (base *Base) ShowHelp()
- func (base *Base) Stop()
- func (base *Base) String() string
- type InfoTable
- type KeyboardWidget
- func (widget *KeyboardWidget) AssignedChars() []string
- func (widget *KeyboardWidget) HelpText() string
- func (widget *KeyboardWidget) InitializeHelpTextKeyboardControl(helpFunc func())
- func (widget *KeyboardWidget) InitializeRefreshKeyboardControl(refreshFunc func())
- func (widget *KeyboardWidget) InputCapture(event *tcell.EventKey) *tcell.EventKey
- func (widget *KeyboardWidget) LaunchDocumentation()
- func (widget *KeyboardWidget) SetKeyboardChar(char string, fn func(), helpText string)
- func (widget *KeyboardWidget) SetKeyboardKey(key tcell.Key, fn func(), helpText string)
- type MultiSourceWidget
- type ScrollableWidget
- func (widget *ScrollableWidget) GetSelected() int
- func (widget *ScrollableWidget) Next()
- func (widget *ScrollableWidget) Prev()
- func (widget *ScrollableWidget) Redraw(data func() (string, string, bool))
- func (widget *ScrollableWidget) RowColor(idx int) string
- func (widget *ScrollableWidget) SetItemCount(items int)
- func (widget *ScrollableWidget) SetRenderFunction(displayFunc func())
- func (widget *ScrollableWidget) Unselect()
- type TextWidget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildStars ¶
BuildStars build the string to display
func NewBillboardModal ¶ added in v0.25.0
NewBillboardModal creates and returns a modal dialog suitable for displaying a wall of text An example of this is the keyboard help modal that shows up for all widgets that support keyboard control when '/' is pressed
Types ¶
type BarGraph ¶
type BarGraph struct { *Base *KeyboardWidget View *tview.TextView // contains filtered or unexported fields }
BarGraph defines the data required to make a bar graph
func NewBarGraph ¶
func NewBarGraph(tviewApp *tview.Application, redrawChan chan bool, _ string, commonSettings *cfg.Common) BarGraph
NewBarGraph creates and returns an instance of BarGraph
type Base ¶
type Base struct { RedrawChan chan bool // contains filtered or unexported fields }
func NewBase ¶
func NewBase(tviewApp *tview.Application, redrawChan chan bool, pages *tview.Pages, commonSettings *cfg.Common) *Base
NewBase creates and returns an instance of the Base module, the lowest-level primitive module from which all others are derived
func (*Base) BorderColor ¶
BorderColor returns the color that the border of this widget should be drawn in
func (*Base) CommonSettings ¶
func (*Base) ConfigText ¶
func (*Base) ContextualTitle ¶
func (*Base) RefreshInterval ¶
RefreshInterval returns how often the base will return its data
func (*Base) Refreshing ¶
Refreshing returns TRUE if the base is currently refreshing its data, FALSE if it is not
func (*Base) SetFocusChar ¶
func (*Base) SetView ¶ added in v0.35.0
SetView assigns the passed-in tview.TextView view to this widget
type InfoTable ¶ added in v0.25.0
type InfoTable struct {
// contains filtered or unexported fields
}
InfoTable contains the internal guts of an InfoTable
type KeyboardWidget ¶
type KeyboardWidget struct {
// contains filtered or unexported fields
}
KeyboardWidget manages keyboard control for a widget
func NewKeyboardWidget ¶
func NewKeyboardWidget(settings *cfg.Common) *KeyboardWidget
NewKeyboardWidget creates and returns a new instance of KeyboardWidget func NewKeyboardWidget(tviewApp *tview.Application, pages *tview.Pages, settings *cfg.Common) *KeyboardWidget {
func (*KeyboardWidget) AssignedChars ¶ added in v0.35.0
func (widget *KeyboardWidget) AssignedChars() []string
AssignedChars returns a list of all the text characters assigned to an operation
func (*KeyboardWidget) HelpText ¶
func (widget *KeyboardWidget) HelpText() string
HelpText returns the help text and keyboard command info for this widget
func (*KeyboardWidget) InitializeHelpTextKeyboardControl ¶ added in v0.35.0
func (widget *KeyboardWidget) InitializeHelpTextKeyboardControl(helpFunc func())
InitializeHelpTextKeyboardControl assigns the function that displays help text to the common help text key value
func (*KeyboardWidget) InitializeRefreshKeyboardControl ¶ added in v0.35.0
func (widget *KeyboardWidget) InitializeRefreshKeyboardControl(refreshFunc func())
InitializeRefreshKeyboardControl assigns the module's explicit refresh function to the commom refresh key value
func (*KeyboardWidget) InputCapture ¶
func (widget *KeyboardWidget) InputCapture(event *tcell.EventKey) *tcell.EventKey
InputCapture is the function passed to tview's SetInputCapture() function This is done during the main widget's creation process using the following code:
widget.View.SetInputCapture(widget.InputCapture)
func (*KeyboardWidget) LaunchDocumentation ¶ added in v0.35.0
func (widget *KeyboardWidget) LaunchDocumentation()
LaunchDocumentation opens the module docs in a browser
func (*KeyboardWidget) SetKeyboardChar ¶
func (widget *KeyboardWidget) SetKeyboardChar(char string, fn func(), helpText string)
SetKeyboardChar sets a character/function combination that responds to key presses Example:
widget.SetKeyboardChar("d", widget.deleteSelectedItem)
func (*KeyboardWidget) SetKeyboardKey ¶
func (widget *KeyboardWidget) SetKeyboardKey(key tcell.Key, fn func(), helpText string)
SetKeyboardKey sets a tcell.Key/function combination that responds to key presses Example:
widget.SetKeyboardKey(tcell.KeyCtrlD, widget.deleteSelectedItem)
type MultiSourceWidget ¶
type MultiSourceWidget struct { DisplayFunction func() Idx int Sources []string // contains filtered or unexported fields }
MultiSourceWidget is a widget that supports displaying data from multiple sources
func NewMultiSourceWidget ¶
func NewMultiSourceWidget(moduleConfig *cfg.Common, singular, plural string) MultiSourceWidget
NewMultiSourceWidget creates and returns an instance of MultiSourceWidget
func (*MultiSourceWidget) CurrentSource ¶
func (widget *MultiSourceWidget) CurrentSource() string
CurrentSource returns the string representations of the currently-displayed source
func (*MultiSourceWidget) NextSource ¶
func (widget *MultiSourceWidget) NextSource()
NextSource displays the next source in the source list. If the current source is the last source it wraps around to the first source
func (*MultiSourceWidget) PrevSource ¶
func (widget *MultiSourceWidget) PrevSource()
PrevSource displays the previous source in the source list. If the current source is the first source, it wraps around to the last source
func (*MultiSourceWidget) SetDisplayFunction ¶
func (widget *MultiSourceWidget) SetDisplayFunction(displayFunc func())
SetDisplayFunction stores the function that should be called when the source is changed. This is typically called from within the initializer for the struct that embeds MultiSourceWidget
Example:
widget := Widget{ MultiSourceWidget: wtf.NewMultiSourceWidget(settings.common, "person", "people") } widget.SetDisplayFunction(widget.display)
type ScrollableWidget ¶
type ScrollableWidget struct { TextWidget Selected int RenderFunction func() // contains filtered or unexported fields }
func NewScrollableWidget ¶
func NewScrollableWidget(tviewApp *tview.Application, redrawChan chan bool, pages *tview.Pages, commonSettings *cfg.Common) ScrollableWidget
func (*ScrollableWidget) GetSelected ¶
func (widget *ScrollableWidget) GetSelected() int
func (*ScrollableWidget) Next ¶
func (widget *ScrollableWidget) Next()
func (*ScrollableWidget) Prev ¶
func (widget *ScrollableWidget) Prev()
func (*ScrollableWidget) Redraw ¶
func (widget *ScrollableWidget) Redraw(data func() (string, string, bool))
func (*ScrollableWidget) RowColor ¶
func (widget *ScrollableWidget) RowColor(idx int) string
func (*ScrollableWidget) SetItemCount ¶
func (widget *ScrollableWidget) SetItemCount(items int)
func (*ScrollableWidget) SetRenderFunction ¶
func (widget *ScrollableWidget) SetRenderFunction(displayFunc func())
func (*ScrollableWidget) Unselect ¶
func (widget *ScrollableWidget) Unselect()
type TextWidget ¶
type TextWidget struct { *Base *KeyboardWidget View *tview.TextView }
TextWidget defines the data necessary to make a text widget
func NewTextWidget ¶
func NewTextWidget(tviewApp *tview.Application, redrawChan chan bool, pages *tview.Pages, commonSettings *cfg.Common) TextWidget
NewTextWidget creates and returns an instance of TextWidget
func (*TextWidget) Redraw ¶
func (widget *TextWidget) Redraw(data func() (string, string, bool))
Redraw forces a refresh of the onscreen text content of this widget
func (*TextWidget) TextView ¶
func (widget *TextWidget) TextView() *tview.TextView
TextView returns the tview.TextView instance