console

package
v0.0.0-...-1b8aa50 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2018 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrContainerNotFound = errors.New("Container not found")
	ErrElemNotFound      = errors.New("Element not found")
	ErrElemIncorrectType = errors.New("Element incorrect type")
)
View Source
var (
	ErrPageNotFound = errors.New("Page not found")
)

Functions

This section is empty.

Types

type App

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

func NewApp

func NewApp() *App

func (*App) GetPages

func (a *App) GetPages() *Pages

func (*App) GetToolbar

func (a *App) GetToolbar() *Toolbar

type Page

type Page struct {
	*tview.Flex

	Name string
	Data interface{}
	// contains filtered or unexported fields
}

func NewPage

func NewPage(name string) *Page

func (*Page) AddContainer

func (p *Page) AddContainer(parent string, name string, direction int, size int, proportion int, focus bool) error

func (*Page) AddItem

func (p *Page) AddItem(container string, name string, item interface{}, size int, proportion int, focus bool) error

func (*Page) GetContainer

func (p *Page) GetContainer(name string) (*tview.Flex, error)

func (*Page) GetElemBox

func (p *Page) GetElemBox(name string) (*tview.Box, error)

func (*Page) GetElemButton

func (p *Page) GetElemButton(name string) (*tview.Button, error)

func (*Page) GetElemCheckbox

func (p *Page) GetElemCheckbox(name string) (*tview.Checkbox, error)

func (*Page) GetElemDropDown

func (p *Page) GetElemDropDown(name string) (*tview.DropDown, error)

func (*Page) GetElemFlex

func (p *Page) GetElemFlex(name string) (*tview.Flex, error)

func (*Page) GetElemForm

func (p *Page) GetElemForm(name string) (*tview.Form, error)

func (*Page) GetElemFrame

func (p *Page) GetElemFrame(name string) (*tview.Frame, error)

func (*Page) GetElemInputField

func (p *Page) GetElemInputField(name string) (*tview.InputField, error)

func (*Page) GetElemList

func (p *Page) GetElemList(name string) (*tview.List, error)

func (*Page) GetElemModal

func (p *Page) GetElemModal(name string) (*tview.Modal, error)

func (*Page) GetElemPages

func (p *Page) GetElemPages(name string) (*tview.Pages, error)

func (*Page) GetElemTable

func (p *Page) GetElemTable(name string) (*tview.Table, error)

func (*Page) GetElemTableCell

func (p *Page) GetElemTableCell(name string) (*tview.TableCell, error)

func (*Page) GetElemTextView

func (p *Page) GetElemTextView(name string) (*tview.TextView, error)

func (*Page) RemoveContainer

func (p *Page) RemoveContainer(parent string, name string) error

func (*Page) RemoveItem

func (p *Page) RemoveItem(container string, name string) error

func (*Page) SetContainerDirection

func (p *Page) SetContainerDirection(container string, direction int) error

type Pages

type Pages struct {
	*tview.Pages
	// Current selected page
	CurrentPage string
	// contains filtered or unexported fields
}

Page is a embedded type of tview.Page with 2 more fields: the current selected page and a page list

func NewPages

func NewPages() *Pages

NewPages returns a new Pages

func (*Pages) AddPage

func (p *Pages) AddPage(name string, page *Page, resize bool, visible bool)

AddPage adds a new page to tview.Pages and page list

func (*Pages) GetPage

func (p *Pages) GetPage(name string) (*Page, error)

GetPage returns the page corresponding to the given name if the page is in tview.Pages slice and page list

func (*Pages) RemovePage

func (p *Pages) RemovePage(name string)

RemovePage deletes the page corresponding to the given name if it exists

func (*Pages) SwitchToNextPage

func (p *Pages) SwitchToNextPage()

SwitchToNextPage switchs to the next page of the current page

func (*Pages) SwitchToPage

func (p *Pages) SwitchToPage(name string)

SwitchToPage switchs to the page corresponding to the given name

func (*Pages) SwitchToPrevPage

func (p *Pages) SwitchToPrevPage()

SwitchToPrevPage switchs to the prev page of the current page

type Toolbar

type Toolbar struct {
	*tview.Flex
}

func NewToolbar

func NewToolbar() *Toolbar

func (*Toolbar) AddButton

func (toolbar *Toolbar) AddButton(button *tview.Button, size int)

Jump to

Keyboard shortcuts

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