app

package
v0.34.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2020 License: MPL-2.0 Imports: 87 Imported by: 2

Documentation

Index

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

func MakeWidgets(app *tview.Application, pages *tview.Pages, config *config.Config) []wtf.Wtfable

MakeWidgets creates and returns a collection of enabled widgets

func Schedule

func Schedule(widget wtf.Wtfable)

Schedule kicks off the first refresh of a module's data and then queues the rest of the data refreshes on a timer

Types

type Display

type Display struct {
	Grid *tview.Grid
	// contains filtered or unexported fields
}

Display is the container for the onscreen representation of a WtfApp

func NewDisplay

func NewDisplay(widgets []wtf.Wtfable, config *config.Config) *Display

NewDisplay creates and returns a Display

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) *WtfApp

NewWtfApp creates and returns an instance of WtfApp

func (*WtfApp) DisplayExitMessage added in v0.33.0

func (wtfApp *WtfApp) DisplayExitMessage()

DisplayExitMessage displays the onscreen exit message when the app quits

func (*WtfApp) Start

func (wtfApp *WtfApp) Start()

Start initializes the app

func (*WtfApp) Stop

func (wtfApp *WtfApp) Stop()

Stop kills all the currently-running widgets in this app

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL