eui

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 41 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

EUI

A native Go UI toolkit for Ebitengine. Build game interfaces, editors, settings panels, and desktop tools with embedded fonts, palettes, and styles.

EUI Studio with live theme controls, an orbital canvas, and a tabbed notebook

Install

Requires Go 1.27.4 or newer and targets Ebitengine 2.10.6. Desktop builds support CGO_ENABLED=0 and require the usual display and graphics runtime libraries; see development setup.

go get github.com/M45-Software/EUI

Try Studio

git clone https://github.com/M45-Software/EUI.git
cd EUI
go run ./examples/studio

Explore live themes, responsive layouts, text editing, forms, modal dialogs, and gamepad navigation. See the Studio guide for options and more screenshots.

Features

  • Rows, columns, tabs, scrolling, and resizable windows.
  • Buttons, inputs, sliders, dropdowns, color pickers, and validated forms.
  • Text editing with undo/redo, highlighting, word wrapping, and IME composition.
  • Keyboard, pointer, touch, and optional gamepad navigation.
  • Independent UI contexts, 12 palettes, and 6 styles.

Documentation

Origin and license

Extracted from goThoom. MIT licensed. No Clan Lord game assets are included.

Documentation

Index

Examples

Constants

View Source
const (
	FLOW_HORIZONTAL = iota
	FLOW_VERTICAL
	FLOW_HORIZONTAL_REV
	FLOW_VERTICAL_REV
	// FLOW_OVERLAY positions every child from the same origin. Child Position
	// values place controls within the shared container rectangle.
	FLOW_OVERLAY
)
View Source
const (
	ALIGN_NONE = iota
	ALIGN_LEFT
	ALIGN_CENTER
	ALIGN_RIGHT
)
View Source
const (
	PIN_TOP_LEFT = iota
	PIN_TOP_CENTER
	PIN_TOP_RIGHT

	PIN_MID_LEFT
	PIN_MID_CENTER
	PIN_MID_RIGHT

	PIN_BOTTOM_LEFT
	PIN_BOTTOM_CENTER
	PIN_BOTTOM_RIGHT
)
View Source
const (
	PART_NONE = iota

	PART_BAR
	PART_CLOSE
	PART_MAXIMIZE
	PART_SEARCH

	PART_TOP
	PART_RIGHT
	PART_BOTTOM
	PART_LEFT

	PART_TOP_RIGHT
	PART_BOTTOM_RIGHT
	PART_BOTTOM_LEFT
	PART_TOP_LEFT

	PART_SCROLL_V
	PART_SCROLL_H
)
View Source
const (
	ITEM_NONE = iota
	ITEM_FLOW
	ITEM_TEXT
	ITEM_BUTTON
	ITEM_CHECKBOX
	ITEM_RADIO
	ITEM_INPUT
	ITEM_SLIDER
	ITEM_DROPDOWN
	ITEM_COLORWHEEL
	ITEM_IMAGE
	ITEM_IMAGE_FAST
	ITEM_PROGRESS
)
View Source
const CornerSnapThreshold float32 = 18

CornerSnapThreshold defines how close a moving window edge or corner must be to snap to a screen edge or another window.

View Source
const (

	// MinWindowSize is the floating-window minimum and preferred tile minimum.
	MinWindowSize = 64
)
View Source
const UnsnapThreshold float32 = 22

UnsnapThreshold defines how far the pointer-relative window position must move from a magnetic anchor before that axis releases.

Variables

View Source
var (
	ColorWhite   = NewColor(255, 255, 255, 255)
	ColorBlack   = NewColor(0, 0, 0, 255)
	ColorRed     = NewColor(203, 67, 53, 255)
	ColorGreen   = NewColor(40, 180, 99, 255)
	ColorBlue    = NewColor(41, 128, 185, 255)
	ColorYellow  = NewColor(244, 208, 63, 255)
	ColorGray    = NewColor(128, 128, 128, 255)
	ColorOrange  = NewColor(243, 156, 18, 255)
	ColorPink    = NewColor(255, 151, 197, 255)
	ColorPurple  = NewColor(165, 105, 189, 255)
	ColorSilver  = NewColor(209, 209, 209, 255)
	ColorTeal    = NewColor(64, 199, 178, 255)
	ColorMaroon  = NewColor(199, 54, 103, 255)
	ColorNavy    = NewColor(99, 114, 166, 255)
	ColorOlive   = NewColor(134, 166, 99, 255)
	ColorLime    = NewColor(206, 231, 114, 255)
	ColorFuchsia = NewColor(209, 114, 231, 255)
	ColorAqua    = NewColor(114, 228, 231, 255)
	ColorBrown   = NewColor(176, 116, 78, 255)
	ColorRust    = NewColor(210, 113, 52, 255)

	ColorLightRed     = NewColor(255, 83, 83, 255)
	ColorLightGreen   = NewColor(170, 255, 159, 255)
	ColorLightBlue    = NewColor(159, 186, 255, 255)
	ColorLightYellow  = NewColor(255, 251, 159, 255)
	ColorLightGray    = NewColor(236, 236, 236, 255)
	ColorLightOrange  = NewColor(252, 213, 134, 255)
	ColorLightPink    = NewColor(254, 163, 182, 255)
	ColorLightPurple  = NewColor(254, 163, 245, 255)
	ColorLightSilver  = NewColor(228, 228, 228, 255)
	ColorLightTeal    = NewColor(152, 221, 210, 255)
	ColorLightMaroon  = NewColor(215, 124, 143, 255)
	ColorLightNavy    = NewColor(128, 152, 197, 255)
	ColorLightOlive   = NewColor(186, 228, 144, 255)
	ColorLightLime    = NewColor(219, 243, 153, 255)
	ColorLightFuchsia = NewColor(239, 196, 253, 255)
	ColorLightAqua    = NewColor(196, 246, 253, 255)

	ColorDarkRed      = NewColor(146, 22, 22, 255)
	ColorDarkGreen    = NewColor(22, 146, 24, 255)
	ColorDarkBlue     = NewColor(22, 98, 146, 255)
	ColorDarkYellow   = NewColor(139, 146, 22, 255)
	ColorDarkGray     = NewColor(111, 111, 111, 255)
	ColorCharcoal     = NewColor(16, 16, 16, 255)
	ColorCharcoalSemi = NewColor(16, 16, 16, 128)
	ColorDarkOrange   = NewColor(175, 117, 32, 255)
	ColorDarkPink     = NewColor(128, 64, 64, 255)
	ColorDarkPurple   = NewColor(137, 32, 175, 255)
	ColorDarkSilver   = NewColor(162, 162, 162, 255)
	ColorDarkTeal     = NewColor(27, 110, 86, 255)
	ColorDarkMaroon   = NewColor(110, 27, 55, 255)
	ColorDarkNavy     = NewColor(16, 46, 85, 255)
	ColorDarkOlive    = NewColor(60, 101, 19, 255)
	ColorDarkLime     = NewColor(122, 154, 45, 255)
	ColorDarkFuchsia  = NewColor(154, 45, 141, 255)
	ColorDarkAqua     = NewColor(45, 154, 154, 255)

	ColorVeryDarkGray = NewColor(64, 64, 64, 255)
)
View Source
var ErrContextDisposed = errors.New("eui: context is disposed")
View Source
var ErrContextReentry = errors.New("eui: recursive Update/Draw on the same context")

Functions

func MeasureTextWidth

func MeasureTextWidth(s string, face text.Face) float64

MeasureTextWidth safely measures the width of s using face. If the face lacks a backing font source (e.g., *text.GoTextFace with nil Source), fall back to a simple approximation that avoids panics during tests.

func Required

func Required(value string) string

Required rejects empty and whitespace-only text without trimming stored values.

func SetColorSwatch

func SetColorSwatch(item *ItemData, col Color)

SetColorSwatch updates a swatch and refreshes its window.

func SetProgressIndeterminate

func SetProgressIndeterminate(pb *ItemData, ind bool)

SetProgressIndeterminate updates the indeterminate state of a progress bar and refreshes its parent window's tracking flag.

func ValidateStyleSource

func ValidateStyleSource(data []byte) error

ValidateStyleSource checks style values without changing the active style.

func WrapText

func WrapText(s string, face text.Face, maxWidth float64) (int, []string)

WrapText splits s into lines that do not exceed maxWidth when rendered with the provided face. Words are kept intact when possible; if a single word exceeds maxWidth it will be broken across lines. Unlike strings.Fields, it preserves runs of spaces so user input doesn't lose spacing.

Types

type AlignType

type AlignType = alignType

type Clipboard

type Clipboard interface {
	ReadText() (string, error)
	WriteText(string) error
}

Clipboard provides text transfer for copy, cut, and paste. Configure it on the UI goroutine; methods run synchronously there. Nil selects the system clipboard.

type Color

type Color color.RGBA

func NewColor

func NewColor(r, g, b, a uint8) Color

func NewColorHSV

func NewColorHSV(h, s, v, a float64) Color

NewColorHSV constructs a color from hue in degrees and unit saturation, value, and alpha. Hue wraps; the other components are clamped to [0,1].

func (Color) HSVA

func (c Color) HSVA() (h, s, v, a float64)

HSVA returns hue in degrees and saturation, value, and alpha in [0,1].

func (Color) MarshalJSON

func (c Color) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler using HSV representation.

func (Color) RGBA

func (c Color) RGBA() (r, g, b, a uint32)

func (Color) ToRGBA

func (c Color) ToRGBA() color.RGBA

func (*Color) UnmarshalJSON

func (c *Color) UnmarshalJSON(data []byte) error

UnmarshalJSON accepts HSV, RGBA objects or a string. Strings accept a hex RGB(A) value like "#RRGGBB" or comma-separated HSV components "h,s,v". Use Context.ParseColor to resolve a name from a particular palette.

type Context

type Context struct {

	// GamepadCancelHandler receives Back when no menu, editor adjustment, search
	// or modal consumes it. It runs synchronously on the UI goroutine.
	GamepadCancelHandler func()

	// ModalBackdrop dims content behind each modal; zero alpha disables dimming.
	ModalBackdrop Color

	// DebugMode draws geometry diagnostics.
	DebugMode bool
	// DumpMode saves cached images before the application exits.
	DumpMode bool
	// TreeMode saves the window hierarchy before exit.
	TreeMode bool
	// CacheCheck displays render counts for windows and controls.
	CacheCheck bool

	// AutoHiDPI follows the native monitor scale; enabled by default.
	AutoHiDPI bool

	// WindowStateChanged runs when a window opens or closes.
	WindowStateChanged func()

	ShiftPressed bool
	CtrlPressed  bool
	// CapsLockToggleHandler receives unclaimed Caps Lock presses.
	CapsLockToggleHandler func()

	// UnmanagedImageCreated receives optional allocation diagnostics.
	UnmanagedImageCreated func(width int, height int, elapsed time.Duration, site string)

	// RepaintObserver receives this instance's repaint diagnostics.
	RepaintObserver func(RepaintStats)

	// AutoReload watches this context's editable theme/style paths.
	AutoReload bool
	// contains filtered or unexported fields
}

Context owns one independent UI. It must not be copied.

func NewContext

func NewContext() (*Context, error)

NewContext creates an independent UI with embedded fonts and default appearance. Use it on the game goroutine and call Dispose when finished.

func (*Context) AccentColor

func (ctx *Context) AccentColor() Color

AccentColor returns the current accent color.

func (*Context) AccentSaturation

func (ctx *Context) AccentSaturation() float64

AccentSaturation returns the current accent color saturation value.

func (*Context) ActiveGamepad

func (ctx *Context) ActiveGamepad() (ebiten.GamepadID, bool)

ActiveGamepad returns the controller that most recently acquired navigation. Ownership is retained until disconnection or input routing/configuration reset.

func (*Context) ApplyBoldFace

func (ctx *Context) ApplyBoldFace(it *ItemData)

ApplyBoldFace sets a bold text face for the given item based on its current FontSize and the active UI scale, so it renders as a bold section label.

func (*Context) BoldFontSource

func (ctx *Context) BoldFontSource() *text.GoTextFaceSource

BoldFontSource returns the current bold text face source.

func (*Context) ClearFocus

func (ctx *Context) ClearFocus(it *ItemData)

ClearFocus removes focus from the provided item if it is currently focused.

func (*Context) ClearRenderTargetPool

func (ctx *Context) ClearRenderTargetPool()

ClearRenderTargetPool releases idle allocations without invalidating windows.

func (*Context) CloseContextMenus

func (ctx *Context) CloseContextMenus()

CloseContextMenus closes all open context menus.

func (*Context) ContextMenusOpen

func (ctx *Context) ContextMenusOpen() bool

ContextMenusOpen reports if any context menus are active.

func (*Context) CurrentStyleName

func (ctx *Context) CurrentStyleName() string

CurrentStyleName returns the active style theme name.

func (*Context) CurrentSyntaxColors

func (ctx *Context) CurrentSyntaxColors() SyntaxColors

CurrentSyntaxColors returns a copy of the active theme's editor palette.

func (*Context) CurrentThemeName

func (ctx *Context) CurrentThemeName() string

CurrentThemeName returns the active theme name.

func (*Context) CursorShape

func (ctx *Context) CursorShape() ebiten.CursorShapeType

CursorShape returns the most recent shape requested by this context's input handling. It can be used by hosts drawing their own pointer.

func (*Context) Dispose

func (ctx *Context) Dispose()

Dispose releases the context's windows, sessions and cached images. It is idempotent and does not invoke application callbacks or dispose app images.

func (*Context) Draw

func (ctx *Context) Draw(screen *ebiten.Image)

Draw renders the UI to the provided screen image. Call this from your Ebiten Draw function.

func (*Context) DrawCheckboxIndicator

func (ctx *Context) DrawCheckboxIndicator(screen *ebiten.Image, bounds image.Rectangle, checked bool)

DrawCheckboxIndicator draws the checkbox surface and checkmark used by EUI controls. It is useful for controls embedded in custom game-view rendering that should retain the active UI theme and style.

func (*Context) DrawItemAt

func (ctx *Context) DrawItemAt(screen *ebiten.Image, item *ItemData, position Point)

DrawItemAt draws an existing item at a pixel position on screen. It is for clients that render an EUI-styled transient item into their own framebuffer instead of an EUI window.

func (*Context) DumpCachedImages

func (ctx *Context) DumpCachedImages() error

DumpCachedImages writes all cached item images and item source images to the debug directory. The game must be running so pixels can be read. Any pending renders are generated before writing the files.

func (*Context) DumpTree

func (ctx *Context) DumpTree() error

DumpTree writes the window and overlay hierarchy to debug/tree.json.

func (*Context) EditableThemeFile

func (ctx *Context) EditableThemeFile(name string, style bool) (string, error)

EditableThemeFile returns a user palette/style file. For a bundled choice, it creates an editable override from the original JSON, preserving references to named colors. Existing user files are never overwritten.

func (*Context) EnsureBoldFontSource

func (ctx *Context) EnsureBoldFontSource(ttf []byte) error

EnsureBoldFontSource initializes the bold font source from ttf data if needed.

func (*Context) EnsureFontSource

func (ctx *Context) EnsureFontSource(ttf []byte) error

EnsureFontSource initializes the font source from ttf data if needed.

func (*Context) Focus

func (ctx *Context) Focus(it *ItemData)

Focus gives keyboard focus to a control and reveals it in scrolling ancestors. Tab strips are focused through their owning flow. Text inputs place the caret at the end; multiline editor Tab/indent behavior is preserved.

func (*Context) FocusedItem

func (ctx *Context) FocusedItem() *ItemData

FocusedItem returns the available control with keyboard focus, including a tab strip. Hidden, disabled, inactive-tab, and closed-window controls return nil.

func (*Context) FocusedTextInput

func (ctx *Context) FocusedTextInput() *ItemData

FocusedTextInput returns the visible, enabled text control with keyboard focus, or nil. Hosts can use this to reserve editing keys from game hotkeys.

func (*Context) FontSource

func (ctx *Context) FontSource() *text.GoTextFaceSource

FontSource returns the current text face source.

func (*Context) GamepadInputHandled

func (ctx *Context) GamepadInputHandled() bool

GamepadInputHandled includes held navigation inputs during repeat delays and modal neutral transitions. Host capture, disabled input and unfocused windows leave gamepad input to the host. Use routed contexts for shared device streams.

func (*Context) GamepadNavigation

func (ctx *Context) GamepadNavigation() bool

func (*Context) HasTextSelection

func (ctx *Context) HasTextSelection() bool

HasTextSelection reports whether Copy is handled by a selected UI text range.

func (*Context) InputEnabled

func (ctx *Context) InputEnabled() bool

func (*Context) IsDisposed

func (ctx *Context) IsDisposed() bool

func (*Context) IsLightTheme

func (ctx *Context) IsLightTheme() bool

IsLightTheme reports whether the active theme uses a light window background.

func (*Context) Layout

func (ctx *Context) Layout(outsideWidth, outsideHeight int) (int, int)

Layout reports the dimensions for the game's screen. Pass Ebiten's outside size values to this from your Layout function.

func (*Context) LayoutWindowBody

func (ctx *Context) LayoutWindowBody(win *WindowData, root, body *ItemData)

LayoutWindowBody fits a vertical root into the window's client area. Body is its scrolling child; other siblings stay docked above or below it. Heights include measured child content, labels, and position gaps rather than a caller-maintained subtraction constant. Call after changing content and on resize. The body must be a direct child of root.

func (*Context) ListStyles

func (ctx *Context) ListStyles() ([]string, error)

ListStyles returns the available style theme names.

func (*Context) ListThemes

func (ctx *Context) ListThemes() ([]string, error)

ListThemes returns the available palette names.

func (*Context) LoadStyle

func (ctx *Context) LoadStyle(name string) error

func (*Context) LoadTheme

func (ctx *Context) LoadTheme(name string) error

LoadTheme reads a theme JSON file from the themes directory and sets it as the current theme without modifying existing windows.

func (*Context) MiddleClickMove

func (ctx *Context) MiddleClickMove() bool

MiddleClickMove reports whether middle-click window dragging is enabled.

func (*Context) ModalWindow

func (ctx *Context) ModalWindow() *WindowData

ModalWindow returns this context's top modal, or nil. Hosts can use it to reserve game input; modality does not change another context's input routing.

func (*Context) NavigationPrompts

func (ctx *Context) NavigationPrompts() []NavigationPrompt

NavigationPrompts returns a fresh slice for the last used navigation device. Gamepads cannot enter text: editable fields retain ordinary keyboard/IME input.

func (*Context) NewActionButton

func (ctx *Context) NewActionButton(label string, action func()) *ItemData

NewActionButton creates a themed button with an optional click callback. Use NewButton when access to the full event handler is needed.

func (*Context) NewButton

func (ctx *Context) NewButton() (*itemData, *EventHandler)

Create a new button from the default theme

func (*Context) NewCheckbox

func (ctx *Context) NewCheckbox() (*itemData, *EventHandler)

Create a new button from the default theme

func (*Context) NewColorSwatch

func (ctx *Context) NewColorSwatch(title string, initial Color, choose func(string, Color, func(Color)), apply func(Color)) *ItemData

NewColorSwatch creates a button that edits a color on click. A nil choose callback opens an independent EUI picker; applications can supply their own picker lifecycle. apply is called only after confirmation and may be nil.

func (*Context) NewColorWheel

func (ctx *Context) NewColorWheel() (*itemData, *EventHandler)

Create a new color wheel from the default theme

func (*Context) NewColumn

func (ctx *Context) NewColumn(children ...*ItemData) *ItemData

NewColumn arranges children vertically. Set Size and Fixed or Scrollable on the returned item when the container needs a fixed viewport instead of auto sizing. ConstrainToSize keeps a non-scrollable flow at its declared size.

func (*Context) NewDropdown

func (ctx *Context) NewDropdown() (*itemData, *EventHandler)

Create a new dropdown from the default theme

func (*Context) NewForm

func (ctx *Context) NewForm(fields ...*FormField) *Form

NewForm arranges fields in a column and snapshots their current committed text as the initial applied values. Foreign, duplicate or reused fields panic before any field is attached. Initial values are not assumed to be valid.

func (*Context) NewFormField

func (ctx *Context) NewFormField(name, label, value string, validators ...TextValidator) *FormField

NewFormField creates a named single-line field. Names must be nonempty and unique within a form. Validation is revealed by Validate/Apply, then updates on committed user edits, undo/redo, ReplaceText and UpdateText. Assigning Text directly requires an explicit Validate. Handler remains available to the host.

func (*Context) NewImageFastItem

func (ctx *Context) NewImageFastItem(w, h int) (*itemData, *ebiten.Image)

Create a new image item with a new image buffer

func (*Context) NewImageItem

func (ctx *Context) NewImageItem(w, h int) (*itemData, *ebiten.Image)

Create a new image item with a new image buffer

func (*Context) NewImageReferenceItem

func (ctx *Context) NewImageReferenceItem(w, h int) *itemData

NewImageReferenceItem creates an image item without allocating a backing render target. Use it when the image will be supplied later or borrowed from a stable cache.

func (*Context) NewInput

func (ctx *Context) NewInput() (*itemData, *EventHandler)

Create a new input box from the default theme

func (*Context) NewItem

func (ctx *Context) NewItem(config ItemData) *ItemData

NewItem creates an owned custom control from configuration. Runtime controls cannot be copied into a new item; use the widget constructors for those.

func (*Context) NewLabel

func (ctx *Context) NewLabel(label string) *ItemData

NewLabel creates a compact, automatically measured label using theme colors.

func (*Context) NewOverlay

func (ctx *Context) NewOverlay(children ...*ItemData) *ItemData

NewOverlay stacks children in one coordinate space. Set each child's Position to place it within the container; later children draw and receive input above earlier children.

func (*Context) NewProgressBar

func (ctx *Context) NewProgressBar() (*itemData, *EventHandler)

Create a new progress bar from the default theme

func (*Context) NewRadio

func (ctx *Context) NewRadio() (*itemData, *EventHandler)

Create a new radio button from the default theme

func (*Context) NewRow

func (ctx *Context) NewRow(children ...*ItemData) *ItemData

NewRow arranges children horizontally.

func (*Context) NewSection

func (ctx *Context) NewSection(title string, width float32) *ItemData

NewSection keeps configuration windows visually consistent. Each section owns its controls, with enough space above the heading to make neighboring groups easy to scan without adding decorative UI machinery.

func (*Context) NewSlider

func (ctx *Context) NewSlider() (*itemData, *EventHandler)

Create a new slider from the default theme

func (*Context) NewSplitButton

func (ctx *Context) NewSplitButton(first, second *ItemData) *ItemData

NewSplitButton joins two buttons into one horizontal control. Each segment keeps its normal click handler, tooltip, enabled state, and requested size. The returned flow can be laid out as one item, so the halves never wrap apart. Either segment can open a menu, making the pair an action/dropdown button.

func (*Context) NewSubheading

func (ctx *Context) NewSubheading(title string, width float32) *ItemData

NewSubheading creates a smaller bold heading for a configuration section.

func (*Context) NewText

func (ctx *Context) NewText() (*itemData, *EventHandler)

Create a new textbox from the default theme

func (*Context) NewTextArea

func (ctx *Context) NewTextArea() (*itemData, *EventHandler)

NewTextArea creates a bounded, multiline text input with horizontal and vertical scrolling. Text is not soft-wrapped. Set AcceptTab for code editing.

func (*Context) NewTextWindow

func (ctx *Context) NewTextWindow(title string, hz HZone, vz VZone, withInput bool) (*WindowData, *ItemData, *ItemData)

NewTextWindow creates a standardized text window with optional input bar.

func (*Context) NewWindow

func (ctx *Context) NewWindow() *windowData

Create a new window from the default theme

func (*Context) NewWrappedLabel

func (ctx *Context) NewWrappedLabel(value string, width float32) *ItemData

NewWrappedLabel creates a label that wraps to width (in logical pixels) and grows vertically. It reflows when the width, font, or UI scale changes. Use SetWrappedText to change its content; Text contains the rendered lines.

func (*Context) ParseColor

func (ctx *Context) ParseColor(data []byte) (Color, error)

ParseColor resolves a theme color name in this context, or any literal color format accepted by Color.UnmarshalJSON. It never consults another context.

func (*Context) PointerCursorClaimed

func (ctx *Context) PointerCursorClaimed() bool

PointerCursorClaimed reports whether EUI selected a non-default cursor for the current frame. Callers that also manage the system cursor should not overwrite it while this is true.

func (*Context) PointerPosition

func (ctx *Context) PointerPosition() (int, int)

PointerPosition returns the current native pointer, or the latest replayed pointer when a custom source is installed. A sole touch (or lowest ID in a multi-touch gesture) takes precedence over the mouse. UI handlers use their latched frame, so calls from an embedding host do not resample UI input.

func (*Context) PointerPressHandled

func (ctx *Context) PointerPressHandled() bool

PointerPressHandled reports whether EUI handled the pointer press this frame.

func (*Context) PointerPressWindow

func (ctx *Context) PointerPressWindow() *WindowData

PointerPressWindow returns the window under the current pointer press. It remains available for the duration of the press even if that window closes.

func (*Context) RenderTargetPoolStats

func (ctx *Context) RenderTargetPoolStats() renderpool.Stats

RenderTargetPoolStats reports active and idle allocations for diagnostics.

func (*Context) SaveTheme

func (ctx *Context) SaveTheme(name string) error

SaveTheme writes the current theme to a JSON file with the given name.

func (*Context) ScreenSize

func (ctx *Context) ScreenSize() (int, int)

ScreenSize returns the current screen size.

func (*Context) ScrollbarWidth

func (ctx *Context) ScrollbarWidth() float32

ScrollbarWidth returns the pixel width used when rendering scrollbars so callers can reserve space and avoid overlap.

func (*Context) SearchActive

func (ctx *Context) SearchActive() bool

SearchActive reports whether a window search box currently has focus.

func (*Context) SetAccentColor

func (ctx *Context) SetAccentColor(c Color)

SetAccentColor updates the accent color in the current theme and applies it to all windows and widgets.

func (*Context) SetAccentSaturation

func (ctx *Context) SetAccentSaturation(s float64)

SetAccentSaturation updates the saturation component of the accent color and reapplies it to the current theme.

func (*Context) SetBoldFontSource

func (ctx *Context) SetBoldFontSource(src *text.GoTextFaceSource)

SetBoldFontSource sets the bold text face source used when rendering bold text.

func (*Context) SetClipboard

func (ctx *Context) SetClipboard(value Clipboard) Clipboard

SetClipboard installs a clipboard and returns the previous one. Passing nil restores the system clipboard. A memory implementation can isolate tests or connect an embedding host's clipboard without touching the operating system.

func (*Context) SetCurrentStyleName

func (ctx *Context) SetCurrentStyleName(name string)

SetCurrentStyleName updates the active style theme name.

func (*Context) SetCurrentThemeName

func (ctx *Context) SetCurrentThemeName(name string)

SetCurrentThemeName updates the active theme name.

func (*Context) SetFontSource

func (ctx *Context) SetFontSource(src *text.GoTextFaceSource)

SetFontSource sets the text face source used when rendering text.

func (*Context) SetGamepadNavigation

func (ctx *Context) SetGamepadNavigation(enabled bool)

SetGamepadNavigation opts this context into standard-layout gamepad input. Disabled by default. Call on the UI goroutine. Switching cancels adjustment capture silently and requires neutral input before a held control can act.

func (*Context) SetInputEnabled

func (ctx *Context) SetInputEnabled(enabled bool)

SetInputEnabled routes input to this instance. Disabled contexts still update animations and draw, retaining focus and values. Disabling cancels captures, menus and native preedit without activation/release events. Use one enabled context for a shared native device stream, or supply routed InputSources.

func (*Context) SetInputSource

func (ctx *Context) SetInputSource(source InputSource) InputSource

SetInputSource selects a source; nil restores native Ebitengine input. It returns the previous source. Call between Update calls on the UI goroutine. Switching starts a new stream: held-input history, gestures, menus, click flashes, and timing baselines reset without emitting activation/release events. Focus, text selection, values, and editor history remain intact.

func (*Context) SetKeyboardInputCaptured

func (ctx *Context) SetKeyboardInputCaptured(captured bool)

SetKeyboardInputCaptured pauses EUI keyboard and gamepad navigation actions while leaving pointer and window controls active.

func (*Context) SetMiddleClickMove

func (ctx *Context) SetMiddleClickMove(enabled bool)

SetMiddleClickMove enables or disables dragging windows with the middle mouse button.

func (*Context) SetPotatoMode

func (ctx *Context) SetPotatoMode(v bool)

SetPotatoMode toggles creation of unmanaged ebiten images.

func (*Context) SetScreenSize

func (ctx *Context) SetScreenSize(w, h int)

SetScreenSize sets the current screen size used for layout calculations.

func (*Context) SetTileDividers

func (ctx *Context) SetTileDividers(dividers []TileDivider)

SetTileDividers replaces the active workspace gutters. Passing nil removes them. Dividers are copied so callers can reuse their input slice.

func (*Context) SetUIScale

func (ctx *Context) SetUIScale(scale float32)

func (*Context) SetUserDataRoot

func (ctx *Context) SetUserDataRoot(root string)

SetUserDataRoot places editable themes and generated theme documentation under the application's persistent user data directory.

func (*Context) SetUserUIScale

func (ctx *Context) SetUserUIScale(scale float32)

SetUserUIScale sets the user's preferred UI scale. The effective scale also includes the active display's device scale factor, keeping controls and text physically readable on Retina and other HiDPI displays.

func (*Context) SetWindowShadows

func (ctx *Context) SetWindowShadows(v bool)

SetWindowShadows controls drop shadows for windows and dropdown menus.

func (*Context) SetWindowSnapping

func (ctx *Context) SetWindowSnapping(enabled bool)

SetWindowSnapping enables or disables window snapping.

func (*Context) ShowColorPicker

func (ctx *Context) ShowColorPicker(title string, initial Color, apply func(Color)) *WindowData

ShowColorPicker opens an independent HSV/opacity editor. Changes remain local until Apply; closing or cancelling discards them. The window removes itself on close. Initialize the EUI font source before opening a picker.

func (*Context) ShowContextMenu

func (ctx *Context) ShowContextMenu(options []string, x, y float32, onSelect func(int)) *ItemData

ShowContextMenu opens a simple context menu at screen pixel position (x, y), reusing dropdown option rendering. onSelect is invoked with the selected index when the user clicks an item. Returns the underlying item handle for advanced customization if desired.

func (*Context) ShowContextMenuWithIcons

func (ctx *Context) ShowContextMenuWithIcons(options []string, icons []*ebiten.Image, x, y float32, onSelect func(int)) *ItemData

ShowContextMenuWithIcons opens a context menu with an optional leading icon for each row. Icons are scaled down with linear filtering and all labels use the same inset, including rows whose matching icon is nil.

func (*Context) ShowModal

func (ctx *Context) ShowModal(title, message string, buttons []PopupButton, extras ...*ItemData) *WindowData

ShowModal opens a modal popup. Explicit Default/Cancel button roles determine Enter/Escape actions. The first button is the default if none is designated; without a cancel action, Escape closes a Closable dialog.

func (*Context) ShowPopup

func (ctx *Context) ShowPopup(title, message string, buttons []PopupButton, extras ...*ItemData) *WindowData

ShowPopup opens a floating, nonmodal dialog. Actions run before close; closing removes the temporary window. Use ShowModal to block other windows.

func (*Context) SizeTextWindowList

func (ctx *Context) SizeTextWindowList(list *ItemData, clientW, clientH float32)

SizeTextWindowList fits a scrolling list below any fixed sibling rows, such as the docked toolbar. Those rows occupy part of the window's client area and must not be included in the list's viewport height.

func (*Context) SubtleAlternateRowColor

func (ctx *Context) SubtleAlternateRowColor() Color

SubtleAlternateRowColor returns a low-contrast opaque row color derived from the active window background.

func (*Context) TextColor

func (ctx *Context) TextColor() Color

TextColor returns the active theme's normal text color.

func (*Context) UIScale

func (ctx *Context) UIScale() float32

func (*Context) Update

func (ctx *Context) Update() (err error)

Update processes input and updates window state. Programs embedding the UI can call this from their Ebiten Update handler.

func (*Context) UpdateTextWindow

func (ctx *Context) UpdateTextWindow(win *WindowData, list, input *ItemData, msgs []string, options TextWindowOptions, wrapCache *TextWindowWrapCache)

UpdateTextWindow updates only rows at or after firstChanged when the width and font configuration is stable. Earlier rows retain their measured layout and rendered content.

func (*Context) UserUIScale

func (ctx *Context) UserUIScale() float32

UserUIScale reports the cross-display UI preference before automatic HiDPI scaling is applied.

func (*Context) ValidateThemeSource

func (ctx *Context) ValidateThemeSource(data []byte) error

ValidateThemeSource checks a palette without changing the active theme.

func (*Context) WindowRepaintStats

func (ctx *Context) WindowRepaintStats() []RepaintStats

func (*Context) WindowSnapping

func (ctx *Context) WindowSnapping() bool

WindowSnapping reports whether window snapping is enabled.

func (*Context) Windows

func (ctx *Context) Windows() []*WindowData

Windows returns a snapshot of this context's window list.

type DragType

type DragType = dragType

type EventHandler

type EventHandler struct {
	Handle func(UIEvent)
	// contains filtered or unexported fields
}

EventHandler delivers events synchronously through Handle. Its zero value is ready to use and allocates no event queue. Configure handlers and emit events on the EUI/game goroutine; a queue may be received from another goroutine, but the event's Item still belongs to the EUI/game goroutine. Do not copy a handler after enabling its queue.

func (*EventHandler) DisableQueue

func (h *EventHandler) DisableQueue()

DisableQueue stops queueing and closes its channel. Buffered events remain readable. Handle continues receiving events, and DroppedEvents is retained until the next EnableQueue call. Repeated calls are harmless.

func (*EventHandler) DroppedEvents

func (h *EventHandler) DroppedEvents() uint64

DroppedEvents counts events rejected by a full queue since EnableQueue. Overflow discards the newest event, preserving the pending FIFO sequence. Handle still receives every event. Read this count on the EUI/game goroutine.

func (*EventHandler) Emit

func (h *EventHandler) Emit(ev UIEvent)

Emit enqueues a value snapshot before synchronously calling Handle. A full queue drops this event without blocking or skipping Handle. Recursive emits run immediately: their callbacks finish before the outer callback returns, while each queue retains emit order. A nil handler is a no-op. Emit only delivers to this handler; it does not activate a widget or invoke its convenience callbacks.

func (*EventHandler) EnableQueue

func (h *EventHandler) EnableQueue(capacity int) <-chan UIEvent

EnableQueue opts into bounded FIFO delivery in addition to Handle. Capacity must be positive or EnableQueue panics. Reconfiguring closes the previous channel (which can still be drained), creates an empty queue, and resets the dropped-event count. EUI owns the channel and never waits for a receiver.

Example
var handler EventHandler
events := handler.EnableQueue(2)
handler.Emit(UIEvent{Type: EventClick})
handler.DisableQueue()
for event := range events {
	fmt.Println(event.Type == EventClick)
}
fmt.Println(handler.DroppedEvents())
Output:
true
0

func (*EventHandler) Events

func (h *EventHandler) Events() <-chan UIEvent

Events returns the current receive-only queue, or nil when queueing is off.

type FlowType

type FlowType = flowType

type Form

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

Form owns a set of text drafts and a separate applied snapshot. It does not write application variables. Copy Values into the model only after Apply succeeds. All methods belong to the context's UI goroutine.

func (*Form) Apply

func (form *Form) Apply() error

Apply validates every field before atomically replacing the applied snapshot. Failure leaves Values unchanged. Success keeps the input's normal undo history.

func (*Form) Cancel

func (form *Form) Cancel()

Cancel restores the last applied values, discards preedit and undo/redo, and hides errors. It emits no change events and does not modify application data.

func (*Form) Dirty

func (form *Form) Dirty() bool

func (*Form) Draft

func (form *Form) Draft() map[string]string

Draft returns a copy of the current committed input text, excluding preedit. Draft and Values include logical password values when inputs use HideText.

func (*Form) Errors

func (form *Form) Errors() map[string]string

Errors returns a copy of the currently revealed errors, keyed by field name.

func (*Form) Fields

func (form *Form) Fields() []*FormField

func (*Form) Validate

func (form *Form) Validate() bool

Validate reveals all errors and focuses the first available invalid field. An active composition retains focus so validation cannot discard preedit.

func (*Form) Values

func (form *Form) Values() map[string]string

Values returns a copy of the last successfully applied (or initial) values.

func (*Form) View

func (form *Form) View() *ItemData

type FormField

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

FormField composes an ordinary input with an inline error label. Its initial value is a draft, not a binding to an application variable. It can belong to one Form. Configure its input before placing it in a window.

func (*FormField) Error

func (field *FormField) Error() string

func (*FormField) ErrorLabel

func (field *FormField) ErrorLabel() *ItemData

func (*FormField) Input

func (field *FormField) Input() *ItemData

func (*FormField) Name

func (field *FormField) Name() string

func (*FormField) Validate

func (field *FormField) Validate() bool

Validate reveals this field's first error. An unfinished composition blocks validation without committing or discarding preedit. All fields are validated, including disabled/hidden fields; use optional/custom rules for conditional data.

func (*FormField) View

func (field *FormField) View() *ItemData

type FormValidationError

type FormValidationError struct{ Fields map[string]string }

FormValidationError reports failed fields without retaining any draft values.

func (*FormValidationError) Error

func (err *FormValidationError) Error() string

type GamepadInput

type GamepadInput struct {
	ID           ebiten.GamepadID
	Buttons      []ebiten.StandardGamepadButton
	LeftX, LeftY float64
}

GamepadInput is one connected controller using Ebitengine's standard layout. Buttons contains all held buttons. Stick values must be finite; values outside [-1, 1] are clamped. Positive X/Y point right/down. Omitted IDs are disconnected.

type HZone

type HZone int

HZone defines the horizontal zone positions.

const (
	HZoneLeft HZone = iota
	HZoneLeftCenter
	HZoneCenterLeft
	HZoneCenter
	HZoneCenterRight
	HZoneRightCenter
	HZoneRight
)

type InputFrame

type InputFrame struct {
	Time               time.Time
	Keys               []ebiten.Key
	MouseButtons       []ebiten.MouseButton
	PointerX, PointerY int
	Touches            []TouchPoint
	// Gamepads lists connected standard-layout controllers and all held inputs.
	Gamepads       []GamepadInput
	WheelX, WheelY float64
	Text           string
	Mac            bool
	// TextInput is an ordered packet of composition notifications for this tick.
	// It takes precedence over Text; active preedit also suppresses ordinary keys.
	TextInput []TextInputEvent
	// Unfocused cancels composition and suspends keyboard input while retaining
	// control focus for the host's return.
	Unfocused bool
}

InputFrame describes one Update tick. Keys, MouseButtons, and Touches contain all currently held inputs, not just changes. Text and wheel deltas belong only to this tick. Time must be nonzero and nondecreasing within an input stream. Mac selects Command/Option editing rules; native input sets it from the OS. EUI reads the slices during Update and does not retain or mutate them.

type InputSource

type InputSource func() InputFrame

InputSource is sampled exactly once at the start of each Update. A source can replay recorded frames or adapt another host's input system. Return a fresh complete state each tick, and call Update once per tick as usual.

type Insets

type Insets struct{ Left, Top, Right, Bottom float32 }

Insets describes logical space inside a flow around its children.

type ItemData

type ItemData = itemData

func (*ItemData) AddItem

func (parent *ItemData) AddItem(child *ItemData)

AddItem appends a child item to the parent item.

func (*ItemData) InsertItem

func (parent *ItemData) InsertItem(idx int, child *ItemData)

InsertItem inserts a child item into the parent item at the provided index.

func (*ItemData) PrependItem

func (parent *ItemData) PrependItem(child *ItemData)

PrependItem prepends a child item to the parent item.

func (*ItemData) RemoveItem

func (parent *ItemData) RemoveItem(child *ItemData)

RemoveItem removes a child item from the parent item.

func (*ItemData) ReplaceItem

func (parent *ItemData) ReplaceItem(idx int, child *ItemData)

ReplaceItem replaces the child item at the provided index with the new item.

func (*ItemData) SetItems

func (parent *ItemData) SetItems(children []*ItemData)

SetItems replaces a parent's children in one batch and invalidates layout.

func (*ItemData) UpdateText

func (item *ItemData) UpdateText(text string)

UpdateText silently updates text and reflows layout as needed. For inputs it replaces the logical value (including masked passwords), synchronizes TextPtr, resets undo history, and clamps caret/selection. ReplaceText is an undoable editing command and emits EventInputChanged instead.

type ItemTypeData

type ItemTypeData = itemTypeData

type LayoutAlign

type LayoutAlign uint8

LayoutAlign positions children in unused flow space. Fill is configured on each child separately; alignment never stretches a child's preferred size.

const (
	LayoutStart LayoutAlign = iota
	LayoutCenter
	LayoutEnd
)
type NavigationPrompt struct{ Action, Label string }

NavigationPrompt describes a host-rendered input hint. Labels use physical standard-layout positions, so they do not assume an Xbox/PlayStation/Switch brand.

type PinType

type PinType = pinType

type Point

type Point = point

type PopupButton

type PopupButton struct {
	Text       string
	Width      float32
	Color      *Color
	HoverColor *Color
	Action     func()
	// Default selects the Enter action; Cancel selects Escape/close in a modal.
	Default, Cancel bool
}

PopupButton defines a button in a popup dialog.

type Rect

type Rect = rect

type RepaintStats

type RepaintStats struct {
	Title                         string
	Count, Pixels, DeferredFrames uint64
	LastPixels                    int
	LastDuration                  time.Duration
	LastReason                    string
}

RepaintStats measures cached-window work. Duration is CPU submission time, not GPU execution time. Call WindowRepaintStats on the UI thread.

type RoundRect

type RoundRect = roundRect

type SliderRange

type SliderRange struct {
	Start float32
	End   float32
	Color Color
}

SliderRange highlights an interval on a slider track using slider values.

type StyleBools

type StyleBools struct {
	Window   bool
	Button   bool
	Text     bool
	Checkbox bool
	Radio    bool
	Input    bool
	Slider   bool
	Dropdown bool
	Tab      bool
}

type StyleNumbers

type StyleNumbers struct {
	Window   float32
	Button   float32
	Text     float32
	Checkbox float32
	Radio    float32
	Input    float32
	Slider   float32
	Dropdown float32
	Tab      float32
}

StyleTheme controls spacing and padding used by widgets.

type StyleTheme

type StyleTheme struct {
	SliderValueGap   float32
	DropdownArrowPad float32
	TextPadding      float32

	Fillet        StyleNumbers
	Border        StyleNumbers
	BorderPad     StyleNumbers
	Filled        StyleBools
	Outlined      StyleBools
	ActiveOutline StyleBools
}

type SyntaxColors

type SyntaxColors struct {
	Comments  Color
	Strings   Color
	Keywords  Color
	Numbers   Color
	Variables Color
	Bindings  Color
}

SyntaxColors is the palette shared by source-code editors.

func DefaultSyntaxColors

func DefaultSyntaxColors(background Color) SyntaxColors

DefaultSyntaxColors supplies readable defaults for palettes that omit syntax colors, based on the palette's input background.

func (SyntaxColors) MarshalJSON

func (colors SyntaxColors) MarshalJSON() ([]byte, error)

MarshalJSON keeps saved editor colors exact, including their opacity.

type TextColorSpan

type TextColorSpan struct {
	Start, End int
	Color      Color
}

TextColorSpan colors [Start, End) in source rune offsets, before tab expansion. Uncovered text uses the control's normal caption color. A shaped glyph uses the color at its starting rune, so coloring never splits a glyph or ligature.

type TextHighlighter

type TextHighlighter func(string) []TextColorSpan

TextHighlighter supplies foreground colors for an editable control's text. It runs synchronously when drawing changed text; it should be fast and must not modify the control. EUI copies and caches the returned spans. Out-of-range endpoints are clamped; empty ranges are ignored. Earlier-starting spans win overlaps, with input order breaking ties. Password controls are never passed to a highlighter.

type TextInputEvent

type TextInputEvent struct {
	Kind                         TextInputKind
	Text                         string
	SelectionStart, SelectionEnd int
	Replacement                  *TextReplacement
	Target                       *ItemData
	Passthrough                  bool
}

TextInputEvent carries preedit or committed text. SelectionStart/End are rune offsets within composition Text. A nil Replacement commits at the selection. Target, when set, prevents late events from reaching another focused control. Passthrough permits the triggering key to continue after this notification. Preedit never changes Text, bindings, undo history, or InputChanged events.

type TextInputKind

type TextInputKind uint8

TextInputKind describes an ordered IME notification in an InputFrame.

const (
	TextInputCompose TextInputKind = iota
	TextInputCommit
	TextInputCancel
	TextInputEnd
)

type TextReplacement

type TextReplacement struct{ Start, End, Caret int }

TextReplacement replaces a document rune range. Caret is a rune offset in the normalized replacement text, or -1 for its end. Native adapters use this for reconversion, autocorrection, and surrounding-text edits.

type TextSpan

type TextSpan struct {
	Start          int
	End            int
	MatchTextColor bool
}

type TextValidator

type TextValidator func(string) string

TextValidator returns an inline error, or an empty string for a valid value. Validators run synchronously on the UI goroutine. They must not mutate UI or model state. Values are committed text, never IME preedit.

func IntegerRange

func IntegerRange(minimum, maximum int64) TextValidator

IntegerRange accepts base-10 int64 values within inclusive bounds. Empty text is optional; combine with Required. Invalid bounds panic.

func NumberRange

func NumberRange(minimum, maximum float64) TextValidator

NumberRange accepts finite decimal/scientific numbers within inclusive bounds. Empty text is optional; combine with Required when needed. Invalid bounds panic.

type TextWindowOptions

type TextWindowOptions struct {
	FontSize   float64
	FontSource *text.GoTextFaceSource
	// Face optionally supplies a composed face, already sized in pixels.
	// It overrides FontSource for both layout and rendering.
	Face          text.Face
	AlternateRows bool
	FirstChanged  int
	OnURLClick    func(string)
	InputText     string
	InputEditable bool
	// InputExternalEditing leaves keyboard mutation to the embedding app while
	// retaining EUI pointer cursor placement and selection.
	InputExternalEditing bool
	// InputAction is an optional fixed control to the right of the input.
	InputAction *ItemData
	// InputUnderlines receives wrapped input and returns rune-indexed spans.
	// A nil callback leaves the input without annotations.
	InputUnderlines func(string) []TextSpan
}

TextWindowOptions supplies content styling and application behavior for a text window. Set FontSize in logical UI units. Fonts default to FontSource(). FirstChanged may skip unchanged rows; pass zero when styling or callbacks change. Width and font changes always invalidate that optimization.

type TextWindowWrapCache

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

TextWindowWrapCache keeps wrapping work proportional to new messages. The zero value is ready to use; keep one cache per window. Existing messages are rewrapped only when the effective width or font changes.

type Theme

type Theme struct {
	Syntax   SyntaxColors
	Window   windowData
	Button   itemData
	Text     itemData
	Checkbox itemData
	Radio    itemData
	Input    itemData
	Slider   itemData
	Dropdown itemData
	Progress itemData
	Tab      itemData
}

Theme bundles all style information for windows and widgets.

type TileDivider

type TileDivider struct {
	Orientation TileDividerOrientation
	Position    float32
	Start       float32
	End         float32
	Thickness   float32
	HitSize     float32
	OnDrag      func(position float32)
}

TileDivider is a screen-space divider owned by a tiled workspace. Position is the Y coordinate for a horizontal divider and X for a vertical divider; Start and End delimit its span on the other axis.

type TileDividerOrientation

type TileDividerOrientation uint8

TileDividerOrientation describes the direction of a tiled-workspace gutter.

const (
	TileDividerHorizontal TileDividerOrientation = iota
	TileDividerVertical
)

type TouchPoint

type TouchPoint struct {
	ID   ebiten.TouchID
	X, Y int
}

TouchPoint is one active contact in screen pixels. IDs remain stable until that contact lifts; the lowest active ID determines the primary touch.

type UIEvent

type UIEvent struct {
	Item    *ItemData
	Type    UIEventType
	Value   float32
	Index   int
	Checked bool
	Color   Color
	Text    string
}

UIEvent snapshots a user interaction after the widget state is updated. Payload fields are values; Item is a live handle, not a copy of widget state. Password input Text contains the masked display, not the secret value.

type UIEventType

type UIEventType int

UIEventType defines the kind of event emitted by widgets.

const (
	EventClick UIEventType = iota
	EventSliderChanged
	EventDropdownSelected
	EventCheckboxChanged
	EventRadioSelected
	EventColorChanged
	EventInputChanged
	// EventSliderReleased ends a changed pointer or keyboard slider interaction.
	EventSliderReleased
)

type VZone

type VZone int

VZone defines the vertical zone positions.

const (
	VZoneTop VZone = iota
	VZoneTopMiddle
	VZoneMiddleTop
	VZoneCenter
	VZoneMiddleBottom
	VZoneBottomMiddle
	VZoneBottom
)

type WindowData

type WindowData = windowData

func (*WindowData) AddItem

func (win *WindowData) AddItem(child *ItemData)

AddItem appends a child item to the window.

func (*WindowData) InsertItem

func (win *WindowData) InsertItem(idx int, child *ItemData)

InsertItem inserts a child item into the window at the provided index.

func (*WindowData) PrependItem

func (win *WindowData) PrependItem(child *ItemData)

PrependItem prepends a child item to the window.

func (*WindowData) RemoveItem

func (win *WindowData) RemoveItem(child *ItemData)

RemoveItem removes a child item from the window.

func (*WindowData) ReplaceItem

func (win *WindowData) ReplaceItem(idx int, child *ItemData)

ReplaceItem replaces the child item at the provided index in the window.

Directories

Path Synopsis
examples
basic command
A standalone EUI application: no goThoom resources or settings are needed.
A standalone EUI application: no goThoom resources or settings are needed.
studio command
EUI Studio is a working UI playground.
EUI Studio is a working UI playground.
internal
inputkeys
Package inputkeys keeps desktop editing shortcuts consistent across the UI.
Package inputkeys keeps desktop editing shortcuts consistent across the UI.
Package renderpool recycles render-target allocations.
Package renderpool recycles render-target allocations.

Jump to

Keyboard shortcuts

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