views

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	ConfigureScreen func(tcell.Screen)
	// contains filtered or unexported fields
}

Application represents an event-driven application running on a screen.

func (*Application) PostFunc

func (app *Application) PostFunc(fn func())

PostFunc posts a function to be executed in the context of the application's event loop. Functions that need to update displayed state, etc. can do this to avoid holding locks.

func (*Application) Quit

func (app *Application) Quit()

Quit causes the application to shutdown gracefully. It does not wait for the application to exit, but returns immediately.

func (*Application) Refresh

func (app *Application) Refresh()

Refresh causes the application forcibly redraw everything. Use this to clear up screen corruption, etc.

func (*Application) Run

func (app *Application) Run() error

Run runs the application, waiting until the application loop exits. It is equivalent to app.Start() followed by app.Wait()

func (*Application) SetRootWidget

func (app *Application) SetRootWidget(widget views.Widget)

SetRootWidget sets the primary (root, main) Widget to be displayed.

func (*Application) SetScreen

func (app *Application) SetScreen(scr tcell.Screen)

SetScreen sets the screen to use for the application. This must be done before the application starts to run or is initialized.

func (*Application) SetStyle

func (app *Application) SetStyle(style tcell.Style)

SetStyle sets the default style (background) to be used for Widgets that have not specified any other style.

func (*Application) Start

func (app *Application) Start()

Start starts the application loop, initializing the screen and starting the Event loop. The application will run in a goroutine until Quit is called.

func (*Application) Update

func (app *Application) Update()

Update asks the application to draw any screen updates that have not been drawn yet.

func (*Application) Wait

func (app *Application) Wait() error

Wait waits until the application finishes.

Jump to

Keyboard shortcuts

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