Documentation
¶
Index ¶
- Constants
- Variables
- func MeasureTextWidth(s string, face text.Face) float64
- func Required(value string) string
- func SetColorSwatch(item *ItemData, col Color)
- func SetProgressIndeterminate(pb *ItemData, ind bool)
- func ValidateStyleSource(data []byte) error
- func WrapText(s string, face text.Face, maxWidth float64) (int, []string)
- type AlignType
- type Clipboard
- type Color
- type Context
- func (ctx *Context) AccentColor() Color
- func (ctx *Context) AccentSaturation() float64
- func (ctx *Context) ActiveGamepad() (ebiten.GamepadID, bool)
- func (ctx *Context) ApplyBoldFace(it *ItemData)
- func (ctx *Context) BoldFontSource() *text.GoTextFaceSource
- func (ctx *Context) ClearFocus(it *ItemData)
- func (ctx *Context) ClearRenderTargetPool()
- func (ctx *Context) CloseContextMenus()
- func (ctx *Context) ContextMenusOpen() bool
- func (ctx *Context) CurrentStyleName() string
- func (ctx *Context) CurrentSyntaxColors() SyntaxColors
- func (ctx *Context) CurrentThemeName() string
- func (ctx *Context) CursorShape() ebiten.CursorShapeType
- func (ctx *Context) Dispose()
- func (ctx *Context) Draw(screen *ebiten.Image)
- func (ctx *Context) DrawCheckboxIndicator(screen *ebiten.Image, bounds image.Rectangle, checked bool)
- func (ctx *Context) DrawItemAt(screen *ebiten.Image, item *ItemData, position Point)
- func (ctx *Context) DumpCachedImages() error
- func (ctx *Context) DumpTree() error
- func (ctx *Context) EditableThemeFile(name string, style bool) (string, error)
- func (ctx *Context) EnsureBoldFontSource(ttf []byte) error
- func (ctx *Context) EnsureFontSource(ttf []byte) error
- func (ctx *Context) Focus(it *ItemData)
- func (ctx *Context) FocusedItem() *ItemData
- func (ctx *Context) FocusedTextInput() *ItemData
- func (ctx *Context) FontSource() *text.GoTextFaceSource
- func (ctx *Context) GamepadInputHandled() bool
- func (ctx *Context) GamepadNavigation() bool
- func (ctx *Context) HasTextSelection() bool
- func (ctx *Context) InputEnabled() bool
- func (ctx *Context) IsDisposed() bool
- func (ctx *Context) IsLightTheme() bool
- func (ctx *Context) Layout(outsideWidth, outsideHeight int) (int, int)
- func (ctx *Context) LayoutWindowBody(win *WindowData, root, body *ItemData)
- func (ctx *Context) ListStyles() ([]string, error)
- func (ctx *Context) ListThemes() ([]string, error)
- func (ctx *Context) LoadStyle(name string) error
- func (ctx *Context) LoadTheme(name string) error
- func (ctx *Context) MiddleClickMove() bool
- func (ctx *Context) ModalWindow() *WindowData
- func (ctx *Context) NavigationPrompts() []NavigationPrompt
- func (ctx *Context) NewActionButton(label string, action func()) *ItemData
- func (ctx *Context) NewButton() (*itemData, *EventHandler)
- func (ctx *Context) NewCheckbox() (*itemData, *EventHandler)
- func (ctx *Context) NewColorSwatch(title string, initial Color, choose func(string, Color, func(Color)), ...) *ItemData
- func (ctx *Context) NewColorWheel() (*itemData, *EventHandler)
- func (ctx *Context) NewColumn(children ...*ItemData) *ItemData
- func (ctx *Context) NewDropdown() (*itemData, *EventHandler)
- func (ctx *Context) NewForm(fields ...*FormField) *Form
- func (ctx *Context) NewFormField(name, label, value string, validators ...TextValidator) *FormField
- func (ctx *Context) NewImageFastItem(w, h int) (*itemData, *ebiten.Image)
- func (ctx *Context) NewImageItem(w, h int) (*itemData, *ebiten.Image)
- func (ctx *Context) NewImageReferenceItem(w, h int) *itemData
- func (ctx *Context) NewInput() (*itemData, *EventHandler)
- func (ctx *Context) NewItem(config ItemData) *ItemData
- func (ctx *Context) NewLabel(label string) *ItemData
- func (ctx *Context) NewOverlay(children ...*ItemData) *ItemData
- func (ctx *Context) NewProgressBar() (*itemData, *EventHandler)
- func (ctx *Context) NewRadio() (*itemData, *EventHandler)
- func (ctx *Context) NewRow(children ...*ItemData) *ItemData
- func (ctx *Context) NewSection(title string, width float32) *ItemData
- func (ctx *Context) NewSlider() (*itemData, *EventHandler)
- func (ctx *Context) NewSplitButton(first, second *ItemData) *ItemData
- func (ctx *Context) NewSubheading(title string, width float32) *ItemData
- func (ctx *Context) NewText() (*itemData, *EventHandler)
- func (ctx *Context) NewTextArea() (*itemData, *EventHandler)
- func (ctx *Context) NewTextWindow(title string, hz HZone, vz VZone, withInput bool) (*WindowData, *ItemData, *ItemData)
- func (ctx *Context) NewWindow() *windowData
- func (ctx *Context) NewWrappedLabel(value string, width float32) *ItemData
- func (ctx *Context) ParseColor(data []byte) (Color, error)
- func (ctx *Context) PointerCursorClaimed() bool
- func (ctx *Context) PointerPosition() (int, int)
- func (ctx *Context) PointerPressHandled() bool
- func (ctx *Context) PointerPressWindow() *WindowData
- func (ctx *Context) RenderTargetPoolStats() renderpool.Stats
- func (ctx *Context) SaveTheme(name string) error
- func (ctx *Context) ScreenSize() (int, int)
- func (ctx *Context) ScrollbarWidth() float32
- func (ctx *Context) SearchActive() bool
- func (ctx *Context) SetAccentColor(c Color)
- func (ctx *Context) SetAccentSaturation(s float64)
- func (ctx *Context) SetBoldFontSource(src *text.GoTextFaceSource)
- func (ctx *Context) SetClipboard(value Clipboard) Clipboard
- func (ctx *Context) SetCurrentStyleName(name string)
- func (ctx *Context) SetCurrentThemeName(name string)
- func (ctx *Context) SetFontSource(src *text.GoTextFaceSource)
- func (ctx *Context) SetGamepadNavigation(enabled bool)
- func (ctx *Context) SetInputEnabled(enabled bool)
- func (ctx *Context) SetInputSource(source InputSource) InputSource
- func (ctx *Context) SetKeyboardInputCaptured(captured bool)
- func (ctx *Context) SetMiddleClickMove(enabled bool)
- func (ctx *Context) SetPotatoMode(v bool)
- func (ctx *Context) SetScreenSize(w, h int)
- func (ctx *Context) SetTileDividers(dividers []TileDivider)
- func (ctx *Context) SetUIScale(scale float32)
- func (ctx *Context) SetUserDataRoot(root string)
- func (ctx *Context) SetUserUIScale(scale float32)
- func (ctx *Context) SetWindowShadows(v bool)
- func (ctx *Context) SetWindowSnapping(enabled bool)
- func (ctx *Context) ShowColorPicker(title string, initial Color, apply func(Color)) *WindowData
- func (ctx *Context) ShowContextMenu(options []string, x, y float32, onSelect func(int)) *ItemData
- func (ctx *Context) ShowContextMenuWithIcons(options []string, icons []*ebiten.Image, x, y float32, onSelect func(int)) *ItemData
- func (ctx *Context) ShowModal(title, message string, buttons []PopupButton, extras ...*ItemData) *WindowData
- func (ctx *Context) ShowPopup(title, message string, buttons []PopupButton, extras ...*ItemData) *WindowData
- func (ctx *Context) SizeTextWindowList(list *ItemData, clientW, clientH float32)
- func (ctx *Context) SubtleAlternateRowColor() Color
- func (ctx *Context) TextColor() Color
- func (ctx *Context) UIScale() float32
- func (ctx *Context) Update() (err error)
- func (ctx *Context) UpdateTextWindow(win *WindowData, list, input *ItemData, msgs []string, ...)
- func (ctx *Context) UserUIScale() float32
- func (ctx *Context) ValidateThemeSource(data []byte) error
- func (ctx *Context) WindowRepaintStats() []RepaintStats
- func (ctx *Context) WindowSnapping() bool
- func (ctx *Context) Windows() []*WindowData
- type DragType
- type EventHandler
- type FlowType
- type Form
- func (form *Form) Apply() error
- func (form *Form) Cancel()
- func (form *Form) Dirty() bool
- func (form *Form) Draft() map[string]string
- func (form *Form) Errors() map[string]string
- func (form *Form) Fields() []*FormField
- func (form *Form) Validate() bool
- func (form *Form) Values() map[string]string
- func (form *Form) View() *ItemData
- type FormField
- type FormValidationError
- type GamepadInput
- type HZone
- type InputFrame
- type InputSource
- type Insets
- type ItemData
- func (parent *ItemData) AddItem(child *ItemData)
- func (parent *ItemData) InsertItem(idx int, child *ItemData)
- func (parent *ItemData) PrependItem(child *ItemData)
- func (parent *ItemData) RemoveItem(child *ItemData)
- func (parent *ItemData) ReplaceItem(idx int, child *ItemData)
- func (parent *ItemData) SetItems(children []*ItemData)
- func (item *ItemData) UpdateText(text string)
- type ItemTypeData
- type LayoutAlign
- type NavigationPrompt
- type PinType
- type Point
- type PopupButton
- type Rect
- type RepaintStats
- type RoundRect
- type SliderRange
- type StyleBools
- type StyleNumbers
- type StyleTheme
- type SyntaxColors
- type TextColorSpan
- type TextHighlighter
- type TextInputEvent
- type TextInputKind
- type TextReplacement
- type TextSpan
- type TextValidator
- type TextWindowOptions
- type TextWindowWrapCache
- type Theme
- type TileDivider
- type TileDividerOrientation
- type TouchPoint
- type UIEvent
- type UIEventType
- type VZone
- type WindowData
Examples ¶
Constants ¶
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 )
const ( ALIGN_NONE = iota ALIGN_LEFT ALIGN_CENTER ALIGN_RIGHT )
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 )
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 )
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 )
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.
const (
// MinWindowSize is the floating-window minimum and preferred tile minimum.
MinWindowSize = 64
)
const UnsnapThreshold float32 = 22
UnsnapThreshold defines how far the pointer-relative window position must move from a magnetic anchor before that axis releases.
Variables ¶
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) 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) 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) 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) )
var ErrContextDisposed = errors.New("eui: context is disposed")
var ErrContextReentry = errors.New("eui: recursive Update/Draw on the same context")
Functions ¶
func MeasureTextWidth ¶
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 SetColorSwatch ¶
SetColorSwatch updates a swatch and refreshes its window.
func SetProgressIndeterminate ¶
SetProgressIndeterminate updates the indeterminate state of a progress bar and refreshes its parent window's tracking flag.
func ValidateStyleSource ¶
ValidateStyleSource checks style values without changing the active style.
func WrapText ¶
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 Clipboard ¶
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 ¶
func NewColorHSV ¶
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) MarshalJSON ¶
MarshalJSON implements json.Marshaler using HSV representation.
func (*Color) UnmarshalJSON ¶
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 ¶
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 ¶
AccentColor returns the current accent color.
func (*Context) AccentSaturation ¶
AccentSaturation returns the current accent color saturation value.
func (*Context) ActiveGamepad ¶
ActiveGamepad returns the controller that most recently acquired navigation. Ownership is retained until disconnection or input routing/configuration reset.
func (*Context) ApplyBoldFace ¶
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 ¶
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 ¶
ContextMenusOpen reports if any context menus are active.
func (*Context) CurrentStyleName ¶
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 ¶
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 ¶
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 ¶
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 ¶
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) EditableThemeFile ¶
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 ¶
EnsureBoldFontSource initializes the bold font source from ttf data if needed.
func (*Context) EnsureFontSource ¶
EnsureFontSource initializes the font source from ttf data if needed.
func (*Context) Focus ¶
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 ¶
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 ¶
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 ¶
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 (*Context) HasTextSelection ¶
HasTextSelection reports whether Copy is handled by a selected UI text range.
func (*Context) InputEnabled ¶
func (*Context) IsDisposed ¶
func (*Context) IsLightTheme ¶
IsLightTheme reports whether the active theme uses a light window background.
func (*Context) Layout ¶
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 ¶
ListStyles returns the available style theme names.
func (*Context) ListThemes ¶
ListThemes returns the available palette names.
func (*Context) LoadTheme ¶
LoadTheme reads a theme JSON file from the themes directory and sets it as the current theme without modifying existing windows.
func (*Context) MiddleClickMove ¶
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 ¶
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 ¶
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 ¶
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 ¶
Create a new image item with a new image buffer
func (*Context) NewImageItem ¶
Create a new image item with a new image buffer
func (*Context) NewImageReferenceItem ¶
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 ¶
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 ¶
NewLabel creates a compact, automatically measured label using theme colors.
func (*Context) NewOverlay ¶
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) NewSection ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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) ScreenSize ¶
ScreenSize returns the current screen size.
func (*Context) ScrollbarWidth ¶
ScrollbarWidth returns the pixel width used when rendering scrollbars so callers can reserve space and avoid overlap.
func (*Context) SearchActive ¶
SearchActive reports whether a window search box currently has focus.
func (*Context) SetAccentColor ¶
SetAccentColor updates the accent color in the current theme and applies it to all windows and widgets.
func (*Context) SetAccentSaturation ¶
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 ¶
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 ¶
SetCurrentStyleName updates the active style theme name.
func (*Context) SetCurrentThemeName ¶
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 ¶
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 ¶
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 ¶
SetKeyboardInputCaptured pauses EUI keyboard and gamepad navigation actions while leaving pointer and window controls active.
func (*Context) SetMiddleClickMove ¶
SetMiddleClickMove enables or disables dragging windows with the middle mouse button.
func (*Context) SetPotatoMode ¶
SetPotatoMode toggles creation of unmanaged ebiten images.
func (*Context) SetScreenSize ¶
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 (*Context) SetUserDataRoot ¶
SetUserDataRoot places editable themes and generated theme documentation under the application's persistent user data directory.
func (*Context) SetUserUIScale ¶
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 ¶
SetWindowShadows controls drop shadows for windows and dropdown menus.
func (*Context) SetWindowSnapping ¶
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 ¶
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 ¶
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 ¶
SubtleAlternateRowColor returns a low-contrast opaque row color derived from the active window background.
func (*Context) Update ¶
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 ¶
UserUIScale reports the cross-display UI preference before automatic HiDPI scaling is applied.
func (*Context) ValidateThemeSource ¶
ValidateThemeSource checks a palette without changing the active theme.
func (*Context) WindowRepaintStats ¶
func (ctx *Context) WindowRepaintStats() []RepaintStats
func (*Context) WindowSnapping ¶
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 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 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 ¶
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) Draft ¶
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) Validate ¶
Validate reveals all errors and focuses the first available invalid field. An active composition retains focus so validation cannot discard preedit.
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) ErrorLabel ¶
type FormValidationError ¶
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 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) InsertItem ¶
InsertItem inserts a child item into the parent item at the provided index.
func (*ItemData) PrependItem ¶
PrependItem prepends a child item to the parent item.
func (*ItemData) RemoveItem ¶
RemoveItem removes a child item from the parent item.
func (*ItemData) ReplaceItem ¶
ReplaceItem replaces the child item at the provided index with the new item.
func (*ItemData) SetItems ¶
SetItems replaces a parent's children in one batch and invalidates layout.
func (*ItemData) UpdateText ¶
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 ¶
NavigationPrompt describes a host-rendered input hint. Labels use physical standard-layout positions, so they do not assume an Xbox/PlayStation/Switch brand.
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 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 SliderRange ¶
SliderRange highlights an interval on a slider track using slider values.
type StyleBools ¶
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 ¶
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 TextValidator ¶
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 ¶
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 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.
Source Files
¶
- builders.go
- button_colors.go
- clipboard.go
- color_hsv.go
- color_picker.go
- color_utils.go
- color_wheel.go
- colors.go
- const.go
- content_layout.go
- context.go
- context_lifecycle.go
- context_menu.go
- contrast.go
- defaults.go
- dropdown_layout.go
- dump.go
- events.go
- focus_render.go
- focus_scroll.go
- fontcache.go
- form.go
- gamepad.go
- geometry.go
- glob.go
- input.go
- input_source.go
- keyboard.go
- modal.go
- pointer.go
- popup.go
- potato.go
- primitive_cache.go
- public.go
- render.go
- repaint.go
- responsive_layout.go
- runtime_state.go
- sections.go
- shadow.go
- split_button.go
- struct.go
- style.go
- syntax_colors.go
- tab_layout.go
- text_buffer.go
- text_cache.go
- text_composition.go
- text_edit.go
- text_edit_input.go
- text_edit_layout.go
- text_edit_scroll.go
- text_edit_search.go
- text_highlight.go
- text_input_native.go
- text_line_navigation.go
- text_metrics.go
- text_swatches.go
- text_window.go
- text_wrap_cache.go
- textwrap.go
- theme.go
- theme_decode.go
- theme_docs.go
- theme_source.go
- tile_divider.go
- tooltip_indicator.go
- tree.go
- util.go
- visibility.go
- watchers.go
- window.go
- wrapped_label.go
- zones.go
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. |
