textinput

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoComplete

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

func NewAutoComplete

func NewAutoComplete(vx *vaxis.Vaxis, complete func(string) []string) *AutoComplete

func (*AutoComplete) Draw

func (a *AutoComplete) Draw(win vaxis.Window)

func (*AutoComplete) Update

func (a *AutoComplete) Update(msg vaxis.Event)
type MenuComplete struct {
	// contains filtered or unexported fields
}

func NewMenuComplete

func NewMenuComplete(complete func(string) []string) *MenuComplete
func (m *MenuComplete) Draw(win vaxis.Window)
func (m *MenuComplete) Update(msg vaxis.Event)

type Model

type Model struct {
	Content vaxis.Style
	Prompt  vaxis.Style
	// HideCursor tells the textinput not to draw the cursor
	HideCursor bool
	// contains filtered or unexported fields
}

func New

func New() *Model

func (*Model) Characters added in v0.5.0

func (m *Model) Characters() []vaxis.Character

Characters returns the characters of the content

func (*Model) CursorPosition added in v0.5.0

func (m *Model) CursorPosition() int

CursorPosition returns the cursor position, in characters. A cursor position of '0' means the cursor is at the beginning of the line

func (*Model) Draw

func (m *Model) Draw(win vaxis.Window)

func (*Model) SetContent

func (m *Model) SetContent(s string) *Model

func (*Model) SetInvisibleChar added in v0.6.3

func (m *Model) SetInvisibleChar(s string) *Model

SetInvisibleChar will use the first character of s to be displayed in the textinput field instead of the pressed keys (password mode).

func (*Model) SetPrompt

func (m *Model) SetPrompt(s string) *Model

func (*Model) String

func (m *Model) String() string

func (*Model) Update

func (m *Model) Update(msg vaxis.Event)

Jump to

Keyboard shortcuts

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