Documentation
¶
Index ¶
- Constants
- Variables
- func Hidden() layoutItemOption
- func NewFixedItem(size int, name string, opts ...layoutItemOption) *layoutItem
- func NewLevel(direction LayoutDirection, items ...*layoutItem) *layoutLevel
- func NewRatioItem(weight int, name string, opts ...layoutItemOption) *layoutItem
- func WithCreate(f func(*gocui.View) error) layoutItemOption
- func WithInner(inner *layoutLevel) layoutItemOption
- func WithUpdate(f func(*gocui.View) error) layoutItemOption
- type HideLayout
- type LayoutDirection
Constants ¶
const ( LayoutHorizontal LayoutDirection = true LayoutVertical LayoutDirection = false LayoutHidden HideLayout = true LayoutVisible HideLayout = false )
Variables ¶
var InvalidValues = fmt.Errorf("Fixes and Ratio parameters are not compatible")
InvalidValues is an error returned when both fixes and ratios are specified for the same item.
var NotFound = fmt.Errorf("Item not found")
NotFound is an error returned when an item referenced by name does not exist.
Functions ¶
func Hidden ¶
func Hidden() layoutItemOption
Hidden is an item option indicating a given item should not be visible.
func NewFixedItem ¶
NewFixedItem create a new item with the specified number of lines/columns.
func NewLevel ¶
func NewLevel(direction LayoutDirection, items ...*layoutItem) *layoutLevel
NewLevel create a new set of items to be spread either horizontally or vertically.
func NewRatioItem ¶
NewRatioItem creates a new item, that is to take a given ratio of the total available space.
func WithCreate ¶
WithCreate passes a function that will be called once a new view is created. It is called only once per view.
func WithInner ¶
func WithInner(inner *layoutLevel) layoutItemOption
WithInner is used when an item is to contain other items, rather than views.
func WithUpdate ¶
WithUpdate passes a function that is called each time the layout is rendered.
Types ¶
type HideLayout ¶
type HideLayout bool
HideLayout identifies if an item should be hidden or visible.
type LayoutDirection ¶
type LayoutDirection bool
LayoutDirection controls if layout items are spread horizontally or vertically.