widgets

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: GPL-3.0 Imports: 16 Imported by: 1 module, 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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionRow added in v0.7.0

func ActionRow(buttons ...*widget.Button) *widget.Container

ActionRow creates the action button row of a form or sub-view: the buttons right-aligned in the order given. Put the confirming action first, as a primary button, and Cancel or Done last. The returned container has RowLayoutData{Stretch: true} for use in row layouts.

func AlternatingRowColor

func AlternatingRowColor(index int) color.Color

AlternatingRowColor returns the appropriate background color for alternating rows. Even indices (0, 2, 4...) return style.Background, odd indices return style.Surface.

func ButtonRow

func ButtonRow() *widget.Container

ButtonRow creates a horizontal container for buttons with standard spacing.

func ButtonWidth added in v0.7.0

func ButtonWidth(label string) int

ButtonWidth returns the width of a button with the given label and style.ButtonPaddingSmall text padding

func CenteredContainer

func CenteredContainer(spacing int) *widget.Container

CenteredContainer creates a container with vertical layout, centered in its parent. Use for modal dialogs, status screens, and centered content. The spacing parameter controls vertical spacing between children.

func ClipboardRead added in v0.7.0

func ClipboardRead() (string, bool)

ClipboardRead returns the clipboard text. ok is false when no clipboard is available or it holds no text.

func ClipboardWrite added in v0.7.0

func ClipboardWrite(s string) bool

ClipboardWrite puts s on the system clipboard. It reports false when no clipboard is available or the write fails.

func CycleButton added in v0.7.0

func CycleButton(label string, current, count, minWidth int, handler func(next int)) *widget.Button

CycleButton creates a settings row button that steps through count values, showing label for the current one. Pressing it calls handler with the index after current, wrapping to the first; a current of -1, a value not in the list, steps to the first. With no values pressing it does nothing. It is at least minWidth wide and vertically centered in its grid cell.

func EmptyState

func EmptyState(title, subtitle string, button *widget.Button) *widget.Container

EmptyState creates a centered empty state display with title, optional subtitle, and optional button. The returned container has RowLayoutData{Stretch: true} for use in row layouts. Pass empty string for subtitle to omit it. Pass nil for button to omit it.

func EnabledTextButton added in v0.7.0

func EnabledTextButton(text string, padding int, enabled bool, handler func(*widget.ButtonClickedEventArgs)) *widget.Button

EnabledTextButton creates a text button in the normal style, or in the disabled style when not enabled. The handler runs only when enabled.

func FillContainer added in v0.7.0

func FillContainer() *widget.Container

FillContainer creates a single cell container whose child is stretched to fill it. Use as the outer container of a sidebar section's content so scrollable content can stretch to the content area.

func LabeledText

func LabeledText(label, subtext string) *widget.Container

LabeledText creates a vertical container with a primary label and optional secondary subtext. style.Text is vertically centered within the grid cell.

func NoticeText added in v0.7.0

func NoticeText(text string) *widget.Text

NoticeText creates a line of secondary text for notes and hints

func OnOffButton added in v0.7.0

func OnOffButton(on bool, handler func(*widget.ButtonClickedEventArgs)) *widget.Button

OnOffButton creates a settings row toggle labeled "On" or "Off", in the active style when on, vertically centered in its grid cell

func OnOffButtonWidth added in v0.7.0

func OnOffButtonWidth() int

OnOffButtonWidth returns the width an OnOffButton takes in either state

func PageRowWidth added in v0.7.0

func PageRowWidth(contentWidth int) int

PageRowWidth returns the width of a row in a page's scrollable content when the page content is contentWidth wide. See PageScrollOpts.

func PrimaryTextButton

func PrimaryTextButton(text string, padding int, handler func(*widget.ButtonClickedEventArgs)) *widget.Button

PrimaryTextButton creates a prominent text button with primary styling. Use for main actions like "Play", "Save", "Scan Library".

func RowLabelWidth added in v0.7.0

func RowLabelWidth(rowWidth, padding int, controlWidths ...int) int

RowLabelWidth returns the width left for the label column of a row grid that is rowWidth wide with the given padding and style.DefaultSpacing between columns, after each control column. It is never below minRowLabelWidth.

func ScreenContainer

func ScreenContainer() *widget.Container

ScreenContainer creates a full-screen root container with background. The container uses AnchorLayout so children can stretch to fill.

func ScreenContentContainer

func ScreenContentContainer(rowStretch []bool) *widget.Container

ScreenContentContainer creates an inner container for screen content. Uses a single-column GridLayout with default padding and spacing. The stretch parameter controls which rows stretch vertically.

func ScrollSlider

func ScrollSlider(scrollContainer *ScrollView, needsScroll func() bool) *widget.Slider

ScrollSlider creates a vertical scroll slider bound to a scroll container. The needsScroll function should return true when content exceeds view height. Returns the slider widget.

func SectionHeader added in v0.7.0

func SectionHeader(title string) *widget.Container

SectionHeader creates a header row with the title in the accent color. The returned container has RowLayoutData{Stretch: true} for use in row layouts.

func SettingsRow

func SettingsRow(columns int) *widget.Container

SettingsRow creates a standard settings row container with style.Surface background, N-column grid layout, and RowLayoutData stretch.

func SettingsRowLabelWidth added in v0.7.0

func SettingsRowLabelWidth(rowWidth int, controlWidths ...int) int

SettingsRowLabelWidth returns the width left for the label column of a SettingsRow that is rowWidth wide. See RowLabelWidth.

func SetupScrollHandler

func SetupScrollHandler(scrollContainer *ScrollView, vSlider *widget.Slider, needsScroll func() bool)

SetupScrollHandler adds mouse wheel scroll support to a scroll container. The slider's Current value is kept in sync with scroll position.

func ShortcutModifierPressed added in v0.7.0

func ShortcutModifierPressed() bool

ShortcutModifierPressed reports whether the platform's shortcut modifier is held: Cmd on macOS, Ctrl elsewhere.

func SidebarFitWidth added in v0.7.0

func SidebarFitWidth(labels []string) int

SidebarFitWidth returns the width a sidebar needs to fit the longest of labels, including button and sidebar padding, at the current font size.

func StyledTextInput

func StyledTextInput(placeholder string, secure bool, minWidth int, opts ...widget.TextInputOpt) *widget.TextInput

StyledTextInput creates a text input with consistent styling. Additional options, such as change and submit handlers, are applied after the styling.

func TableCell

func TableCell(text string, width, height int, textColor color.Color) *widget.Container

TableCell creates a table cell with text content. Use for data cells in list/table views.

func TableHeaderCell

func TableHeaderCell(text string, width, height int) *widget.Container

TableHeaderCell creates a table header cell with secondary text color. Use for column headers in list/table views.

func TextButton

func TextButton(text string, padding int, handler func(*widget.ButtonClickedEventArgs)) *widget.Button

TextButton creates a standard text button with consistent styling. Use for regular actions like "Back", "Cancel", "Settings".

func ToggleButton

func ToggleButton(text string, active bool, handler func(*widget.ButtonClickedEventArgs)) *widget.Button

ToggleButton creates a button that visually indicates an active/inactive state. Use for view mode toggles, filters, and other binary state buttons.

func TooltipContent

func TooltipContent(text string) *widget.Container

TooltipContent creates a tooltip container with consistent styling. Use for showing full text when content is truncated.

Types

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

Carousel shows one image of a row at a time, captioned and as large as its rect allows, with a slice of the images beside it at the same height, dimmed, at the edges of its rect. Each visible slice is a button that moves the row one image its way. The row does not wrap.

The carousel holds no position of its own. The owner keeps the index, creates a new Carousel after each move, and passes the index moved from and when, so a slide in progress continues across rebuilds.

func NewCarousel added in v0.8.0

func NewCarousel(o CarouselOptions) *Carousel

NewCarousel creates a Carousel. The index is clamped to the row.

func (*Carousel) Container added in v0.8.0

func (c *Carousel) Container() *widget.Container

Container returns the widget to add to a page. It fills the cell it is placed in.

func (*Carousel) Next added in v0.8.0

func (c *Carousel) Next() *widget.Button

Next returns the slice button of the image after the current one, nil on the last image

func (*Carousel) Prev added in v0.8.0

func (c *Carousel) Prev() *widget.Button

Prev returns the slice button of the image before the current one, nil on the first image

type CarouselOptions added in v0.8.0

type CarouselOptions struct {
	Images []*ebiten.Image // the row, all non-nil
	Labels []string        // a caption per image
	Index  int             // image shown
	From   int             // image the last move started at; Index when none
	Start  time.Time       // when the last move started
	Now    func() time.Time
	Gap    int // pixels between images
	Peek   int // least pixel width of a visible slice beside the image shown

	// Move is called with -1 or 1 when the slice on that side is
	// pressed
	Move func(dir int)
}

CarouselOptions configures a Carousel

type ConfirmDelete added in v0.7.0

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

ConfirmDelete builds Delete buttons that take two presses. The first press arms the button, which the next build shows as Confirm Delete in the primary style; the second press deletes. Focus leaving the armed button disarms it. At most one delete is armed, named by the key it was built with. The zero value has nothing armed.

func (*ConfirmDelete) Button added in v0.7.0

func (d *ConfirmDelete) Button(key string, padding int, focus pendingFocuser, rebuild, onConfirm func()) *widget.Button

Button creates the Delete button for key, which must not be empty and is unique among the buttons sharing d. key is also the button's focus key. Pressing it unarmed arms key, sets focus to it, and calls rebuild; a mouse click does not focus a button, and focus leaving the button is what disarms it. Pressing it armed disarms and calls onConfirm. Focus leaving it while armed disarms and calls rebuild.

func (*ConfirmDelete) Disarm added in v0.7.0

func (d *ConfirmDelete) Disarm() bool

Disarm cancels an armed delete, reporting whether there was one

func (*ConfirmDelete) Label added in v0.7.0

func (d *ConfirmDelete) Label(key string) string

Label returns the text of key's button: Confirm Delete when armed, otherwise Delete

type FitGraphic added in v0.7.0

type FitGraphic struct {
	Image *ebiten.Image
	// contains filtered or unexported fields
}

FitGraphic draws one texture scaled to fit its rect, centered, keeping the aspect ratio. It reports no preferred size, so the layout cell it is stretched into decides how large the image is drawn. This lets a large texture be shown at whatever size the window allows without rescaling it on the CPU.

Image is set directly by the owner, matching the public-field style of ebitenui's own Graphic.

func NewFitGraphic added in v0.7.0

func NewFitGraphic(img *ebiten.Image, opts ...widget.WidgetOpt) *FitGraphic

NewFitGraphic creates a FitGraphic for img. opts are applied to the underlying widget.

func (*FitGraphic) GetWidget added in v0.7.0

func (g *FitGraphic) GetWidget() *widget.Widget

GetWidget returns the underlying widget.

func (*FitGraphic) PreferredSize added in v0.7.0

func (g *FitGraphic) PreferredSize() (int, int)

PreferredSize reports no size of its own; the layout decides.

func (*FitGraphic) Render added in v0.7.0

func (g *FitGraphic) Render(screen *ebiten.Image)

Render draws the texture scaled to fit the widget rect and centered in it.

func (*FitGraphic) SetLocation added in v0.7.0

func (g *FitGraphic) SetLocation(rect goimage.Rectangle)

SetLocation positions the widget.

func (*FitGraphic) Validate added in v0.7.0

func (g *FitGraphic) Validate()

Validate satisfies the widget interface; nothing to validate.

type IconGraphic

type IconGraphic struct {
	Image   *ebiten.Image
	Focused bool
	// contains filtered or unexported fields
}

IconGraphic draws a single artwork texture centered in its rect for the library icon view. When unfocused it renders the texture scaled down and dimmed; when focused it renders at full size and full brightness. This produces the zoom effect from one texture per game instead of caching a second pre-scaled, pre-dimmed copy.

Image and Focused are set directly by the owner to swap artwork and toggle the zoom state, matching the public-field style of ebitenui's own Graphic.

func NewIconGraphic

func NewIconGraphic(img *ebiten.Image, scale float64, dim float32, opts ...widget.WidgetOpt) *IconGraphic

NewIconGraphic creates an IconGraphic for img. scale and dim control the unfocused appearance. opts are applied to the underlying widget.

func (*IconGraphic) GetWidget

func (g *IconGraphic) GetWidget() *widget.Widget

GetWidget returns the underlying widget.

func (*IconGraphic) PreferredSize

func (g *IconGraphic) PreferredSize() (int, int)

PreferredSize reports the texture size, matching the stock graphic widget.

func (*IconGraphic) Render

func (g *IconGraphic) Render(screen *ebiten.Image)

Render draws the texture centered in the widget rect. Unfocused cards are scaled down and dimmed; focused cards draw at native size and brightness.

func (*IconGraphic) SetLocation

func (g *IconGraphic) SetLocation(rect goimage.Rectangle)

SetLocation positions the widget.

func (*IconGraphic) Validate

func (g *IconGraphic) Validate()

Validate satisfies the widget interface; nothing to validate.

type MultiLineInput added in v0.7.0

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

MultiLineInput is an editable multi-line text field. It shows a fixed number of lines and scrolls in both directions to keep the caret in view, with a scrollbar on each axis while the text overflows it.

The field handles typing, Enter, Backspace, Delete, Home, End, the Ctrl/Cmd+A/C/X/V clipboard shortcuts, and mouse selection itself. Arrow keys and gamepad directions are applied by the owner through MoveCaret, so they share the UI navigation repeat and can move focus out of the field at its edges.

func NewMultiLineInput added in v0.7.0

func NewMultiLineInput(rows, minWidth, maxRunes, maxLines int, changed func(text string), opts ...widget.WidgetOpt) *MultiLineInput

NewMultiLineInput creates a field showing rows lines, at least minWidth wide. maxRunes and maxLines limit the text as in textedit.New. changed, when not nil, is called after each edit with the new text.

func (*MultiLineInput) AddFocus added in v0.7.0

func (m *MultiLineInput) AddFocus(direction widget.FocusDirection, focus widget.Focuser)

AddFocus is part of widget.Focuser

func (*MultiLineInput) Focus added in v0.7.0

func (m *MultiLineInput) Focus(focused bool)

Focus sets whether the field has keyboard focus and tells the UI

func (*MultiLineInput) GetFocus added in v0.7.0

func (m *MultiLineInput) GetFocus(direction widget.FocusDirection) widget.Focuser

GetFocus is part of widget.Focuser

func (*MultiLineInput) GetWidget added in v0.7.0

func (m *MultiLineInput) GetWidget() *widget.Widget

GetWidget returns the underlying widget

func (*MultiLineInput) IsFocused added in v0.7.0

func (m *MultiLineInput) IsFocused() bool

IsFocused reports whether the field has keyboard focus

func (*MultiLineInput) MoveCaretDown added in v0.7.0

func (m *MultiLineInput) MoveCaretDown() bool

MoveCaretDown moves the caret down one line like MoveCaretUp. It reports false on the last line.

func (*MultiLineInput) MoveCaretLeft added in v0.7.0

func (m *MultiLineInput) MoveCaretLeft()

MoveCaretLeft moves the caret left one character, extending the selection while Shift is held

func (*MultiLineInput) MoveCaretRight added in v0.7.0

func (m *MultiLineInput) MoveCaretRight()

MoveCaretRight moves the caret right one character, extending the selection while Shift is held

func (*MultiLineInput) MoveCaretUp added in v0.7.0

func (m *MultiLineInput) MoveCaretUp() bool

MoveCaretUp moves the caret up one line, extending the selection while Shift is held. It reports false on the first line, where focus should leave the field instead.

func (*MultiLineInput) PreferredSize added in v0.7.0

func (m *MultiLineInput) PreferredSize() (int, int)

PreferredSize returns minWidth by the height of the visible rows plus padding

func (*MultiLineInput) Render added in v0.7.0

func (m *MultiLineInput) Render(screen *ebiten.Image)

Render draws the background, the visible text with its selection, the caret, and the scrollbars

func (*MultiLineInput) SetLocation added in v0.7.0

func (m *MultiLineInput) SetLocation(rect img.Rectangle)

SetLocation sets the field's rectangle

func (*MultiLineInput) SetText added in v0.7.0

func (m *MultiLineInput) SetText(s string)

SetText replaces the text without calling the changed handler

func (*MultiLineInput) TabOrder added in v0.7.0

func (m *MultiLineInput) TabOrder() int

TabOrder is part of widget.Focuser

func (*MultiLineInput) Text added in v0.7.0

func (m *MultiLineInput) Text() string

Text returns the field's text, lines joined by "\n"

func (*MultiLineInput) Update added in v0.7.0

func (m *MultiLineInput) Update(updObj *widget.UpdateObject)

Update handles mouse dragging and, while focused, editing keys

func (*MultiLineInput) Validate added in v0.7.0

func (m *MultiLineInput) Validate()

Validate is part of the ebitenui widget contract

type ScrollView

type ScrollView struct {
	// ScrollTop is the vertical scroll position as a fraction in [0, 1].
	ScrollTop float64
	// contains filtered or unexported fields
}

ScrollView is a vertical scroll container that clips its content with an ebiten SubImage instead of an allocated mask buffer. ebitenui's ScrollContainer renders its content through a screen-sized MaskedRenderBuffer; ebiten promotes those buffers onto large texture-atlas pages that stay mostly empty and accumulate across UI rebuilds. A SubImage is only a bounded view of the destination, so clipping allocates nothing.

Only vertical scrolling is supported; the screens that scroll never scroll horizontally. ScrollTop, ViewRect and ContentRect mirror the subset of the ebitenui ScrollContainer API the screens rely on.

func NewScrollView

func NewScrollView(content widget.PreferredSizeLocateableWidget, bg color.Color, stretchContentWidth bool, opts ...widget.WidgetOpt) *ScrollView

NewScrollView creates a ScrollView wrapping content. bg fills the viewport behind the content. When stretchContentWidth is true, content narrower than the viewport is widened to fill it.

func ScrollableContainer

ScrollableContainer creates a scrollable container with a vertical slider. Returns the scroll container, slider, and wrapper widget for embedding in layouts. The scroll container and slider references can be used for scroll position preservation.

func (*ScrollView) Contains added in v0.8.0

func (s *ScrollView) Contains(w *widget.Widget) bool

Contains reports whether w is the view's content or inside it

func (*ScrollView) ContentRect

func (s *ScrollView) ContentRect() img.Rectangle

ContentRect returns the content's full rect at its current scrolled position.

func (*ScrollView) GetWidget

func (s *ScrollView) GetWidget() *widget.Widget

GetWidget returns the underlying widget.

func (*ScrollView) PreferredSize

func (s *ScrollView) PreferredSize() (int, int)

PreferredSize reports the content's preferred size.

func (*ScrollView) Render

func (s *ScrollView) Render(screen *ebiten.Image)

Render draws the background and the content, clipping the content to the viewport with a SubImage.

func (*ScrollView) ScrollRectIntoView

func (s *ScrollView) ScrollRectIntoView(rect img.Rectangle)

ScrollRectIntoView scrolls the minimum amount so rect (in screen coordinates) is visible: aligning its top to the viewport top when above, or its bottom to the viewport bottom when below. Does nothing when the content fits.

func (*ScrollView) ScrollRectToCenter added in v0.8.0

func (s *ScrollView) ScrollRectToCenter(rect img.Rectangle)

ScrollRectToCenter scrolls so rect (in screen coordinates) is vertically centered in the viewport, clamped to the scroll range. Does nothing when the content fits.

func (*ScrollView) ScrollRectToTop

func (s *ScrollView) ScrollRectToTop(rect img.Rectangle)

ScrollRectToTop scrolls so the top of rect (in screen coordinates) aligns with the top of the viewport, clamped to the scroll range. Does nothing when the content fits.

func (*ScrollView) ScrollStep added in v0.8.0

func (s *ScrollView) ScrollStep(dir int) bool

ScrollStep scrolls one step, a quarter of the viewport height, down for a positive dir and up for a negative one, clamped to the scroll range. It reports whether the view moved: false at the end in that direction and when the content fits.

func (*ScrollView) SetLocation

func (s *ScrollView) SetLocation(rect img.Rectangle)

SetLocation positions the viewport.

func (*ScrollView) SetScrollTop

func (s *ScrollView) SetScrollTop(frac float64)

SetScrollTop clamps the fraction, applies it, and syncs the paired slider.

func (*ScrollView) SetSlider

func (s *ScrollView) SetSlider(slider *widget.Slider)

SetSlider pairs a slider with the view so programmatic scroll changes keep it in sync.

func (*ScrollView) SetupInputLayer

func (s *ScrollView) SetupInputLayer(def input.DeferredSetupInputLayerFunc)

SetupInputLayer elevates the content onto an input layer clipped to the viewport, so content scrolled out of view does not receive pointer events. Wheel events are excluded so they fall through to the ScrollView's own widget, which fires ScrolledEvent.

func (*ScrollView) Update

func (s *ScrollView) Update(updObj *widget.UpdateObject)

Update updates the content subtree.

func (*ScrollView) Validate

func (s *ScrollView) Validate()

Validate validates the content subtree.

func (*ScrollView) ViewRect

func (s *ScrollView) ViewRect() img.Rectangle

ViewRect returns the visible viewport in screen coordinates.

type ScrollableOpts

type ScrollableOpts struct {
	Content     *widget.Container // Required: content to scroll
	BgColor     color.Color       // style.Background color for scroll area (default: style.Background)
	BorderColor color.Color       // style.Border color for wrapper (nil = no border)
	Spacing     int               // Spacing between scroll area and slider (default: 4)
	Padding     int               // Padding inside wrapper, used with BorderColor (default: 0)
}

ScrollableOpts configures a scrollable container.

func PageScrollOpts added in v0.7.0

func PageScrollOpts(content *widget.Container) ScrollableOpts

PageScrollOpts returns the options of the scrollable container that holds the content of a sidebar page, such as a settings section or a detail page

func (ScrollableOpts) ContentWidth added in v0.7.0

func (opts ScrollableOpts) ContentWidth(width int) int

ContentWidth returns the width of the scrolled content in a scrollable container that is width wide: less the wrapper padding, the slider, and the spacing between them

type ShrinkFirstLayout added in v0.7.0

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

ShrinkFirstLayout stacks its widgets top to bottom at the container width, each at its preferred height, directly under one another. When the stack is taller than the container, only the first widget shrinks, so the ones below it stay in place and are never pushed out. It lays out a column whose head adapts to the height left by its tail, such as box art over a sidebar.

func NewShrinkFirstLayout added in v0.7.0

func NewShrinkFirstLayout(spacing int) *ShrinkFirstLayout

NewShrinkFirstLayout creates a ShrinkFirstLayout with spacing pixels between widgets.

func (*ShrinkFirstLayout) Layout added in v0.7.0

Layout places the widgets in rect.

func (*ShrinkFirstLayout) PreferredSize added in v0.7.0

func (l *ShrinkFirstLayout) PreferredSize(widgets []widget.PreferredSizeLocateableWidget) (int, int)

PreferredSize reports the widest widget and the height of the stack.

type Sidebar struct {
	Container *widget.Container
}

Sidebar is a vertical list of navigation items on a surface panel. Focus registration is left to the owning screen, which knows its keys.

func NewSidebar added in v0.7.0

func NewSidebar(minWidth int) *Sidebar

NewSidebar creates an empty sidebar. minWidth is the minimum width; the sidebar still grows when a label needs more room.

func (*Sidebar) AddButton added in v0.7.0

func (s *Sidebar) AddButton(label string, active bool, handler func()) *widget.Button

AddButton appends a button stretched to the sidebar width. active selects the highlighted style used for the current selection.

func (*Sidebar) AddDisabledItem added in v0.7.0

func (s *Sidebar) AddDisabledItem(label string)

AddDisabledItem appends a non-focusable item for future or unavailable entries. It uses the button padding so it matches the button height.

func (*Sidebar) AddDivider added in v0.7.0

func (s *Sidebar) AddDivider()

AddDivider appends a 1px separator line between groups of items.

func (*Sidebar) Clear added in v0.7.0

func (s *Sidebar) Clear()

Clear removes all items so the sidebar can be refilled in place.

type TextInputGroup

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

TextInputGroup manages a group of text inputs with clipboard support. Call Update() each frame to handle Ctrl/Cmd+A/C/V/X shortcuts.

func NewTextInputGroup

func NewTextInputGroup() *TextInputGroup

NewTextInputGroup creates a new text input group for clipboard handling.

func (*TextInputGroup) Add

func (g *TextInputGroup) Add(input *widget.TextInput)

Add registers a text input with the group for clipboard handling.

func (*TextInputGroup) Update

func (g *TextInputGroup) Update()

Update handles clipboard shortcuts (Ctrl/Cmd+A/C/V/X) for the focused input. Call this each frame from your screen's Update method.

Directories

Path Synopsis
Package textedit holds the text, caret, and selection of a multi-line text field, with the editing operations on them.
Package textedit holds the text, caret, and selection of a multi-line text field, with the editing operations on them.

Jump to

Keyboard shortcuts

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