Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerNode ¶
type ContainerNode struct {
Children []Node
BgColor fltk_bridge.Color
Padding int
Spacing int
IsHorizontal bool
// contains filtered or unexported fields
}
ContainerNode holds multiple child nodes and manages their layout.
func NewContainerNode ¶
func NewContainerNode() *ContainerNode
func (*ContainerNode) AddChild ¶
func (c *ContainerNode) AddChild(node Node)
func (*ContainerNode) Bounds ¶
func (c *ContainerNode) Bounds() Rect
func (*ContainerNode) Draw ¶
func (c *ContainerNode) Draw(viewport Rect)
func (*ContainerNode) Layout ¶
func (c *ContainerNode) Layout(x, y int)
type Engine ¶
type Engine struct {
Root Node
}
Engine acts as the top-level renderer for a Virtual Layout Tree.
type LayoutView ¶
type LayoutView struct {
// contains filtered or unexported fields
}
LayoutView wraps an Engine into a standard Viewable component, so it can receive events via On() and be added via AddSubview().
func NewLayoutView ¶
func NewLayoutView(x, y, w, h int, engine *Engine) *LayoutView
NewLayoutView creates a LayoutView.
func (*LayoutView) On ¶
func (lv *LayoutView) On(event fltk_bridge.Event, handler func(fltk_bridge.Event) bool)
On delegates event binding to the underlying UIView
func (*LayoutView) Raw ¶
func (lv *LayoutView) Raw() fltk_bridge.Widget
func (*LayoutView) View ¶
func (lv *LayoutView) View() *view.UIView
type Node ¶
type Node interface {
Measure(maxWidth int) (int, int)
Layout(x, y int)
Draw(viewport Rect)
Bounds() Rect
}
Node is an element in the Virtual Layout Tree. It decouples Measure, Layout, and Draw phases for high performance.
type Rect ¶
type Rect struct {
X, Y, W, H int
}
Rect represents a bounding box in 2D space.
func (Rect) Intersects ¶
Intersects checks if two rectangles overlap.
type TextNode ¶
type TextNode struct {
Text string
Font fltk_bridge.Font
FontSize int
Color fltk_bridge.Color
Align fltk_bridge.Align
LineHeight int
// contains filtered or unexported fields
}
TextNode is a leaf node that renders text using cached text segments.
func NewTextNode ¶
func NewTextNode(text string, font fltk_bridge.Font, fontSize int, color fltk_bridge.Color) *TextNode
type ViewNode ¶
type ViewNode struct {
View view.Viewable
// Optional fixed size constraints. If 0, it uses the widget's current size.
FixedWidth int
FixedHeight int
// contains filtered or unexported fields
}
ViewNode is a leaf node that wraps an existing Viewable component. It manages the position and size of the underlying FLTK widget during layout.