Versions in this module Expand all Collapse all v0 v0.2.0-alpha Sep 27, 2026 v0.1.0 Sep 27, 2026 Changes in this version + func DispatchEvent(widget Widget, eventKey EventKey, args ...any) ([]any, bool) + func DispatchEventLazy(widget Widget, eventKey EventKey, argsFunc any) ([]any, bool) + func OnFocusChanged(widget Widget, onfocus func(context *Context, focused bool)) + func RequestRebuild() + func RequestRedraw(widget Widget) + func Run(root Widget, options *RunOptions) error + func RunWithCustomFunc(root Widget, options *RunOptions, ...) error + func SetEventHandler(widget Widget, eventKey EventKey, handler any) + type ChildAdder struct + func (c *ChildAdder) AddWidget(widget Widget) + type ChildLayouter struct + func (c *ChildLayouter) LayoutWidget(widget Widget, bounds image.Rectangle) + type Constraints struct + func FixedHeightConstraints(h int) Constraints + func FixedWidthConstraints(w int) Constraints + func (c *Constraints) FixedHeight() (int, bool) + func (c *Constraints) FixedWidth() (int, bool) + type Context struct + func (c *Context) AppBounds() image.Rectangle + func (c *Context) AppScale() float64 + func (c *Context) AppendAppLocales(locales []language.Tag) []language.Tag + func (c *Context) AppendLocales(locales []language.Tag) []language.Tag + func (c *Context) ColorMode() ebiten.ColorMode + func (c *Context) DelegateFocus(widget Widget, delegate Widget) + func (c *Context) DeviceScale() float64 + func (c *Context) Env(widget Widget, key EnvKey) (any, bool) + func (c *Context) FirstLocale() language.Tag + func (c *Context) IsButtonInputReceptive(widget Widget) bool + func (c *Context) IsEnabled(widget Widget) bool + func (c *Context) IsFocused(widget Widget) bool + func (c *Context) IsFocusedOrHasFocusedDescendant(widget Widget) bool + func (c *Context) IsVisible(widget Widget) bool + func (c *Context) KeyBindingMode() KeyBindingMode + func (c *Context) Opacity(widget Widget) float64 + func (c *Context) Passthrough(widget Widget) bool + func (c *Context) PreferredColorMode() ebiten.ColorMode + func (c *Context) PreferredKeyBindingMode() KeyBindingMode + func (c *Context) Scale() float64 + func (c *Context) SetAppLocales(locales []language.Tag) + func (c *Context) SetAppScale(scale float64) + func (c *Context) SetButtonInputReceptive(widget Widget, receptive bool) + func (c *Context) SetClipChildren(widget Widget, clip bool) + func (c *Context) SetEnabled(widget Widget, enabled bool) + func (c *Context) SetFocused(widget Widget, focused bool) + func (c *Context) SetOpacity(widget Widget, opacity float64) + func (c *Context) SetPassthrough(widget Widget, passthrough bool) + func (c *Context) SetPreferredColorMode(mode ebiten.ColorMode) + func (c *Context) SetPreferredKeyBindingMode(mode KeyBindingMode) + func (c *Context) SetVisible(widget Widget, visible bool) + func (c *Context) SetWindowSize(width, height int) + func (c *Context) SetWindowSizeLimits(minw, minh, maxw, maxh int) + func (c *Context) SetWindowTitle(title string) + type DefaultWidget struct + func (*DefaultWidget) Build(context *Context, adder *ChildAdder) error + func (*DefaultWidget) CursorShape(context *Context, widgetBounds *WidgetBounds) (ebiten.CursorShapeType, bool) + func (*DefaultWidget) Draw(context *Context, widgetBounds *WidgetBounds, dst *ebiten.Image) + func (*DefaultWidget) Env(context *Context, key EnvKey, source *EnvSource) (any, bool) + func (*DefaultWidget) HandleButtonInput(context *Context, widgetBounds *WidgetBounds) HandleInputResult + func (*DefaultWidget) HandlePointingInput(context *Context, widgetBounds *WidgetBounds) HandleInputResult + func (*DefaultWidget) Layout(context *Context, widgetBounds *WidgetBounds, layouter *ChildLayouter) + func (*DefaultWidget) Tick(context *Context, widgetBounds *WidgetBounds) error + func (*DefaultWidget) WriteStateKey(context *Context, w *StateKeyWriter) + func (d *DefaultWidget) Measure(context *Context, constraints Constraints) image.Point + type EnvKey uniqueKey + func GenerateEnvKey() EnvKey + type EnvSource struct + Child Widget + Origin Widget + type EventKey uniqueKey + func GenerateEventKey() EventKey + type HandleInputResult struct + func AbortHandlingInputByWidget(widget Widget) HandleInputResult + func HandleInputByWidget(widget Widget) HandleInputResult + func (r HandleInputResult) IsHandled() bool + type KeyBindingMode int + const KeyBindingModeCommand + const KeyBindingModeControlDefault + const KeyBindingModeControlEmacs + const KeyBindingModeUnknown + func (k KeyBindingMode) ShortcutModifierKey() ebiten.Key + func (k KeyBindingMode) UsesEmacsKeymap() bool + type LayerWidget struct + func (l *LayerWidget[T]) BringToFrontLayer(context *Context) + func (l *LayerWidget[T]) Build(context *Context, adder *ChildAdder) error + func (l *LayerWidget[T]) Layout(context *Context, widgetBounds *WidgetBounds, layouter *ChildLayouter) + func (l *LayerWidget[T]) Measure(context *Context, constraints Constraints) image.Point + func (l *LayerWidget[T]) Widget() T + type LayoutDirection int + const LayoutDirectionHorizontal + const LayoutDirectionVertical + type LinearLayout struct + Direction LayoutDirection + Gap int + Items []LinearLayoutItem + Padding Padding + func (l LinearLayout) AppendItemBounds(boundsArr []image.Rectangle, context *Context, bounds image.Rectangle) []image.Rectangle + func (l LinearLayout) ItemBoundsAt(index int, context *Context, bounds image.Rectangle) image.Rectangle + func (l LinearLayout) LayoutWidgets(context *Context, bounds image.Rectangle, layouter WidgetLayouter) + func (l LinearLayout) Measure(context *Context, constraints Constraints) image.Point + type LinearLayoutItem struct + Layout WidgetsLayouter + Size Size + Widget Widget + type Padding struct + Bottom int + End int + Start int + Top int + type RunOptions struct + AppScale float64 + ApplePressAndHoldDelegated bool + RunGameOptions *ebiten.RunGameOptions + Title string + WindowFloating bool + WindowMaxSize image.Point + WindowMinSize image.Point + WindowSize image.Point + type Size struct + func FixedSize(value int) Size + func FlexibleSize(value int) Size + type StateKeyWriter struct + func (w *StateKeyWriter) Write(p []byte) (int, error) + func (w *StateKeyWriter) WriteBigInt(v *big.Int) + func (w *StateKeyWriter) WriteBool(v bool) + func (w *StateKeyWriter) WriteFloat32(v float32) + func (w *StateKeyWriter) WriteFloat64(v float64) + func (w *StateKeyWriter) WriteInt(v int) + func (w *StateKeyWriter) WriteInt16(v int16) + func (w *StateKeyWriter) WriteInt32(v int32) + func (w *StateKeyWriter) WriteInt64(v int64) + func (w *StateKeyWriter) WriteInt8(v int8) + func (w *StateKeyWriter) WriteString(s string) + func (w *StateKeyWriter) WriteUint(v uint) + func (w *StateKeyWriter) WriteUint16(v uint16) + func (w *StateKeyWriter) WriteUint32(v uint32) + func (w *StateKeyWriter) WriteUint64(v uint64) + func (w *StateKeyWriter) WriteUint8(v uint8) + func (w *StateKeyWriter) WriteWidget(widget Widget) + type Widget interface + Build func(context *Context, adder *ChildAdder) error + CursorShape func(context *Context, widgetBounds *WidgetBounds) (ebiten.CursorShapeType, bool) + Draw func(context *Context, widgetBounds *WidgetBounds, dst *ebiten.Image) + Env func(context *Context, key EnvKey, source *EnvSource) (any, bool) + HandleButtonInput func(context *Context, widgetBounds *WidgetBounds) HandleInputResult + HandlePointingInput func(context *Context, widgetBounds *WidgetBounds) HandleInputResult + Layout func(context *Context, widgetBounds *WidgetBounds, layouter *ChildLayouter) + Measure func(context *Context, constraints Constraints) image.Point + Tick func(context *Context, widgetBounds *WidgetBounds) error + WriteStateKey func(context *Context, w *StateKeyWriter) + type WidgetBounds struct + func (w *WidgetBounds) Bounds() image.Rectangle + func (w *WidgetBounds) IsHitAt(point image.Point) bool + func (w *WidgetBounds) IsHitAtCursor() bool + func (w *WidgetBounds) VisibleBounds() image.Rectangle + type WidgetLayouter interface + LayoutWidget func(widget Widget, bounds image.Rectangle) + type WidgetSlice struct + func (w *WidgetSlice[T]) All() iter.Seq2[int, T] + func (w *WidgetSlice[T]) At(index int) T + func (w *WidgetSlice[T]) Len() int + func (w *WidgetSlice[T]) SetLen(l int) + type WidgetWithPadding struct + func (w *WidgetWithPadding[T]) Build(context *Context, adder *ChildAdder) error + func (w *WidgetWithPadding[T]) Layout(context *Context, widgetBounds *WidgetBounds, layouter *ChildLayouter) + func (w *WidgetWithPadding[T]) Measure(context *Context, constraints Constraints) image.Point + func (w *WidgetWithPadding[T]) SetPadding(padding Padding) + func (w *WidgetWithPadding[T]) Widget() T + type WidgetWithSize struct + func (w *WidgetWithSize[T]) Build(context *Context, adder *ChildAdder) error + func (w *WidgetWithSize[T]) Layout(context *Context, widgetBounds *WidgetBounds, layouter *ChildLayouter) + func (w *WidgetWithSize[T]) Measure(context *Context, constraints Constraints) image.Point + func (w *WidgetWithSize[T]) SetFixedHeight(height int) + func (w *WidgetWithSize[T]) SetFixedSize(size image.Point) + func (w *WidgetWithSize[T]) SetFixedWidth(width int) + func (w *WidgetWithSize[T]) SetIntrinsicSize() + func (w *WidgetWithSize[T]) SetMeasureFunc(f func(context *Context, constraints Constraints) image.Point) + func (w *WidgetWithSize[T]) Widget() T + type WidgetsLayouter interface + LayoutWidgets func(context *Context, bounds image.Rectangle, layouter WidgetLayouter) + Measure func(context *Context, constraints Constraints) image.Point