widget

package
v0.0.0-...-bb3eb04 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleDetail

type ArticleDetail struct {
	*tview.Flex
	// contains filtered or unexported fields
}

ArticleDetail is a widget that provides for viewing article details.

func NewArticleDetail

func NewArticleDetail(app *tview.Application, parent tview.Primitive) *ArticleDetail

NewArticleDetail creates a new instance of the ArticleDetail view. Nothing will be displayed until an article is set on this view using Refresh()

func (*ArticleDetail) Refresh

func (a *ArticleDetail) Refresh(article *news.Article)

Refresh updates the content being displayed by this widget.

type Articles

type Articles struct {
	*tview.Flex
	// contains filtered or unexported fields
}

Articles is a widget to display a read-only list of articles with their details available.

func NewArticles

func NewArticles(app *tview.Application, articles []*news.Article) *Articles

NewArticles creates a new instance of this widget with the supplied set of articles for viewing. It should be at least 50 characters wide for best performance.

func (*Articles) SetNextWidget

func (a *Articles) SetNextWidget(next tview.Primitive)

SetNextWidget controls where the focus is given should this list be left.

type Debug

type Debug struct {
	*tview.TextView
	// contains filtered or unexported fields
}

Debug is a widget to display debug information..

func NewDebug

func NewDebug(app *tview.Application) *Debug

NewDebug creates a new debug widget.

func (*Debug) Refresh

func (d *Debug) Refresh(contents string)

Refresh updates the contents of the debug widget.

type DeviceDetail

type DeviceDetail struct {
	*tview.Flex
	// contains filtered or unexported fields
}

DeviceDetail is a widget that provides for viewing and editing DeviceInfo details.

func NewDeviceDetail

func NewDeviceDetail(app *tview.Application, logger *zap.Logger, parent tview.Primitive) *DeviceDetail

NewDeviceDetail creates a new instance of the DeviceDetail view. Nothing will be displayed until a DeviceInfo is set on this view using Refresh()

func (*DeviceDetail) Refresh

func (dd *DeviceDetail) Refresh(client bridge.BridgeServiceClient, device *bridge.Device)

Refresh takes the supplied DeviceInfo and refreshes the view with its contents.

type Devices

type Devices struct {
	*tview.Flex
	// contains filtered or unexported fields
}

Devices is a widget to display an editable list of devices with their details available.

func NewDevices

func NewDevices(app *tview.Application, logger *zap.Logger, client bridge.BridgeServiceClient) *Devices

NewDevices creates a new instance of this widget with the supplied set of devices for management.

func (*Devices) SetNextWidget

func (d *Devices) SetNextWidget(next tview.Primitive)

SetNextWidget controls where the focus is given should this list be left.

type Time

type Time struct {
	*tview.TextView
	// contains filtered or unexported fields
}

Time is a widget to display the time for the current location.

func NewTime

func NewTime(app *tview.Application, location *time.Location) *Time

NewTime creates a new time widget using the supplied timezone.

func (*Time) Run

func (t *Time) Run()

Run begins running the time widget.

type Transit

type Transit struct {
	*tview.Flex
	// contains filtered or unexported fields
}

Transit is a widget that displays the upcoming transit arrival times.

func NewTransit

func NewTransit(app *tview.Application, rowCount int) *Transit

NewTransit creates a new transit widget with the specified number of rows. It will not show any data until Refresh() is called to display the data.

func (*Transit) Refresh

func (wf *Transit) Refresh(stop *transit.Stop, records []*transit.Arrival)

Refresh causes the transit data to be updated.

type WeatherCondition

type WeatherCondition struct {
	*tview.Flex
	// contains filtered or unexported fields
}

WeatherCondition is a widget to display the current weather conditions. It is a fixed-size widget of width 24.

func NewWeatherCondition

func NewWeatherCondition(app *tview.Application) *WeatherCondition

NewWeatherCondition creates a new weather report widget. Nothing will be displayed until a WeatherConditionInfo is set on this view using Refresh()

func (*WeatherCondition) Refresh

func (wc *WeatherCondition) Refresh(report *weather.WeatherReport)

Refresh takes the supplied information and updates the widget with the supplied values.

type WeatherForecast

type WeatherForecast struct {
	*tview.Flex
	// contains filtered or unexported fields
}

WeatherForecast is a widget that displays the upcoming weather forecast.

func NewWeatherForecast

func NewWeatherForecast(app *tview.Application, rowCount int) *WeatherForecast

NewWeatherForecast creates a new WeatherForecast widget with the specified number of rows. It will not show any data until Refresh() is called to display the data.

func (*WeatherForecast) Refresh

func (wf *WeatherForecast) Refresh(forecast *weather.GetForecastResponse)

Refresh causes the forecast data to be updated.

Jump to

Keyboard shortcuts

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