buttons

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int
const (
	DOWNLOAD Action = iota
	DOWNLOAD_EXTRACT
)

type ActionState

type ActionState int
const (
	ACTION_IDOL ActionState = iota
	ACTION_SUCCESS
	ACTION_FAILED
	ACTION_RESET
)

type ActionStateMessage added in v0.0.8

type ActionStateMessage struct {
	Message string
	State   ActionState
}

type Button

type Button struct {
	Name   string
	Action Action
}

type KeyMap

type KeyMap struct {
	NEXT   key.Binding
	PREV   key.Binding
	SUBMIT key.Binding
}

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

type Model

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

func New

func New(buttons ...Button) Model

func (Model) FullHelp

func (m Model) FullHelp() [][]key.Binding

func (Model) GetSize

func (m Model) GetSize() (h, v int)

func (*Model) SetSize

func (m *Model) SetSize(h, v int)

func (Model) ShortHelp

func (m Model) ShortHelp() []key.Binding

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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