pane

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseSpec

type BaseSpec struct {
	Name string
	Icon string
}

func (BaseSpec) GetIcon

func (s BaseSpec) GetIcon() string

func (BaseSpec) GetName

func (s BaseSpec) GetName() string

func (BaseSpec) NewFromSpec

func (s BaseSpec) NewFromSpec(ctx *context.ProgramContext, spec PaneSpec) Pane

type Pane

type Pane interface {
	Update(tea.Msg) (model Pane, cmd tea.Cmd, consumed bool)
	View() string
	GetSpec() PaneSpec
	SetSize(width int, height int)
	Hide() // Called when the pane is not visible
}

func New

func New(spec PaneSpec) Pane

type PaneModel

type PaneModel struct {
	Spec PaneSpec
}

func (PaneModel) GetSpec

func (m PaneModel) GetSpec() PaneSpec

func (PaneModel) Hide

func (m PaneModel) Hide()

func (PaneModel) Init

func (m PaneModel) Init() tea.Cmd

func (PaneModel) SetSize

func (m PaneModel) SetSize(width int, height int)

func (PaneModel) Update

func (m PaneModel) Update(msg tea.Msg) (Pane, tea.Cmd, bool)

func (PaneModel) View

func (m PaneModel) View() string

type PaneSpec

type PaneSpec interface {
	NewFromSpec(ctx *context.ProgramContext, spec PaneSpec) Pane
	GetName() string
	GetIcon() string
}

Jump to

Keyboard shortcuts

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