ui

package
v0.0.0-...-d2fdeed Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pauser

type Pauser struct {
	// contains filtered or unexported fields
}

func NewPauser

func NewPauser(k keyboard.Key, ch chan bool) *Pauser

func (*Pauser) Draw

func (o *Pauser) Draw(cvs *canvas.Canvas, meta *widgetapi.Meta) error

When the infrastructure calls Draw(), the widget must block on the call until it finishes drawing onto the provided canvas. When given the canvas, the widget must first determine its size by calling Canvas.Size(), then limit all its drawing to this area.

The widget must not assume that the size of the canvas or its content remains the same between calls.

The argument meta is guaranteed to be valid (i.e. non-nil). NOTE: THIS WIDGET DOESN'T DRAW ANYTHING

func (*Pauser) Keyboard

func (o *Pauser) Keyboard(k *terminalapi.Keyboard) error

Keyboard processes keyboard events, acts as a button press on the configured Key.

Implements widgetapi.Widget.Keyboard.

func (*Pauser) Mouse

func (o *Pauser) Mouse(m *terminalapi.Mouse) error

Mouse is called when the widget is focused on the dashboard and a mouse event happens on its canvas. Only called if the widget registered for mouse events.

func (*Pauser) Options

func (o *Pauser) Options() widgetapi.Options

Options returns registration options for the widget. This is how the widget indicates to the infrastructure whether it is interested in keyboard or mouse shortcuts, what is its minimum canvas size, etc.

Most widgets will return statically compiled options (minimum and maximum size, etc.). If the returned options depend on the runtime state of the widget (e.g. the user data provided to the widget), the widget must protect against a case where the infrastructure calls the Draw method with a canvas that doesn't meet the requested options. This is because the data in the widget might change between calls to Options and Draw.

func (*Pauser) PauseKeyDown

func (o *Pauser) PauseKeyDown() chan bool

PauseKeyDown receives a toggle value whenever the pause key is pressed

type TermDashUI

type TermDashUI struct {
	// contains filtered or unexported fields
}

func (*TermDashUI) Init

func (o *TermDashUI) Init(bipFile, endBipFile string)

func (*TermDashUI) Run

func (o *TermDashUI) Run()

type UI

type UI interface {
	Run()
}

Jump to

Keyboard shortcuts

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