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.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
SelectOptionCheckStylizer
struct
SelectOptionCheckStylizer.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 )
VirtualList
VirtualList is a vertically-scrolling list that only materializes the rows currently in view, recycling a small pool of row elements as the user scrolls. That is what lets a list of 100k rows cost the same to render as a list of 30: at any moment only a viewport-worth of row elements are active.
It is content-agnostic and not generic: the owner supplies a VirtualListDelegate that knows the row count and how to create/bind/unbind a row element by index, and supplies row heights either as a single fixed value (SetFixedRowHeight, the O(1) no-wrap path) or per-row (SetRowHeightFunc, the variable/wrapped path). The rewritten TextArea is the first consumer (one row per text line); Select's option list is a natural follow-up.
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 height (variable mode) and reflows so the rows below it shift to their new positions.
VirtualList.RefreshVisible
RefreshVisible re-binds the rows currently on screen without changing the window (use when row content/styling changed but heights 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.
VirtualList.RowHeight
RowHeight is the height of row index.
VirtualList.RowOffset
RowOffset is the y of the top of row index in content space.
VirtualList.ScrollToIndex
ScrollToIndex scrolls so row index is visible according to align.
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. Pass 0 to track the viewport width (no horizontal scroll).
VirtualList.SetDelegate
VirtualList.SetFixedRowHeight
SetFixedRowHeight switches the list 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.SetOverscan
VirtualList.SetRowHeightFunc
SetRowHeightFunc switches the list 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.
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.