Versions in this module Expand all Collapse all v0 v0.0.1 Aug 25, 2026 Changes in this version + func MixColors(first, second gctx2d.Color, amount float32) (color gctx2d.Color) + type Align uint8 + const AlignCenter + const AlignEnd + const AlignStart + const AlignStretch + type Axis uint8 + const Horizontal + const Vertical + type Button struct + OnClick func(self *Button) + Text string + TextStyle TextStyle + func (button *Button) SetDisabled(disabled bool) *Button + func (button *Button) SetText(text string) *Button + type CheckState uint8 + const CheckChecked + const CheckIndeterminate + const CheckUnchecked + type Checkbox struct + CheckColor gctx2d.Color + Checked bool + CheckedStyle Style + IndeterminateStyle Style + Label string + OnChange func(self *Checkbox, checked bool) + OnStateChange func(self *Checkbox, state CheckState) + State CheckState + TextStyle TextStyle + ThreeState bool + UncheckedStyle Style + func (checkbox *Checkbox) SetChecked(checked bool) *Checkbox + func (checkbox *Checkbox) SetState(state CheckState) *Checkbox + func (checkbox *Checkbox) SetThreeState(enabled bool) *Checkbox + type ClickAnimation uint8 + const ClickAnimationBounce + const ClickAnimationNone + const ClickAnimationPulse + const ClickAnimationScale + type ClickAnimationStyle struct + Duration time.Duration + Easing Easing + MixAmount float32 + Scale float32 + Type ClickAnimation + func DefaultClickAnimationStyle() (style ClickAnimationStyle) + type Clipboard interface + ClipboardRead func() (text string, err error) + ClipboardWrite func(text string) error + type Container struct + Align Align + Bounds Rect + Direction Axis + Gap float32 + Justify Justify + Padding Insets + func NewColumn(bounds Rect) (container *Container) + func NewRow(bounds Rect) (container *Container) + func (container *Container) Add(item LayoutItem, grow float32) *Container + func (container *Container) Clear() *Container + func (container *Container) Count() int + func (container *Container) GetBounds() Rect + func (container *Container) Layout() + func (container *Container) Remove(item LayoutItem) *Container + func (container *Container) SetBounds(bounds Rect) + type Cursor interface + SetCursor func(cursor gpucontext.CursorShape) + type Dropdown struct + Expanded bool + OnChange func(self *Dropdown, selected int, value string) + OptionHeight float32 + Options []string + Selected int + TextStyle TextStyle + func (dropdown *Dropdown) SetSelected(selected int) *Dropdown + func (dropdown *Dropdown) Value() (value string) + type Easing uint8 + const EaseIn + const EaseInOut + const EaseLinear + const EaseOut + const EaseOutBack + type Element struct + Bounds Rect + Disabled bool + Hovered bool + Interactive bool + Pressed bool + Style Style + Visible bool + func (element *Element) BringToFront() + func (element *Element) ContainsPoint(x, y float32) (contains bool) + func (element *Element) GetBounds() Rect + func (element *Element) Remove() + func (element *Element) SetBounds(bounds Rect) + func (element *Element) SetDisabled(disabled bool) *Element + func (element *Element) SetPosition(x, y float32) *Element + func (element *Element) SetSize(width, height float32) *Element + type Form struct + Bounds Rect + Gap float32 + LabelSide LabelSide + LabelWidth float32 + RowGap float32 + RowHeight float32 + func (form *Form) Add(label *Label, control LayoutItem) *Form + func (form *Form) GetBounds() Rect + func (form *Form) Layout() + func (form *Form) SetBounds(bounds Rect) + type Insets struct + Bottom float32 + Left float32 + Right float32 + Top float32 + type Justify uint8 + const JustifyCenter + const JustifyEnd + const JustifySpaceBetween + const JustifyStart + type Label struct + Text string + TextStyle TextStyle + type LabelSide uint8 + const LabelLeading + const LabelTrailing + type LayoutItem interface + GetBounds func() Rect + SetBounds func(bounds Rect) + type Numeric interface + type Panel struct + type Radio struct + Checked bool + Group string + Label string + OnChange func(self *Radio, checked bool) + TextStyle TextStyle + func (radio *Radio) SetChecked(checked bool) *Radio + type RadioGroup struct + Choices []string + Label string + LabelStyle TextStyle + OnChange func(self *RadioGroup, selected int, value string) + Selected int + TextStyle TextStyle + func (group *RadioGroup) SetSelected(selected int) *RadioGroup + func (group *RadioGroup) Value() (value string) + type Rect struct + Height float32 + Width float32 + X float32 + Y float32 + type Select struct + Label string + OnChange func(self *Select, selected int, value string) + Options []string + Selected int + TextStyle TextStyle + ValueSeparator string + func (selectInput *Select) SetSelected(selected int) *Select + func (selectInput *Select) Value() (value string) + type Slider struct + KnobRadius float32 + Label string + Max T + Min T + OnChange func(self *Slider[T], value T) + ProgressColor gctx2d.Color + SnapStep bool + Step T + TextStyle TextStyle + TrackColor gctx2d.Color + TrackWidth float32 + Value T + ValueGap float32 + ValueWidth float32 + func NewSlider[T Numeric](ui *UserInterface, bounds Rect, label string, minimum, maximum, value T, ...) (slider *Slider[T]) + func (slider *Slider[T]) SetStep(step T, snaps ...bool) *Slider[T] + func (slider *Slider[T]) SetValue(value T) *Slider[T] + func (slider *Slider[T]) SetValueFormat(format string) *Slider[T] + func (slider *Slider[T]) ValueFormat() string + type Style struct + BorderColor gctx2d.Color + BorderRadius float32 + BorderWidth float32 + Click ClickAnimationStyle + DisabledMixAmount float32 + DisabledMixColor gctx2d.Color + FillColor gctx2d.Color + FocusBorderColor gctx2d.Color + HoverMixAmount float32 + HoverMixColor gctx2d.Color + PressMixAmount float32 + Transition TransitionStyle + func DefaultButtonStyle() (style Style) + func DefaultCheckboxStyles() (unchecked, checked, indeterminate Style) + func DefaultControlStyle() (style Style) + func DefaultPanelStyle() (style Style) + func DefaultTextInputStyle() (style Style) + type Switcher = Select + type TextInput struct + Animation TextInputAnimationStyle + CursorColor gctx2d.Color + MaxLength int + OnChange func(self *TextInput, value string) + OnSubmit func(self *TextInput, value string) + Padding Insets + Placeholder string + PlaceholderColor gctx2d.Color + SelectionColor gctx2d.Color + TextStyle TextStyle + Value string + func (input *TextInput) Blur() *TextInput + func (input *TextInput) Cursor() int + func (input *TextInput) Focus() *TextInput + func (input *TextInput) Focused() bool + func (input *TextInput) Select(start, end int) *TextInput + func (input *TextInput) SelectAll() *TextInput + func (input *TextInput) SelectedText() (text string) + func (input *TextInput) Selection() (start, end int) + func (input *TextInput) SetCursor(cursor int) *TextInput + func (input *TextInput) SetDisabled(disabled bool) *TextInput + func (input *TextInput) SetMaxLength(maxLength int) *TextInput + func (input *TextInput) SetValue(value string) *TextInput + type TextInputAnimationStyle struct + Cursor TransitionStyle + CursorBlink time.Duration + CursorBlinkFade time.Duration + Highlight TransitionStyle + func DefaultTextInputAnimationStyle() (style TextInputAnimationStyle) + type TextStyle struct + Align gctx2d.TextAlign + Baseline gctx2d.TextBaseline + BorderCap gctx2d.LineCap + BorderColor gctx2d.Color + BorderJoin gctx2d.LineJoin + BorderWidth float32 + Color gctx2d.Color + Font *gctx2d.FontHandle + FontSize float64 + Kerning bool + Weight gctx2d.FontWeight + func DefaultButtonTextStyle() (style TextStyle) + func DefaultInputTextStyle() (style TextStyle) + type Toggle struct + Checked bool + Label string + OnChange func(self *Toggle, checked bool) + TextStyle TextStyle + func (toggle *Toggle) SetChecked(checked bool) *Toggle + type TransitionMode uint8 + const TransitionCrossFade + const TransitionInterpolate + type TransitionStyle struct + Duration time.Duration + Easing Easing + Mode TransitionMode + func DefaultTransitionStyle() (style TransitionStyle) + type UserInterface struct + Active bool + Visible bool + WindowAnimation WindowAnimationStyle + func New(ctx *gctx2d.Context) (ui *UserInterface) + func NewUserInterface(ctx *gctx2d.Context) (ui *UserInterface) + func (ui *UserInterface) Clear() + func (ui *UserInterface) ClearWindowDragArea() *UserInterface + func (ui *UserInterface) Column(bounds Rect) (container *Container) + func (ui *UserInterface) Context() (ctx *gctx2d.Context) + func (ui *UserInterface) Draw() + func (ui *UserInterface) DrawTo(ctx *gctx2d.Context) + func (ui *UserInterface) FocusedInput() *TextInput + func (ui *UserInterface) Form(bounds Rect) (form *Form) + func (ui *UserInterface) Hide(onHidden ...func()) *UserInterface + func (ui *UserInterface) Migrate(ctx *gctx2d.Context) *UserInterface + func (ui *UserInterface) NewButton(bounds Rect, text string, onClick func(self *Button)) (button *Button) + func (ui *UserInterface) NewCheckbox(bounds Rect, label string, checked bool, ...) (checkbox *Checkbox) + func (ui *UserInterface) NewDropdown(bounds Rect, options []string, selected int, ...) (dropdown *Dropdown) + func (ui *UserInterface) NewLabel(bounds Rect, text string) (label *Label) + func (ui *UserInterface) NewPanel(bounds Rect) (panel *Panel) + func (ui *UserInterface) NewRadio(bounds Rect, label string, group string, checked bool, ...) (radio *Radio) + func (ui *UserInterface) NewRadioGroup(bounds Rect, label string, choices []string, selected int, ...) (group *RadioGroup) + func (ui *UserInterface) NewSelect(bounds Rect, label string, options []string, selected int, ...) (selectInput *Select) + func (ui *UserInterface) NewSlider(bounds Rect, label string, minimum, maximum, value float32, ...) (slider *Slider[float32]) + func (ui *UserInterface) NewSwitcher(bounds Rect, options []string, selected int, ...) (switcher *Switcher) + func (ui *UserInterface) NewTextInput(bounds Rect, placeholder string, onChange func(self *TextInput, value string)) (input *TextInput) + func (ui *UserInterface) NewToggle(bounds Rect, label string, checked bool, ...) (toggle *Toggle) + func (ui *UserInterface) OnKeyPress(key gpucontext.Key, mods gpucontext.Modifiers) (handled bool) + func (ui *UserInterface) OnKeyRelease(key gpucontext.Key, mods gpucontext.Modifiers) (handled bool) + func (ui *UserInterface) OnMouseMove(x, y float64) (handled bool) + func (ui *UserInterface) OnMousePress(button gpucontext.MouseButton, x, y float64) (handled bool) + func (ui *UserInterface) OnMouseRelease(button gpucontext.MouseButton, x, y float64) (handled bool) + func (ui *UserInterface) OnScroll(deltaX, deltaY float64) bool + func (ui *UserInterface) OnTextInput(text string) (handled bool) + func (ui *UserInterface) ResetWindowOffset() *UserInterface + func (ui *UserInterface) Row(bounds Rect) (container *Container) + func (ui *UserInterface) SetActive(active bool) *UserInterface + func (ui *UserInterface) SetClipboard(clipboard Clipboard) *UserInterface + func (ui *UserInterface) SetContext(ctx *gctx2d.Context) *UserInterface + func (ui *UserInterface) SetCursor(cursor Cursor) *UserInterface + func (ui *UserInterface) SetVisible(visible bool) *UserInterface + func (ui *UserInterface) SetWindowAnimation(style WindowAnimationStyle) *UserInterface + func (ui *UserInterface) SetWindowDragArea(area Rect) *UserInterface + func (ui *UserInterface) SetWindowDragHandle(handle LayoutItem) *UserInterface + func (ui *UserInterface) SetWindowOffset(x, y float32) *UserInterface + func (ui *UserInterface) Show() *UserInterface + func (ui *UserInterface) WidgetCount() int + func (ui *UserInterface) WindowOffset() (x, y float32) + func (ui *UserInterface) WindowState() WindowState + type WindowAnimationStyle struct + Close TransitionStyle + Fade bool + MinScale float32 + OffsetY float32 + Open TransitionStyle + func DefaultWindowAnimationStyle() (style WindowAnimationStyle) + type WindowState uint8 + const WindowClosing + const WindowHidden + const WindowOpen + const WindowOpening