package ui
Constants
EventTypeInvalid
EventType(iota)
EventTypeEnter
EventTypeMove
EventTypeExit
EventTypeClick
EventTypeRightClick
EventTypeDoubleClick
EventTypeDown
EventTypeUp
EventTypeRightDown
EventTypeRightUp
EventTypeMiss
EventTypeDragStart
EventTypeDrop
EventTypeDropEnter
EventTypeDropExit
EventTypeDragEnd
EventTypeScroll
EventTypeRebuild
EventTypeDestroy
EventTypeFocus
EventTypeBlur
EventTypeSubmit
EventTypeChange
EventTypeRender
EventTypeKeyDown
EventTypeKeyUp
EventTypeEnd
InputTypeDefault
iota
InputTypeText
InputTypeNumber
InputTypePhone
InputTypeDatetime
InputTypeEmail
InputTypePassword
PositioningStatic
Positioning(iota)
PositioningAbsolute
PositioningFixed
PositioningRelative
PositioningSticky
FlexAlignAuto
FlexAlign(iota)
FlexAlignStart
FlexAlignEnd
FlexAlignCenter
FlexAlignStretch
PanelScrollDirectionNone
0x00
PanelScrollDirectionVertical
0x01
PanelScrollDirectionHorizontal
0x02
PanelScrollDirectionBoth
0x03
BorderStyleNone
iota
BorderStyleHidden
BorderStyleDotted
BorderStyleDashed
BorderStyleSolid
BorderStyleDouble
BorderStyleGroove
BorderStyleRidge
BorderStyleInset
BorderStyleOutset
ContentFitNone
iota
ContentFitWidth
ContentFitHeight
ContentFitBoth
OverflowScroll
iota
OverflowVisible
OverflowHidden
LayoutModeFlow
LayoutMode(iota)
LayoutModeGrid
LayoutModeFlex
FlexDirectionRow
FlexDirection(iota)
FlexDirectionRowReverse
FlexDirectionColumn
FlexDirectionColumnReverse
FlexWrapNoWrap
FlexWrap(iota)
FlexWrapWrap
FlexWrapWrapReverse
FlexJustifyStart
FlexJustify(iota)
FlexJustifyEnd
FlexJustifyCenter
FlexJustifySpaceBetween
FlexJustifySpaceAround
FlexJustifySpaceEvenly
FlexAlignContentStart
FlexAlignContent(iota)
FlexAlignContentEnd
FlexAlignContentCenter
FlexAlignContentStretch
FlexAlignContentSpaceBetween
FlexAlignContentSpaceAround
FlexAlignContentSpaceEvenly
DirtyTypeNone
iota
DirtyTypeLayout
DirtyTypeResize
DirtyTypeGenerated
DirtyTypeColorChange
DirtyTypeScissor
DirtyTypeParent
DirtyTypeParentLayout
DirtyTypeParentResize
DirtyTypeParentGenerated
DirtyTypeParentReGenerated
DirtyTypeParentColorChange
DirtyTypeParentScissor
ElementTypeLabel
ElementType(iota)
ElementTypePanel
ElementTypeButton
ElementTypeCheckbox
ElementTypeImage
ElementTypeInput
ElementTypeProgressBar
ElementTypeSelect
ElementTypeSlider
ElementTypeTextArea
ElementTypeVirtualList
EntityDataName
"ui"
LabelFontSize
Variables
Types
BasicStylizer
struct
BorderStyle
Button
Button.Base
Button.ButtonData
Button.Init
Button.IsDisabled
Button.Label
Button.SetColor
Button.SetDisabled
Checkbox
Checkbox.Base
Checkbox.CheckboxData
Checkbox.Init
Checkbox.IsChecked
Checkbox.IsDisabled
Checkbox.SetChecked
Checkbox.SetCheckedWithoutEvent
Checkbox.SetDisabled
ContentFit
DirtyType
ElementType
EventType
FlexAlign
FlexAlignContent
FlexDirection
FlexJustify
FlexWrap
Group
struct
Group.Attach
Group.Detach
Group.HasRequests
Group.IsFocusedOnInput
Group.SetThreaded
Image
Image.Base
Image.Frame
Image.ImageData
Image.Init
Image.InitFlipbook
Image.InitSpriteSheet
func (s *Image) InitSpriteSheet(framesPerSecond float32, texture *rendering.Texture, jsonStr string)
Image.PlayAnimation
Image.SetFlipBookAnimation
Image.SetFrame
Image.SetFrameRate
Image.SetSpriteSheet
func (img *Image) SetSpriteSheet(framesPerSecond float32, texture *rendering.Texture, jsonStr string)
Image.SetTexture
Image.StopAnimation
Input
Input.Base
Input.Focus
Input.FontFace
Input.FontSize
Input.Init
Input.InputData
Input.InsertText
Input.IsDisabled
Input.IsFocused
Input.IsRequired
Input.IsValid
Input.RemoveFocus
Input.SelectAll
Input.SetBGColor
Input.SetCursorColor
Input.SetCursorOffset
Input.SetDescription
Input.SetDisabled
Input.SetFGColor
Input.SetFontFace
Input.SetFontSize
Input.SetFontStyle
Input.SetFontWeight
Input.SetLineHeight
Input.SetNextFocusedElement
Input.SetNextFocusedInput
Input.SetPlaceholder
Input.SetRequired
Input.SetSelectColor
Input.SetText
Input.SetTextWithoutEvent
Input.SetTitle
Input.SetType
Input.SetWrap
Input.Text
InputType
Label
Label.Base
Label.BoldRange
Label.CalculateMaxWidth
Label.ClearColorRanges
ClearColorRanges drops every persisted color range overlay on this label and re-runs the base color pass. Use this when a consumer wants to wipe all overlays without changing the underlying text.
Label.Clone
Label.ColorRange
Label.EnforceBGColor
Label.EnforceFGColor
Label.FontFace
Label.FontSize
Label.Hide
Label.Init
Label.Justify
Label.LabelData
Label.LetterSpacing
Label.LineHeight
Label.MaxWidth
Label.Measure
Label.SetBGColor
Label.SetBaseline
Label.SetColor
Label.SetFontFace
Label.SetFontSize
Label.SetFontStyle
Label.SetFontWeight
Label.SetJustify
Label.SetLetterSpacing
Label.SetLineHeight
Label.SetMaxWidth
Label.SetText
Label.SetTextOverflowEllipsis
Label.SetTransparentBackground
SetTransparentBackground enables opaque cutout text: pixels outside glyphs are discarded while glyph pixels are written through the opaque text pass. By default, transparent backgrounds are instead resolved to the parent's calculated solid color to preserve smooth anti-aliased edges.
Label.SetWidthAutoHeight
Label.SetWrap
Label.Show
Label.Text
Label.UnEnforceBGColor
Label.UnEnforceFGColor
Layout
struct
Layout.AlignSelf
Layout.Border
Layout.CalcOffset
Layout.ClearStyles
Layout.ContentSize
Layout.FlexBasis
Layout.FlexBasisAuto
Layout.FlexBasisPercent
Layout.FlexGrow
Layout.FlexOrder
Layout.FlexShrink
Layout.GridColumnEnd
Layout.GridColumnStart
Layout.GridRowEnd
Layout.GridRowStart
Layout.InnerOffset
Layout.LocalInnerOffset
Layout.Margin
Layout.Offset
Layout.Padding
Layout.PixelSize
Layout.Positioning
Layout.Scale
Layout.ScaleHeight
Layout.ScaleWidth
Layout.SetAlignSelf
Layout.SetBorder
Layout.SetFlexBasis
Layout.SetFlexBasisAuto
Layout.SetFlexGrow
Layout.SetFlexOrder
Layout.SetFlexShrink
Layout.SetGridColumn
Layout.SetGridRow
Layout.SetInnerOffset
Layout.SetInnerOffsetBottom
Layout.SetInnerOffsetLeft
Layout.SetInnerOffsetRight
Layout.SetInnerOffsetTop
Layout.SetLocalInnerOffset
Layout.SetMargin
Layout.SetOffset
Layout.SetOffsetX
Layout.SetOffsetY
Layout.SetPadding
Layout.SetPositioning
Layout.SetRowLayoutOffset
Layout.SetZ
Layout.Ui
Layout.Z
LayoutMode
LayoutStylizer
interface
LeftStylizer
struct
LeftStylizer.ProcessStyle
Manager
struct
Manager.Add
Manager.Clear
Manager.DisableUpdate
Manager.EnableUpdate
Manager.Hovered
Manager.Init
Manager.IsUpdateDisabled
Manager.Remove
Manager.Reserve
Manager.RootBackgroundColor
RootBackgroundColor is the opaque backdrop that the top of the UI tree composites against when computing calculated ("used") colors for halo-free font rendering. It is the color a root-level transparent element resolves to. Defaults to opaque black; a zero (fully transparent) value is treated as opaque black so the calculated-color chain is always grounded on an opaque backdrop.
Manager.SetRootBackgroundColor
SetRootBackgroundColor overrides the backdrop used for calculated colors and re-renders the root elements so the new value propagates down the tree.
Manager.Shutdown
Shutdown synchronously detaches the Manager from its host: removes its update from UIUpdater, detaches its Group from UILateUpdater, and removes its window-resize handler. It also clears any UI elements still owned by the Manager so the next Init starts clean.
This is safe to call when Manager hasn't been Init'd yet (no-op). It is also idempotent — calling it twice in a row tears down nothing the second time. After Shutdown the Manager can be Init'd again on the same or a different host.
Without this, calling Init twice on the same Manager (which happens when a workspace is disabled then re-enabled in the editor) leaves the previous update callback registered, so two goroutines race on the same Manager's iteration slices and panic with index-out-of-range.
Overflow
Panel
FirstPanelOnEntity
Panel.AddChild
Panel.AllowClickThrough
Panel.Background
Panel.Base
Panel.BorderColor
Panel.BorderSize
Panel.BorderStyle
Panel.CalculatedBGColor
CalculatedBGColor returns this panel's opaque "used" background color: its own fill (which may be partially or fully transparent) alpha-composited over its parent's calculated background, recursively up to the manager's opaque root backdrop. This is the actual color a child element or its text visually sits on. The font renderer uses it as the glyph-edge blend target so anti-aliasing produces no halo, regardless of how transparent the intervening panels are.
It is computed live by walking ancestors (cheap: tree depth is small and this only runs while the UI is dirty/cleaning). The result is opaque whenever the root backdrop is opaque (the default), which is why text composited onto it can be rendered fully opaque and halo-free.
Panel.Child
Panel.ClearLayoutStyles
Panel.Color
Panel.DisableDragScroll
Panel.DontFitContent
Panel.DontFitContentHeight
Panel.DontFitContentWidth
Panel.EnableDragScroll
Panel.EnforceColor
Panel.FitContent
Panel.FitContentHeight
Panel.FitContentWidth
Panel.FittingContent
Panel.FittingContentHeight
Panel.FittingContentWidth
Panel.Freeze
Panel.GetAspectRatio
Panel.GetMaxSize
Panel.GetMinSize
Panel.GetUsesBorderBox
Panel.GridCellWidth
GridCellWidth returns the computed width of a single grid column (based on current panel dimensions, column count, and gap). Used by CSS width % processing so children (e.g. div{width:100%}) fit their grid cell instead of full parent.
Panel.GridColumns
Panel.GridGap
Panel.HasBackground
Panel.HasEnforcedColor
Panel.Init
Panel.InsertChild
Panel.IsFlex
Panel.IsFrozen
Panel.IsGrid
Panel.IsScrolling
Panel.MaxScroll
Panel.OutlineColor
Panel.OutlineOffset
Panel.OutlineOutset
Panel.OutlineWidth
Panel.Overflow
Panel.PanelData
Panel.RemoveBackground
Panel.RemoveChild
Panel.ResetScroll
Panel.ScrollDirection
Panel.ScrollToChild
Panel.ScrollX
Panel.ScrollY
Panel.SetAspectRatio
Panel.SetBackground
Panel.SetBorderColor
Panel.SetBorderRadius
Panel.SetBorderRadiusBottomLeft
Panel.SetBorderRadiusBottomRight
Panel.SetBorderRadiusTopLeft
Panel.SetBorderRadiusTopRight
Panel.SetBorderSize
Panel.SetBorderStyle
Panel.SetColor
Panel.SetFlex
Panel.SetFlexAlignContent
Panel.SetFlexAlignItems
Panel.SetFlexDirection
Panel.SetFlexJustify
Panel.SetFlexWrap
Panel.SetFlowLayout
Panel.SetGrid
SetGrid enables CSS Grid-like layout with the given number of columns. Children will be placed in row-major order into the grid cells. Column widths are computed by dividing available width by columns (accounting for gaps). Use SetGridGap to control spacing between items. This works with the existing fit content and scrolling systems.
Panel.SetGridAutoColumns
Panel.SetGridAutoRows
Panel.SetGridGap
Panel.SetGridTemplateColumns
SetGridTemplateColumns configures explicit grid column widths. Positive values are fixed pixels, negative values are fr units.
Panel.SetMaterial
Panel.SetMaxHeight
Panel.SetMaxWidth
Panel.SetMinHeight
Panel.SetMinWidth
Panel.SetOutline
Panel.SetOverflow
Panel.SetScrollDirection
Panel.SetScrollX
Panel.SetScrollY
Panel.SetScrollbarsVisible
SetScrollbarsVisible toggles whether this panel's scroll bars are ever shown. Scrolling (wheel, drag, programmatic SetScrollY/SetScrollX) still works when hidden; only the visual bars are suppressed. Used by views that drive their scroll externally (e.g. a line-number gutter slaved to a sibling's scroll).
Panel.SetUseBlending
Panel.SetUsesBorderBox
Panel.UnEnforceColor
Panel.UnFreeze
PanelScrollDirection
Positioning
ProgressBar
ProgressBar.Base
ProgressBar.Init
ProgressBar.SetBGColor
ProgressBar.SetFGColor
ProgressBar.SetValue
ProgressBar.Value
RightStylizer
struct
RightStylizer.ProcessStyle
Select
Select.AddOption
Select.Base
Select.ClearOptions
Select.Init
Select.IsDisabled
Select.Name
Select.PickOption
Select.PickOptionByLabel
Select.PickOptionByLabelWithoutEvent
Select.PickOptionWithoutEvent
Select.SelectData
Select.SetColor
Select.SetDisabled
Select.SetOptionsColor
Select.SetTextColor
Select.Value
SelectOption
struct
SelectOptionArrowStylizer
struct
SelectOptionArrowStylizer.ProcessStyle
SelectOptionStylizer
struct
SelectOptionStylizer.ProcessStyle
SelectOptionTextStylizer
struct
SelectOptionTextStylizer.ProcessStyle
SelectTextStylizer
struct
SelectTextStylizer.ProcessStyle
ShaderData
struct
type ShaderData struct {
rendering.ShaderDataBase
UVs matrix.Vec4
FgColor matrix.Color
BgColor matrix.Color
Scissor matrix.Vec4
Size2D matrix.Vec4
BorderRadius matrix.Vec4
BorderSize matrix.Vec4
BorderColor [4]matrix.Color
BorderLen matrix.Vec2
OutlineColor matrix.Color
OutlineSize matrix.Vec2
}
ShaderData.Size
Slider
Slider.Base
Slider.Delta
Slider.Init
Slider.IsDisabled
Slider.SetBGColor
Slider.SetDisabled
Slider.SetFGColor
Slider.SetValue
Slider.SetValueWithoutEvent
Slider.SliderData
Slider.Value
StretchCenterStylizer
struct
StretchCenterStylizer.ProcessStyle
StretchHeightStylizer
struct
StretchHeightStylizer.ProcessStyle
StretchWidthStylizer
struct
StretchWidthStylizer.ProcessStyle
TextArea
TextArea.ApplyColorRange
ApplyColorRange colors a [start,end) rune range using flat (whole-document) rune offsets, for backward compatibility with the old single-string API. It maps the flat range onto the affected lines.
TextArea.Base
TextArea.ClearColorRanges
TextArea.ClearLineColorSpans
TextArea.CursorPosition
TextArea.Data
TextArea.Focus
TextArea.FontFace
TextArea.FontSize
TextArea.Init
TextArea.InsertText
TextArea.IsDisabled
TextArea.IsFocused
TextArea.IsReadOnly
TextArea.IsRequired
TextArea.IsValid
TextArea.Line
Line returns the text of logical line i (without its newline).
TextArea.LineCount
LineCount is the number of logical lines in the document.
TextArea.LineHeight
LineHeight is the rendered height of a single line (the fixed row height in no-wrap mode), which a companion gutter should match.
TextArea.MaxScrollY
MaxScrollY is the maximum vertical scroll offset.
TextArea.Redo
TextArea.RemoveFocus
TextArea.ScrollToLine
TextArea.ScrollY
ScrollY is the current vertical scroll offset (pixels from the top).
TextArea.SelectAll
TextArea.SelectedText
SelectedText returns the currently selected text (empty if no selection).
TextArea.SetBGColor
TextArea.SetCursorColor
TextArea.SetCursorLineColumn
TextArea.SetCursorOffset
TextArea.SetDisabled
TextArea.SetFGColor
TextArea.SetFontFace
TextArea.SetFontSize
TextArea.SetFontStyle
TextArea.SetFontWeight
TextArea.SetHighlightCurrentLine
TextArea.SetLetterSpacing
TextArea.SetLineColorSpans
SetLineColorSpans replaces the color spans for a single line (rune columns within the line). This is the per-line API the widget layer's virtualized highlighter uses.
TextArea.SetLineHeight
TextArea.SetLineSpansBulk
SetLineSpansBulk replaces ALL per-line color spans in one shot (one refresh). The map is keyed by line index; values are per-line rune-column spans. This is the entry point the widget-layer virtualized highlighter uses so it can push a freshly tokenized document without O(visible^2) per-line refreshes.
TextArea.SetNextFocusedElement
TextArea.SetOnScroll
SetOnScroll registers an observer fired whenever the vertical scroll position changes. The widget layer uses it to keep a companion gutter in lockstep.
TextArea.SetOnVisibleRangeChanged
TextArea.SetPlaceholder
TextArea.SetReadOnly
TextArea.SetRequired
TextArea.SetScrollY
SetScrollY sets the vertical scroll offset (clamped to the content).
TextArea.SetScrollbarsVisible
SetScrollbarsVisible toggles the built-in scroll bars. A code editor that paints its own scroll/marker track hides these and drives scrolling through SetScrollY instead.
TextArea.SetSelectColor
TextArea.SetText
TextArea.SetTextWithoutEvent
TextArea.SetWrap
TextArea.Text
TextArea.TextAreaData
TextArea.Undo
TextArea.ViewportHeight
ViewportHeight is the visible height of the scrolling text area (excluding the internal padding), i.e. how much of the document is on screen at once.
TextArea.VisibleLineRange
VisibleLineRange returns the first and last line indices currently realized.
TextColorSpan
struct
TextColorSpan colors a [Start,End) rune range WITHIN a single line. It is a pure data carrier used by the widget layer (syntax highlighting, markers).
TriangleStylizer
struct
TriangleStylizer.ProcessStyle
UI
struct
AllOnEntity
FirstOnEntity
UI.AddEvent
UI.Clean
UI.Clone
UI.Entity
UI.Event
UI.ExecuteEvent
UI.FindByName
UI.GenerateScissor
UI.Hide
UI.Host
UI.IsActive
UI.IsDisabled
UI.IsDown
UI.IsInFrontOf
UI.IsType
UI.IsValid
UI.Layout
UI.RemoveEvent
UI.SetDirty
UI.SetDisabled
UI.SetDontClean
UI.SetVisibility
UI.ShaderData
UI.Show
UI.ToButton
UI.ToCheckbox
UI.ToImage
UI.ToInput
UI.ToLabel
UI.ToPanel
UI.ToProgressBar
UI.ToSelect
UI.ToSlider
UI.ToTextArea
UI.ToVirtualList
UI.Type
UI.Update
UIElementData
interface
VirtualAlign
VirtualAlign selects how ScrollToIndex positions a row within the viewport.
const ( // VirtualAlignStart aligns the row's top with the viewport top. VirtualAlignStart VirtualAlign = iota // VirtualAlignCenter centers the row vertically in the viewport. VirtualAlignCenter // VirtualAlignEnd aligns the row's bottom with the viewport bottom. VirtualAlignEnd // VirtualAlignNearest scrolls the minimum amount to make the row visible. VirtualAlignNearest )
VirtualAxis
VirtualAxis is the primary scroll axis a VirtualLayout drives. Vertical is the default so existing VirtualList consumers are unaffected.
const ( // VirtualAxisVertical scrolls along Y (the default). VirtualAxisVertical VirtualAxis = iota // VirtualAxisHorizontal scrolls along X. VirtualAxisHorizontal // VirtualAxisBoth scrolls along both axes (grids/masonry that can overflow // the viewport in either direction). VirtualAxisBoth )
VirtualLayout
interface
type VirtualLayout interface {
// Axis is the primary scroll axis the strategy drives. The VirtualList sets
// its panel scroll direction to match when the strategy is installed.
Axis() VirtualAxis
// SetCount sets the item count. It is cheap (O(1)); strategies that need an
// O(n) build (e.g. masonry column assignment) defer it to the first geometry
// query, since the build depends on the viewport.
SetCount(n int)
// Count is the current item count.
Count() int
// ContentSize is the full scrollable content size for the given viewport
// (the viewport drives column/row counts for grid/masonry). The VirtualList
// feeds it to the content panel so both-axis max-scroll and scrollbars are
// correct.
ContentSize(viewport matrix.Vec2) matrix.Vec2
// VisibleAt enumerates, via visit, every item index whose rect intersects the
// window [scroll, scroll+viewport) expanded by overscan items along the main
// axis. It MUST NOT allocate. The VirtualList uses it to diff which cells are
// on screen.
VisibleAt(scroll, viewport matrix.Vec2, overscan int, visit VirtualVisitor)
// RectOf is the content-space rect (position + size) of an item for the given
// viewport. The VirtualList positions the recycled cell at (X,Y); the cell's
// size is applied by the owner's BindRow (the engine never Scales cells, so
// content that self-sizes — like TextArea's labels — is undisturbed).
RectOf(index int, viewport matrix.Vec2) VirtualRect
// Invalidate re-derives geometry for a single item whose size source may have
// changed (a measured/variable extent), shifting the items after it. Fixed
// strategies treat it as a no-op.
Invalidate(index int)
// Remeasure re-derives ALL item geometry from the strategy's size source
// (O(n), or deferred to the next geometry query). The VirtualList calls it
// when the backing data is reloaded. Fixed strategies treat it as a no-op.
Remeasure()
}
VirtualLayout is the pluggable geometry strategy for a VirtualList. It owns ALL item geometry in 2-D content space; the VirtualList core keeps doing the hard parts (recycle pool, warming/park, the visible-vs-active diff, threading) and only asks the strategy pure questions: how big is the content, which items are visible, and where each one sits.
Because every method is pure math over (scroll, viewport, index) — it must NOT create elements (man.Add), render, touch fonts, or reach the Host — a VirtualLayout can be implemented from ANY package. The engine ships exactly one implementation, linearVerticalLayout, installed by default so a VirtualList behaves identically to before unless SetLayout installs another strategy. The kaiju-widgets RecyclerView supplies horizontal, grid, and masonry strategies; third parties can supply their own.
All methods are invoked on the VirtualList's single-threaded clean pass (onLayoutUpdating -> reflow), the same place row creation happens, so a strategy never has to think about concurrency.
VirtualList
VirtualList is a scrolling list that only materializes the items currently in view, recycling a small pool of cell elements as the user scrolls. That is what lets a list of 100k items cost the same to render as a list of 30: at any moment only a viewport-worth of cell elements are active.
It is content-agnostic and not generic: the owner supplies a VirtualListDelegate that knows the item count and how to create/bind/unbind a cell element by index. Geometry — where each item sits and which are visible — is owned by a pluggable VirtualLayout strategy. The default strategy is a top-to-bottom vertical stack with item heights supplied either as a single fixed value (SetFixedRowHeight, the O(1) no-wrap path) or per-row (SetRowHeightFunc, the variable/wrapped path), so VirtualList behaves exactly as it always has unless SetLayout installs another strategy (horizontal, grid, masonry, ...). The rewritten TextArea is the first consumer (one row per text line); the kaiju-widgets RecyclerView is the second.
All access is on the main thread, in the layout/update loop — no locks.
VirtualList.Base
VirtualList.Content
Content returns the inner panel that holds the row elements. Consumers may parent overlays (cursors, selection rects) to it so they scroll with the rows.
VirtualList.Data
VirtualList.Init
VirtualList.InvalidateRow
InvalidateRow re-measures a single row's extent (variable strategies) and reflows so the rows after it shift to their new positions.
VirtualList.Layout
Layout returns the active geometry strategy (so an owner can reach strategy-specific knobs it installed).
VirtualList.OnAfterReflow
OnAfterReflow registers a callback invoked at the end of every reflow, on the single-threaded clean pass — the only place it is safe to mutate cell layout in response to scrolling. Pass nil to clear. Used by the RecyclerView for drag-follow and item animations; the callback may re-dirty the list to keep animating and must stop doing so once it settles.
VirtualList.PinRow
PinRow marks a realized row as pinned: the recycle/park loop will not reclaim it when it scrolls out of the window (used to keep a drag-in-flight or animating cell alive). Unpin with UnpinRow.
VirtualList.RefreshVisible
RefreshVisible re-binds the rows currently on screen without changing the window (use when row content/styling changed but extents did not).
VirtualList.ReloadData
ReloadData re-reads the row count and rebinds the visible rows. Call after the backing data changes (count or content).
VirtualList.RowAt
RowAt is the row index whose vertical span contains content-space y (vertical layout).
VirtualList.RowHeight
RowHeight is the height of row index (vertical layout).
VirtualList.RowOffset
RowOffset is the y of the top of row index in content space (vertical layout).
VirtualList.ScrollToIndex
ScrollToIndex scrolls so row index is visible according to align. It works for the active layout's primary axis (vertical or horizontal).
VirtualList.SetContentWidth
SetContentWidth sets a minimum content width; the content panel is sized to max(viewportWidth, w). Used for horizontal scrolling of long, unwrapped rows in the default vertical layout. Pass 0 to track the viewport width (no horizontal scroll).
VirtualList.SetDelegate
VirtualList.SetFixedRowHeight
SetFixedRowHeight switches the default vertical layout to fixed-height rows (every row is h tall). This is the O(1) path used for code (no soft wrap, one line per row).
VirtualList.SetLayout
SetLayout installs a geometry strategy, switching the list among vertical (default), horizontal, grid, or masonry arrangements, and sets the panel scroll direction from the strategy's axis. Passing nil restores the default vertical strategy. The strategy's methods are pure math invoked only on the clean pass.
VirtualList.SetOverscan
VirtualList.SetRowHeightFunc
SetRowHeightFunc switches the default vertical layout to variable-height rows, measuring each row's height via fn. Used for wrapped / chat content.
VirtualList.TotalHeight
TotalHeight is the full scrollable content height (vertical layout).
VirtualList.UnpinRow
UnpinRow removes a row's pin so it can be recycled normally again.
VirtualList.ViewportHeight
ViewportHeight is the visible content height of the list.
VirtualList.VisibleRange
VisibleRange returns the [first,last] data indices currently realized. If the list is empty last < first.
VirtualListDelegate
interface
type VirtualListDelegate interface {
// RowCount is the total number of rows in the backing data.
RowCount() int
// CreateRow builds a fresh, reusable row element. It is called only when
// the recycle pool is empty (at most a viewport-worth of times), and the
// returned element is reused across many data indices via BindRow.
CreateRow(man *Manager) *UI
// BindRow populates an existing row element for the given data index.
BindRow(index int, row *UI)
// UnbindRow is called before a row leaves the viewport and returns to the
// pool. Optional cleanup hook (clear text, hide children, etc.).
UnbindRow(index int, row *UI)
}
VirtualListDelegate is the data source + row lifecycle for a VirtualList. Implementations own the backing data and answer purely by index.
VirtualRect
struct
VirtualRect is the content-space rectangle of a virtualized item: position (X,Y) of its top-left corner and size (W,H), measured in the same content space the VirtualList's inner content panel lives in (origin top-left, +x right, +y down). It is a pure data carrier (no behavior), an exported struct on a hot path like ColorSpan, so strategies return it by value with no allocation.
VirtualVisitor
VirtualVisitor receives each visible item index during a VisibleAt enumeration. It exists so the window can be walked with zero allocation (no returned slice).