widgets

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrowDown

func ArrowDown(g *gocui.Gui, v *gocui.View) error

func ArrowUp

func ArrowUp(g *gocui.Gui, v *gocui.View) error

Types

type DropDown struct {
	*Panel
	Select   *Select
	ViewName string
	InputLen int
	Value    string
	Text     string
	// contains filtered or unexported fields
}

func NewDropDown

func NewDropDown(g *gocui.Gui, name, label string, getOptionsFunc GetOptionsFunc) (*DropDown, error)
func (d *DropDown) Close() error
func (d *DropDown) GetData() (string, error)
func (d *DropDown) GetMultiData() []string
func (d *DropDown) SetData(data string) error
func (d *DropDown) SetMulti(multi bool)
func (d *DropDown) Show() error

type Element

type Element interface {
	Show() error
	Close() error
	GetData() (string, error)
	SetContent(string)
	SetLocation(int, int, int, int)
}

type GetOptionsFunc

type GetOptionsFunc func() ([]Option, error)

type Input

type Input struct {
	*Panel
	Value string
	Mask  bool
}

func NewInput

func NewInput(g *gocui.Gui, name string, label string, mask bool) (*Input, error)

func (*Input) Close

func (i *Input) Close() error

func (*Input) GetData

func (i *Input) GetData() (string, error)

func (*Input) SetData

func (i *Input) SetData(data string) error

func (*Input) Show

func (i *Input) Show() error

type Option

type Option struct {
	Value string
	Text  string
}

type Panel

type Panel struct {
	Name       string
	Title      string
	Frame      bool
	Wrap       bool
	Focus      bool
	FgColor    gocui.Attribute
	Content    string
	X0         int
	X1         int
	Y0         int
	Y1         int
	Autoscroll bool

	// Hook functions
	PreShow   func() error
	PostClose func() error

	KeyBindings    map[gocui.Key]func(*gocui.Gui, *gocui.View) error
	KeyBindingTips map[string]string
	FirstPage      bool
	// contains filtered or unexported fields
}

func NewPanel

func NewPanel(g *gocui.Gui, name string) *Panel

func (*Panel) Close

func (p *Panel) Close() error

func (*Panel) GetData

func (p *Panel) GetData() (string, error)

func (*Panel) GetName

func (p *Panel) GetName() string

func (*Panel) SetContent

func (p *Panel) SetContent(content string)

func (*Panel) SetLocation

func (p *Panel) SetLocation(x0, y0, x1, y1 int)

func (*Panel) Show

func (p *Panel) Show() error

type Select

type Select struct {
	*Panel
	Value string
	// contains filtered or unexported fields
}

func NewSelect

func NewSelect(g *gocui.Gui, name string, text string, getOptionsFunc GetOptionsFunc) (*Select, error)

func (*Select) Close

func (s *Select) Close() error

func (*Select) GetData

func (s *Select) GetData() (string, error)

func (*Select) GetMultiData added in v0.2.3

func (s *Select) GetMultiData() []string

func (*Select) SetData

func (s *Select) SetData(data string) error

func (*Select) SetMulti added in v0.2.3

func (s *Select) SetMulti(multi bool)

func (*Select) Show

func (s *Select) Show() error

Jump to

Keyboard shortcuts

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