tviewapp

package module
v0.0.0-...-553c703 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BubbleOff  = 0 // no 'bubble' check. so any element that can hit, is hitted
	BubbleDown = 1 // only the last element on the list (what means it is visual on top) can be hit
	BubbleUp   = 2 // reverse to BubleDown. means the first element (first drawn so visual in the background) only
)
View Source
const (
	// default events
	EventOnStart = "OnStart"
	EventOnInit  = "OnInit"

	// defaut templates
	TplPageButtonMenu = 1
)

Variables

View Source
var (
	ButtonMenuPageStyle tvPageStyle = tvPageStyle{/* contains filtered or unexported fields */}
)

Functions

func CESizeToCoords

func CESizeToCoords(cs CeSize) (int, int, int, int)

convert CESize to screen coordinates

func CreateButtonBarPage

func CreateButtonBarPage(style tvPageStyle) tview.Primitive

func CreatePageByStyle

func CreatePageByStyle(style tvPageStyle) tview.Primitive

func RegisterTemplate

func RegisterTemplate(styleId int, clbck func(tvPageStyle) tview.Primitive)

Types

type CECard

type CECard struct {
	OnMouseOver  func(x, y int)
	OnMouseLeave func()
	// contains filtered or unexported fields
}

func NewCard

func NewCard(title string) *CECard

func (*CECard) GetBehavior

func (card *CECard) GetBehavior() CElementBehavior

func (*CECard) SetDim

func (card *CECard) SetDim(left, top, width, height int)

func (*CECard) SetOffset

func (card *CECard) SetOffset(left, top int)

type CEListener

type CEListener struct {
	OnLMouseDown func(*CellApp, int, int)
	OnLMouseUp   func(*CellApp, int, int, int, int)
}

type CElement

type CElement interface {
	SetDim(left, top, width, height int)
	GetBehavior() CElementBehavior
	// contains filtered or unexported methods
}

type CElementBehavior

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

Defines the behavior of the element

type CeBox

type CeBox struct {
	OnMouseOver  func(x, y int)
	OnMouseLeave func()
	// contains filtered or unexported fields
}

func NewBox

func NewBox() *CeBox

func (*CeBox) GetBehavior

func (box *CeBox) GetBehavior() CElementBehavior

func (*CeBox) SetDim

func (box *CeBox) SetDim(left, top, width, height int)

func (*CeBox) SetOffset

func (box *CeBox) SetOffset(left, top int)

type CeSize

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

type CeString

type CeString struct {
	OnMouseOver  func(x, y int)
	OnMouseLeave func()
	// contains filtered or unexported fields
}

func NewText

func NewText(text string) *CeString

func NewTextLine

func NewTextLine(text string, width int) *CeString

func (*CeString) GetBehavior

func (str *CeString) GetBehavior() CElementBehavior

func (*CeString) SetDim

func (str *CeString) SetDim(left, top, width, height int)

func (*CeString) SetOffset

func (str *CeString) SetOffset(left, top int)

func (*CeString) SetText

func (str *CeString) SetText(text string)

type CellApp

type CellApp struct {
	Listener CEListener
	// contains filtered or unexported fields
}

func New

func New() *CellApp

func (*CellApp) AddElement

func (c *CellApp) AddElement(el ...CElement)

AddElement adds visiual component to the application because it is added last, it be displayed on top

func (*CellApp) Exit

func (c *CellApp) Exit()

func (*CellApp) NewScreen

func (c *CellApp) NewScreen()

func (*CellApp) RunLoop

func (c *CellApp) RunLoop(exitCallBack func())

type TViewApplication

type TViewApplication struct {
	OnStart *trigger.Event
	OnInit  *trigger.Event
	// contains filtered or unexported fields
}

func NewApplication

func NewApplication(fullscreen bool) *TViewApplication

NewApplication creates a new Application with some default settings so it adds a main frame that includes some pages

func (*TViewApplication) GetPages

func (t *TViewApplication) GetPages() *tview.Pages

func (*TViewApplication) NewPage

func (t *TViewApplication) NewPage(name string, style tvPageStyle, args ...interface{}) error

func (*TViewApplication) NewPageWithFlex

func (t *TViewApplication) NewPageWithFlex(name string) *tview.Flex

func (*TViewApplication) SetHeader

func (t *TViewApplication) SetHeader(header string)

func (*TViewApplication) Start

func (t *TViewApplication) Start() (*TViewApplication, error)

Start executes the Application and send the initial events

func (*TViewApplication) Stop

func (t *TViewApplication) Stop()

type TvButton

type TvButton struct {
	OnClick func()
	OnFocus func()
	Label   string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳