Documentation
¶
Index ¶
- func MakeWidget(app *tview.Application, pages *tview.Pages, moduleName string, ...) wtf.Wtfable
- func MakeWidgets(app *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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeWidget ¶ added in v0.20.0
func MakeWidget( app *tview.Application, pages *tview.Pages, moduleName string, config *config.Config, ) wtf.Wtfable
MakeWidget creates and returns instances of widgets
func MakeWidgets ¶ added in v0.20.0
MakeWidgets creates and returns a collection of enabled widgets
Types ¶
type FocusState ¶
type FocusState int
type FocusTracker ¶
type FocusTracker struct {
App *tview.Application
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(app *tview.Application, widgets []wtf.Wtfable, config *config.Config) FocusTracker
func (*FocusTracker) FocusOn ¶
func (tracker *FocusTracker) FocusOn(char string) bool
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()
type ModuleValidator ¶
type ModuleValidator struct{}
func NewModuleValidator ¶
func NewModuleValidator() *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 {
// 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 NewWtfApp ¶
func NewWtfApp(app *tview.Application, config *config.Config, configFilePath string, isCustom bool) *WtfApp
NewWtfApp creates and returns an instance of WtfApp
func (*WtfApp) App ¶
func (wtfApp *WtfApp) App() *tview.Application
App returns the *tview.Application instance