ui

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorNoFocusedEntry = errors.New("no entry focused in main window")
)

Functions

This section is empty.

Types

type CommandBar

type CommandBar struct {
	tview.Flex
	// contains filtered or unexported fields
}

func NewCommandBar

func NewCommandBar(ctx context.Context) *CommandBar

func (*CommandBar) OnAutocomplete

func (c *CommandBar) OnAutocomplete(handler func(string) string)

func (*CommandBar) OnCommand

func (c *CommandBar) OnCommand(handler func(string, ...string))

func (*CommandBar) SetBackgroundColor

func (c *CommandBar) SetBackgroundColor(color tcell.Color) *tview.Box

func (*CommandBar) SetDoneFunc

func (c *CommandBar) SetDoneFunc(done func(tcell.Key))

func (*CommandBar) SetTitle

func (c *CommandBar) SetTitle(title string)

type Croppable

type Croppable interface {
	Crop(size int) string
}

type Window

type Window[T Croppable] struct {
	// contains filtered or unexported fields
}

func NewMainWindow

func NewMainWindow[T Croppable](screen tcell.Screen, getEntries func() *[]T, ctx context.Context) *Window[T]

func (*Window[T]) GetFocusedEntry

func (w *Window[T]) GetFocusedEntry() (*T, error)

func (*Window[T]) OnAutocomplete

func (w *Window[T]) OnAutocomplete(handler func(string) string)

func (*Window[T]) OnCommand

func (w *Window[T]) OnCommand(handler func(string, ...string))

func (*Window[T]) OnEntryFocused

func (w *Window[T]) OnEntryFocused(handler func(e T))

func (*Window[T]) OnEntrySelected

func (w *Window[T]) OnEntrySelected(handler func(e T))

func (*Window[T]) OnInputChanged

func (w *Window[T]) OnInputChanged(handler func(input string, entries []T))

func (*Window[T]) Reset

func (w *Window[T]) Reset()

func (*Window[T]) Run

func (w *Window[T]) Run() error

func (*Window[T]) SetEntries

func (w *Window[T]) SetEntries(es *[]T)

func (*Window[T]) SetFooterText

func (w *Window[T]) SetFooterText(info string)

func (*Window[T]) SetPreview

func (w *Window[T]) SetPreview(text string)

func (*Window[T]) SetTitle

func (w *Window[T]) SetTitle(title string)

func (*Window[T]) Stop added in v0.10.3

func (w *Window[T]) Stop()

func (*Window[T]) SuspendWith

func (w *Window[T]) SuspendWith(f func())

func (*Window[T]) UpdateWith

func (w *Window[T]) UpdateWith(f func())

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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