views

package
v0.0.0-...-156aff2 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2019 License: MIT Imports: 4 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 {
	*tview.Application
	// contains filtered or unexported fields
}

Application represents whole TUI application.

func NewApplication

func NewApplication() *Application

NewApplication initializes and returns Application.

func (*Application) Run

func (app *Application) Run() error

Run starts TUI application.

func (*Application) Subscribe

func (app *Application) Subscribe(store *todo.Store)

Subscribe subscribes to the update of todos.

func (*Application) Update

func (app *Application) Update(todos []todo.Todo)

Update updates views along with given todos.

type Description

type Description struct {
	*tview.Flex

	IsShown bool
	// contains filtered or unexported fields
}

Description represents a view to display the description of a TODO.

func NewDescription

func NewDescription() *Description

NewDescription returns a new Description.

func (*Description) SetText

func (d *Description) SetText(text string)

SetText sets given text to body.

type Form

type Form struct {
	*tview.Form
}

Form represents a form to save a TODO.

func NewForm

func NewForm(handler func()) *Form

NewForm returns a new Form.

type Table

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

Table represents a table to list TODOs.

func NewTable

func NewTable() *Table

NewTable returns a new Table.

func (*Table) SetInputCapture

func (table *Table) SetInputCapture(f func(todo.Todo, *tcell.EventKey) *tcell.EventKey)

SetInputCapture sets wrapper function to pass selected todo to original function.

func (*Table) SetSelectedFunc

func (table *Table) SetSelectedFunc(f func(todo.Todo))

SetSelectedFunc sets wrapper function to pass selected todo to original function.

func (*Table) SetSelectionChangedFunc

func (table *Table) SetSelectionChangedFunc(f func(todo todo.Todo))

SetSelectionChangedFunc sets wrapper function to pass selected todo to original function.

func (*Table) Update

func (table *Table) Update(todos []todo.Todo)

Update updates rows along with given todos.

Jump to

Keyboard shortcuts

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