vxlayout

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT, Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FlexDirection

type FlexDirection int
const (
	FlexHorizontal FlexDirection = iota
	FlexVertical
)

type FlexItem

type FlexItem struct {
	vxfw.Widget

	// Flex determines how much space the widget takes in the layout.
	// Flex of 0 means the widget will be its inherent size.
	// Remaining space is divided proportionally to all FlexItems with Flex > 0
	Flex uint8
}

FlexItem is a vxfw.Widget used in a FlexLayout

func MustSpacer

func MustSpacer(flex uint8) *FlexItem

MustSpacer is like NewSpacer, but panics if flex is less than 1.

func NewSpacer

func NewSpacer(flex uint8) (*FlexItem, error)

NewSpacer returns a FlexItem that fills available flex space based on the value of flex. It is an error to pass a flex less than 1.

type FlexLayout

type FlexLayout struct {
	Children  []*FlexItem
	Direction FlexDirection
}

func (*FlexLayout) Draw

func (w *FlexLayout) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error)

func (*FlexLayout) HandleEvent

func (w *FlexLayout) HandleEvent(_ vaxis.Event, _ vxfw.EventPhase) (vxfw.Command, error)

type Spacer

type Spacer struct{}

Spacer is a vxfw.Widget that takes up available space. It should be used in a FlexItem with a flex of at least 1. Use NewSpacer or MustSpacer for a FlexItem that can be passed directly to FlexLayout

func (Spacer) Draw

func (s Spacer) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error)

func (Spacer) HandleEvent

func (s Spacer) HandleEvent(_ vaxis.Event, _ vxfw.EventPhase) (vxfw.Command, error)

Jump to

Keyboard shortcuts

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