Documentation ¶
Index ¶
- func MakeWidget(tviewApp *tview.Application, pages *tview.Pages, moduleName string, ...) wtf.Wtfable
- func MakeWidgets(tviewApp *tview.Application, pages *tview.Pages, config *config.Config, ...) []wtf.Wtfable
- func Schedule(widget wtf.Wtfable)
- type Display
- type FocusState
- type FocusTracker
- type ModuleValidator
- type WtfApp
- type WtfAppManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeWidget ¶ added in v0.20.0
func MakeWidget( tviewApp *tview.Application, pages *tview.Pages, moduleName string, config *config.Config, redrawChan chan bool, ) wtf.Wtfable
MakeWidget creates and returns instances of widgets
Types ¶
type FocusState ¶
type FocusState int
FocusState is a custom type that differentiates focusable scopes
type FocusTracker ¶
type FocusTracker struct { Idx int IsFocused bool Widgets []wtf.Wtfable // contains filtered or unexported fields }
FocusTracker is used by the app to track which onscreen widget currently has focus, and to move focus between widgets.
func NewFocusTracker ¶
func NewFocusTracker(tviewApp *tview.Application, widgets []wtf.Wtfable, config *config.Config) FocusTracker
NewFocusTracker creates and returns an instance of FocusTracker
func (*FocusTracker) FocusOn ¶
func (tracker *FocusTracker) FocusOn(char string) bool
FocusOn puts the focus on the item that belongs to the focus character passed in
func (*FocusTracker) Next ¶
func (tracker *FocusTracker) Next()
Next sets the focus on the next widget in the widget list. If the current widget is the last widget, sets focus on the first widget.
func (*FocusTracker) None ¶
func (tracker *FocusTracker) None()
None removes focus from the currently-focused widget.
func (*FocusTracker) Prev ¶
func (tracker *FocusTracker) Prev()
Prev sets the focus on the previous widget in the widget list. If the current widget is the last widget, sets focus on the last widget.
func (*FocusTracker) Refocus ¶
func (tracker *FocusTracker) Refocus()
Refocus forces the focus back to the currently-selected item
type ModuleValidator ¶
type ModuleValidator struct{}
ModuleValidator is responsible for validating the state of a module's configuration
func NewModuleValidator ¶
func NewModuleValidator() *ModuleValidator
NewModuleValidator creates and returns an instance of ModuleValidator
func (*ModuleValidator) Validate ¶
func (val *ModuleValidator) Validate(widgets []wtf.Wtfable)
Validate rolls through all the enabled widgets and looks for configuration errors. If it finds any it stringifies them, writes them to the console, and kills the app gracefully
type WtfApp ¶
type WtfApp struct { TViewApp *tview.Application // contains filtered or unexported fields }
WtfApp is the container for a collection of widgets that are all constructed from a single configuration file and displayed together
func (*WtfApp) DisplayExitMessage ¶ added in v0.33.0
func (wtfApp *WtfApp) DisplayExitMessage()
DisplayExitMessage displays the onscreen exit message when the app quits
type WtfAppManager ¶ added in v0.35.0
type WtfAppManager struct { WtfApps []*WtfApp // contains filtered or unexported fields }
WtfAppManager handles the instances of WtfApp, ensuring that they're displayed as requested
func NewAppManager ¶ added in v0.35.0
func NewAppManager() WtfAppManager
NewAppManager creates and returns an instance of AppManager
func (*WtfAppManager) Add ¶ added in v0.35.0
func (appMan *WtfAppManager) Add(wtfApp *WtfApp)
Add adds a WtfApp to the collection of apps that the AppManager manages. This app is then available for display onscreen.
func (*WtfAppManager) Current ¶ added in v0.35.0
func (appMan *WtfAppManager) Current() (*WtfApp, error)
Current returns the currently-displaying instance of WtfApp
func (*WtfAppManager) MakeNewWtfApp ¶ added in v0.35.0
func (appMan *WtfAppManager) MakeNewWtfApp(config *config.Config, configFilePath string)
MakeNewWtfApp creates and starts a new instance of WtfApp from a set of configuration params
func (*WtfAppManager) Next ¶ added in v0.35.0
func (appMan *WtfAppManager) Next() (*WtfApp, error)
Next cycles the WtfApps forward by one, making the next one in the list the current one. If there are none after the current one, it wraps around.
func (*WtfAppManager) Prev ¶ added in v0.35.0
func (appMan *WtfAppManager) Prev() (*WtfApp, error)
Prev cycles the WtfApps backwards by one, making the previous one in the list the current one. If there are none before the current one, it wraps around.