splitview

package
v0.0.52 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Orientation

type Orientation int

Orientation describes whether panes are arranged left/right or top/bottom.

const (
	Horizontal Orientation = iota
	Vertical
)

type PositionChange added in v0.0.25

type PositionChange struct {
	Geometry SplitGeometry
	Reason   PositionChangeReason
}

PositionChange is delivered after an observable split-position change.

type PositionChangeReason added in v0.0.25

type PositionChangeReason string

PositionChangeReason identifies why pane geometry changed.

const (
	ChangeProgrammatic PositionChangeReason = "programmatic"
	ChangeDrag         PositionChangeReason = "drag"
	ChangeResize       PositionChangeReason = "resize"
)

type PositionPolicy added in v0.0.25

type PositionPolicy int

PositionPolicy controls what remains stable when the split view is resized.

const (
	PreserveRatio PositionPolicy = iota
	PreserveLeadingSize
	PreserveTrailingSize
)

type SplitGeometry added in v0.0.25

type SplitGeometry struct {
	Leading  int
	Divider  int
	Trailing int
	Ratio    float64
}

SplitGeometry reports pane sizes along the split axis.

type SplitView

type SplitView struct {
	// contains filtered or unexported fields
}

SplitView is a native two-pane container with a draggable divider.

func New

func New(x, y, width, height int, orientation Orientation) *SplitView

New creates a split view. Horizontal arranges left/right panes; Vertical arranges top/bottom panes.

func (*SplitView) AddSubview

func (sv *SplitView) AddSubview(child view.Viewable)

func (*SplitView) DividerView added in v0.0.25

func (sv *SplitView) DividerView() *view.UIView

DividerView exposes divider automation and appearance hooks.

func (*SplitView) Geometry added in v0.0.25

func (sv *SplitView) Geometry() SplitGeometry

Geometry returns current sizes along the split axis.

func (*SplitView) LeadingPane added in v0.0.25

func (sv *SplitView) LeadingPane() *view.UIView

LeadingPane returns the stable internal leading-pane container.

func (*SplitView) On

func (sv *SplitView) On(event fltk_bridge.Event, handler func(fltk_bridge.Event) bool)

func (*SplitView) OnPositionChanged added in v0.0.25

func (sv *SplitView) OnPositionChanged(handler func(PositionChange))

OnPositionChanged installs the split-position callback.

func (*SplitView) Position

func (sv *SplitView) Position() float64

Position returns the current leading position as a ratio of total extent.

func (*SplitView) PositionPixels added in v0.0.25

func (sv *SplitView) PositionPixels() int

PositionPixels returns the leading pane size in pixels.

func (*SplitView) Raw

func (sv *SplitView) Raw() fltk_bridge.Widget

func (*SplitView) Resizable

func (sv *SplitView) Resizable() bool

Resizable reports whether divider dragging is enabled.

func (*SplitView) SetAutomationID added in v0.0.25

func (sv *SplitView) SetAutomationID(id string) *SplitView

SetAutomationID assigns stable IDs to the split view and its parts.

func (*SplitView) SetDividerColors added in v0.0.25

func (sv *SplitView) SetDividerColors(normal, hover, active uint)

SetDividerColors configures normal, hover, and active divider colors.

func (*SplitView) SetDividerSize added in v0.0.25

func (sv *SplitView) SetDividerSize(size int)

SetDividerSize configures the divider thickness in pixels.

func (*SplitView) SetLeftView

func (sv *SplitView) SetLeftView(content view.Viewable)

SetLeftView sets the leading (left/top) pane content.

func (*SplitView) SetLeftViewFixed

func (sv *SplitView) SetLeftViewFixed(size int)

SetLeftViewFixed preserves a fixed leading size across parent resizes.

func (*SplitView) SetMinimumSizes added in v0.0.25

func (sv *SplitView) SetMinimumSizes(leading, trailing int)

SetMinimumSizes configures independent leading and trailing minima.

func (*SplitView) SetPosition

func (sv *SplitView) SetPosition(pos float64)

SetPosition sets a ratio-based position and preserves that ratio on resize.

func (*SplitView) SetPositionPixels added in v0.0.25

func (sv *SplitView) SetPositionPixels(position int)

SetPositionPixels sets the leading pane size in pixels.

func (*SplitView) SetPositionPolicy added in v0.0.25

func (sv *SplitView) SetPositionPolicy(policy PositionPolicy)

SetPositionPolicy changes resize behavior without changing current geometry.

func (*SplitView) SetResizable

func (sv *SplitView) SetResizable(enabled bool)

SetResizable enables or disables divider dragging.

func (*SplitView) SetRightView

func (sv *SplitView) SetRightView(content view.Viewable)

SetRightView sets the trailing (right/bottom) pane content.

func (*SplitView) SetRightViewFixed

func (sv *SplitView) SetRightViewFixed(size int)

SetRightViewFixed preserves a fixed trailing size across parent resizes.

func (*SplitView) TrailingPane added in v0.0.25

func (sv *SplitView) TrailingPane() *view.UIView

TrailingPane returns the stable internal trailing-pane container.

func (*SplitView) View

func (sv *SplitView) View() *view.UIView

Jump to

Keyboard shortcuts

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