Documentation
ΒΆ
Index ΒΆ
- Constants
- type Layout
- func (b *Layout) AddLeaf(address string, model tea.Model) (Node, error)
- func (b *Layout) EditLeaf(address string, editFunc func(tea.Model) (tea.Model, error)) error
- func (b *Layout) Init() tea.Cmd
- func (b *Layout) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (b *Layout) UpdateSize(size tea.WindowSizeMsg) error
- func (b *Layout) View() string
- type Node
- type NotFoundError
- type Orientation
- type SizeError
- type SizeFunc
Constants ΒΆ
const ( // NEWLINE is used to separat the lines NEWLINE = "\n" // SPACE is used to fill up the lines, make sure it is only one column wide and a single character SPACE = " " // HorizontalSeparator is used to make a visible border between the horizontal arranged children // in the layout-tree, make sure it is only one column wide and a single character HorizontalSeparator = "β" // VerticalSeparator is used to make a visible border between the vertical arranged children // in the layout-tree, make sure it is only one column wide and a single character VerticalSeparator = "β" )
Variables ΒΆ
This section is empty.
Functions ΒΆ
This section is empty.
Types ΒΆ
type Layout ΒΆ
type Layout struct {
// contains filtered or unexported fields
}
Layout is a way to render multiple `tea.Modelβs in a specific layout. The models are kept separate from the layout tree so that changing a Model does not require traversing the tree.
func (*Layout) EditLeaf ΒΆ
EditLeaf is a saver way to interact with the Leafs, since it can not be forgotten to save back the Model after changing. If the editFunc returns an error the Model is not saved.
func (*Layout) UpdateSize ΒΆ
func (b *Layout) UpdateSize(size tea.WindowSizeMsg) error
UpdateSize set the width and height of all Node's
type Node ΒΆ
type Node struct {
// contains filtered or unexported fields
}
Node is a node in a layout tree.
func (*Node) GetAddress ΒΆ
GetAddress returns the Address of the Node The address of a Node is only settable through CreateLeaf
func (*Node) SetSizeFunc ΒΆ
SetSizeFunc sets the function that defines the dynamic width or height of children nodes.
type Orientation ΒΆ
type Orientation uint8
Orientation specifies the rendering orientation.
const ( Horizontal Orientation = iota + 1 Vertical )