basicwidget

package
v0.0.0-...-f376afe Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: Apache-2.0 Imports: 32 Imported by: 2

README

Licenses

InterVariable.ttf

Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL

-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION AND CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

Documentation

Index

Constants

View Source
const (
	FontPriorityLow    = 100
	FontPriorityNormal = 200
	FontPriorityHigh   = 300
)

Variables

View Source
var EnvKeyListItemColorType guigui.EnvKey = guigui.GenerateEnvKey()

EnvKeyListItemColorType is the environment key for obtaining a ListItemColorType from a list item. This is provided by the list's internal content widget, so descendant widgets of list items can query their color type without needing to know their index.

This value is available after the build phase (e.g., during the layout phase).

guigui.Context.Env with this key might return (nil, false) when the item is out of the viewport.

Functions

func CreateMonochromeImage

func CreateMonochromeImage(colorMode ebiten.ColorMode, img image.Image) image.Image

func FontSize

func FontSize(context *guigui.Context) float64

func LineHeight

func LineHeight(context *guigui.Context) int

func ListItemIndentSize

func ListItemIndentSize(context *guigui.Context, level int) int

func ListItemTextPadding

func ListItemTextPadding(context *guigui.Context) guigui.Padding

func MoveItemsInSlice

func MoveItemsInSlice[T any](slice []T, from int, count int, to int) int

func RegisterFonts

func RegisterFonts(appendEntries func([]FaceSourceEntry, *guigui.Context) []FaceSourceEntry, priority FontPriority)

RegisterFonts registers the fonts.

priority is used to determine the order of the fonts. The order of the fonts is determined by the priority. The bigger priority value, the higher priority. If the priority is the same, the order of the fonts is determined by the order of registration.

func RoundedCornerRadius

func RoundedCornerRadius(context *guigui.Context) int

func SetFaceSources

func SetFaceSources(entries []FaceSourceEntry)

SetFaceSources sets the face sources.

func TooltipTextPadding

func TooltipTextPadding(context *guigui.Context) guigui.Padding

TooltipTextPadding returns the padding for tooltip text content.

func UnitSize

func UnitSize(context *guigui.Context) int

Types

type Background

type Background struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Background) Draw

func (b *Background) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

func (*Background) SetSemanticColor

func (b *Background) SetSemanticColor(semanticColor basicwidgetdraw.SemanticColor)

type Button

type Button struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Button) Build

func (b *Button) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Button) CursorShape

func (b *Button) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)

func (*Button) Draw

func (b *Button) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

func (*Button) HandlePointingInput

func (b *Button) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult

func (*Button) Layout

func (b *Button) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Button) Measure

func (b *Button) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Button) OnDown

func (b *Button) OnDown(f func(context *guigui.Context))

func (*Button) OnUp

func (b *Button) OnUp(f func(context *guigui.Context))

func (*Button) SetContent

func (b *Button) SetContent(content guigui.Widget)

func (*Button) SetIcon

func (b *Button) SetIcon(icon *ebiten.Image)

func (*Button) SetIconAlign

func (b *Button) SetIconAlign(align IconAlign)

func (*Button) SetSemanticColor

func (b *Button) SetSemanticColor(semanticColor basicwidgetdraw.SemanticColor)

func (*Button) SetSharpCorners

func (b *Button) SetSharpCorners(sharpCorners Corners)

func (*Button) SetText

func (b *Button) SetText(text string)

func (*Button) SetTextBold

func (b *Button) SetTextBold(bold bool)

func (*Button) SetType

func (b *Button) SetType(typ ButtonType)

func (*Button) Tick

func (b *Button) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error

func (*Button) WriteStateKey

func (b *Button) WriteStateKey(w *guigui.StateKeyWriter)

type ButtonType

type ButtonType int
const (
	ButtonTypeNormal ButtonType = iota
	ButtonTypePrimary
)

type Checkbox

type Checkbox struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Checkbox) Build

func (c *Checkbox) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Checkbox) CursorShape

func (c *Checkbox) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)

func (*Checkbox) Draw

func (c *Checkbox) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

func (*Checkbox) HandlePointingInput

func (c *Checkbox) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult

func (*Checkbox) Layout

func (c *Checkbox) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Checkbox) Measure

func (c *Checkbox) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Checkbox) OnValueChanged

func (c *Checkbox) OnValueChanged(f func(context *guigui.Context, value bool))

func (*Checkbox) SetValue

func (c *Checkbox) SetValue(value bool)

func (*Checkbox) Tick

func (c *Checkbox) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error

func (*Checkbox) Value

func (c *Checkbox) Value() bool

func (*Checkbox) WriteStateKey

func (c *Checkbox) WriteStateKey(w *guigui.StateKeyWriter)

type Combobox

type Combobox struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

Combobox is a composite widget that combines a TextInput with a PopupMenu. The popup menu shows filtered items based on the current input text. When the user focuses the text input, the popup opens below (or above) the text input. The popup is modeless, so the text input retains focus while the popup is shown. The popup closes when the text input loses focus.

func (*Combobox) Build

func (c *Combobox) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Combobox) IsError

func (c *Combobox) IsError() bool

IsError reports whether the combobox is in the error state.

func (*Combobox) Layout

func (c *Combobox) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Combobox) Measure

func (c *Combobox) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Combobox) OnValueChanged

func (c *Combobox) OnValueChanged(f func(context *guigui.Context, value string, committed bool))

OnValueChanged sets the event handler that is called when the combobox value changes. The handler receives the current text and whether the change is committed.

func (*Combobox) SetAllowFreeInput

func (c *Combobox) SetAllowFreeInput(allow bool)

SetAllowFreeInput sets whether the combobox allows values that are not in the items list. When false, the value is reverted to the last valid value on commit if it does not match any item.

func (*Combobox) SetError

func (c *Combobox) SetError(hasError bool)

SetError sets whether the combobox is in the error state. When the error state is true, the combobox border is drawn in a danger color.

func (*Combobox) SetItems

func (c *Combobox) SetItems(items []string)

SetItems sets the list of items for the combobox.

func (*Combobox) SetSupportText

func (c *Combobox) SetSupportText(text string)

SetSupportText sets the support text displayed below the combobox. The support text is shown in a subdued color, or in a danger color when the error state is true.

func (*Combobox) SetValue

func (c *Combobox) SetValue(value string)

SetValue sets the text value.

func (*Combobox) SupportText

func (c *Combobox) SupportText() string

SupportText returns the support text displayed below the combobox.

func (*Combobox) TextInput

func (c *Combobox) TextInput() *TextInput

TextInput returns the internal TextInput widget for customization.

func (*Combobox) Tick

func (c *Combobox) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error

func (*Combobox) Value

func (c *Combobox) Value() string

Value returns the current text value.

type ContextMenuArea

type ContextMenuArea[T comparable] struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

ContextMenuArea is a standalone widget that shows a popup menu when the user right-clicks inside the area specified by its bounds.

ContextMenuArea shows a modeless popup that closes when the user clicks outside. The previously focused widget retains focus while the context menu is open, so that widgets like TextInput can continue to show their cursor and selection.

Keyboard navigation (Up/Down/Enter/Escape) is supported via guigui.Context.SetButtonInputReceptive.

Use ContextMenuArea.PopupMenu to configure the menu items.

func (*ContextMenuArea[T]) Build

func (c *ContextMenuArea[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error

Build implements guigui.Widget.Build.

func (*ContextMenuArea[T]) HandlePointingInput

func (c *ContextMenuArea[T]) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult

HandlePointingInput implements guigui.Widget.HandlePointingInput.

func (*ContextMenuArea[T]) Layout

func (c *ContextMenuArea[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

Layout implements guigui.Widget.Layout.

func (*ContextMenuArea[T]) PopupMenu

func (c *ContextMenuArea[T]) PopupMenu() *PopupMenu[T]

PopupMenu returns the popup menu so that the caller can configure its items and event handlers.

type Corners

type Corners struct {
	TopStart    bool
	TopEnd      bool
	BottomStart bool
	BottomEnd   bool
}

type Divider

type Divider struct {
	guigui.DefaultWidget
}

func (*Divider) Draw

func (d *Divider) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

func (*Divider) Measure

func (d *Divider) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

type Drawer

type Drawer struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Drawer) Build

func (d *Drawer) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Drawer) IsOpen

func (d *Drawer) IsOpen() bool

func (*Drawer) Layout

func (d *Drawer) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Drawer) Measure

func (d *Drawer) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Drawer) OnClose

func (d *Drawer) OnClose(onClose func(context *guigui.Context, reason PopupCloseReason))

func (*Drawer) SetAnimated

func (d *Drawer) SetAnimated(animateOnFading bool)

func (*Drawer) SetBackgroundBlurred

func (d *Drawer) SetBackgroundBlurred(blurred bool)

func (*Drawer) SetBackgroundBounds

func (d *Drawer) SetBackgroundBounds(bounds image.Rectangle)

func (*Drawer) SetBackgroundDark

func (d *Drawer) SetBackgroundDark(dark bool)

func (*Drawer) SetBackgroundSemanticColor

func (d *Drawer) SetBackgroundSemanticColor(semanticColor basicwidgetdraw.SemanticColor)

func (*Drawer) SetCloseByClickingOutside

func (d *Drawer) SetCloseByClickingOutside(closeByClickingOutside bool)

func (*Drawer) SetContent

func (d *Drawer) SetContent(widget guigui.Widget)

func (*Drawer) SetDrawerEdge

func (d *Drawer) SetDrawerEdge(edge DrawerEdge)

func (*Drawer) SetOpen

func (d *Drawer) SetOpen(open bool)

type DrawerEdge

type DrawerEdge int
const (
	DrawerEdgeStart DrawerEdge = iota
	DrawerEdgeTop
	DrawerEdgeEnd
	DrawerEdgeBottom
)

type Expander

type Expander struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Expander) Build

func (e *Expander) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Expander) Draw

func (e *Expander) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

func (*Expander) Layout

func (e *Expander) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Expander) Measure

func (e *Expander) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Expander) OnExpansionChanged

func (e *Expander) OnExpansionChanged(callback func(context *guigui.Context, expanded bool))

func (*Expander) SetContentWidget

func (e *Expander) SetContentWidget(w guigui.Widget)

func (*Expander) SetExpanded

func (e *Expander) SetExpanded(expanded bool)

func (*Expander) SetHeaderWidget

func (e *Expander) SetHeaderWidget(w guigui.Widget)

func (*Expander) Tick

func (e *Expander) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error

func (*Expander) WriteStateKey

func (e *Expander) WriteStateKey(w *guigui.StateKeyWriter)

type FaceSourceEntry

type FaceSourceEntry struct {
	FaceSource    *text.GoTextFaceSource
	UnicodeRanges []UnicodeRange
}

func DefaultFaceSourceEntry

func DefaultFaceSourceEntry() FaceSourceEntry

type FontPriority

type FontPriority int

FontPriority is used to determine the order of the fonts for RegisterFonts.

type Form

type Form struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Form) Build

func (f *Form) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Form) Draw

func (f *Form) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

func (*Form) Layout

func (f *Form) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Form) Measure

func (f *Form) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Form) SetItems

func (f *Form) SetItems(items []FormItem)

type FormItem

type FormItem struct {
	PrimaryWidget   guigui.Widget
	SecondaryWidget guigui.Widget
}

type IconAlign

type IconAlign int
const (
	IconAlignStart IconAlign = iota
	IconAlignEnd
)

type Image

type Image struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Image) Draw

func (i *Image) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

func (*Image) HasImage

func (i *Image) HasImage() bool

func (*Image) Measure

func (i *Image) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Image) SetImage

func (i *Image) SetImage(image *ebiten.Image)

func (*Image) WriteStateKey

func (i *Image) WriteStateKey(w *guigui.StateKeyWriter)

type List

type List[T comparable] struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*List[T]) AppendSelectedItemIndices

func (l *List[T]) AppendSelectedItemIndices(indices []int) []int

func (*List[T]) Build

func (l *List[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*List[T]) EnsureItemVisibleByIndex

func (l *List[T]) EnsureItemVisibleByIndex(index int)

func (*List[T]) ID

func (l *List[T]) ID(index int) any

func (*List[T]) IndexByValue

func (l *List[T]) IndexByValue(value T) int

func (*List[T]) IsItemAvailable

func (l *List[T]) IsItemAvailable(index int) bool

IsItemAvailable reports whether the item at the given index is available in the list (i.e., not hidden by a collapsed ancestor).

func (*List[T]) IsItemInViewport

func (l *List[T]) IsItemInViewport(index int) bool

IsItemInViewport reports whether the item at the given index is currently visible in the viewport.

IsItemInViewport is available after the layout phase.

func (*List[T]) ItemBounds

func (l *List[T]) ItemBounds(index int) image.Rectangle

func (*List[T]) ItemByIndex

func (l *List[T]) ItemByIndex(index int) (ListItem[T], bool)

func (*List[T]) ItemCount

func (l *List[T]) ItemCount() int

func (*List[T]) JumpToItemByIndex

func (l *List[T]) JumpToItemByIndex(index int)

func (*List[T]) Layout

func (l *List[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*List[T]) Measure

func (l *List[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*List[T]) OnItemExpanderToggled

func (l *List[T]) OnItemExpanderToggled(f func(context *guigui.Context, index int, expanded bool))

func (*List[T]) OnItemSelected

func (l *List[T]) OnItemSelected(f func(context *guigui.Context, index int))

func (*List[T]) OnItemsCanMove

func (l *List[T]) OnItemsCanMove(f func(context *guigui.Context, from, count, to int) bool)

func (*List[T]) OnItemsMoved

func (l *List[T]) OnItemsMoved(f func(context *guigui.Context, from, count, to int))

func (*List[T]) OnItemsSelected

func (l *List[T]) OnItemsSelected(f func(context *guigui.Context, indices []int))

func (*List[T]) SelectAllItems

func (l *List[T]) SelectAllItems()

func (*List[T]) SelectItemByIndex

func (l *List[T]) SelectItemByIndex(index int)

func (*List[T]) SelectItemByValue

func (l *List[T]) SelectItemByValue(value T)

func (*List[T]) SelectItemsByIndices

func (l *List[T]) SelectItemsByIndices(indices []int)

func (*List[T]) SelectItemsByValues

func (l *List[T]) SelectItemsByValues(values []T)

func (*List[T]) SelectedItem

func (l *List[T]) SelectedItem() (ListItem[T], bool)

func (*List[T]) SelectedItemCount

func (l *List[T]) SelectedItemCount() int

func (*List[T]) SelectedItemIndex

func (l *List[T]) SelectedItemIndex() int

func (*List[T]) SetBackground

func (l *List[T]) SetBackground(widget guigui.Widget)

func (*List[T]) SetFooterHeight

func (l *List[T]) SetFooterHeight(height int)

func (*List[T]) SetHeaderHeight

func (l *List[T]) SetHeaderHeight(height int)

func (*List[T]) SetItemHeight

func (l *List[T]) SetItemHeight(height int)

func (*List[T]) SetItemString

func (l *List[T]) SetItemString(str string, index int)

func (*List[T]) SetItems

func (l *List[T]) SetItems(items []ListItem[T])

func (*List[T]) SetItemsByStrings

func (l *List[T]) SetItemsByStrings(strs []string)

func (*List[T]) SetMultiSelection

func (l *List[T]) SetMultiSelection(multi bool)

func (*List[T]) SetReservesCheckmarkSpace

func (l *List[T]) SetReservesCheckmarkSpace(reserves bool)

SetReservesCheckmarkSpace sets whether the list reserves space for the checkmark column even when no item is currently checked. This keeps item widths and positions stable across check-state changes.

Items can independently toggle [ListItem.Checked] to render a checkmark. The column is automatically reserved when at least one item is checked, so this setter is only needed when no items are currently checked but might be in the future.

func (*List[T]) SetStripeVisible

func (l *List[T]) SetStripeVisible(visible bool)

func (*List[T]) SetStyle

func (l *List[T]) SetStyle(style ListStyle)

func (*List[T]) SetUnfocusedSelectionVisible

func (l *List[T]) SetUnfocusedSelectionVisible(visible bool)

SetUnfocusedSelectionVisible sets whether to show the selection background when the list is unfocused. The default is true.

func (*List[T]) Tick

func (l *List[T]) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error

func (*List[T]) WriteStateKey

func (l *List[T]) WriteStateKey(w *guigui.StateKeyWriter)

type ListItem

type ListItem[T comparable] struct {
	Text         string
	TextColor    color.Color
	Header       bool
	Content      guigui.Widget
	KeyText      string
	Unselectable bool
	Border       bool
	Disabled     bool
	Movable      bool
	Value        T
	IndentLevel  int
	Padding      guigui.Padding
	Collapsed    bool
	Checked      bool
}

type ListItemColorType

type ListItemColorType int

ListItemColorType represents the color state of a list item.

const (
	ListItemColorTypeDefault ListItemColorType = iota
	ListItemColorTypeHighlighted
	ListItemColorTypeSelectedInUnfocusedList
	ListItemColorTypeItemDisabled
	ListItemColorTypeListDisabled
)

func (ListItemColorType) BackgroundColor

func (t ListItemColorType) BackgroundColor(context *guigui.Context) color.Color

BackgroundColor returns the background color for the given color type. BackgroundColor returns nil when no special background should be applied.

func (ListItemColorType) TextColor

func (t ListItemColorType) TextColor(context *guigui.Context) color.Color

TextColor returns the text color for the given color type.

type ListStyle

type ListStyle int
const (
	ListStyleNormal ListStyle = iota
	ListStyleSidebar
	ListStyleMenu
)
type Menubar[T comparable] struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

Menubar is a horizontal row of title texts. Clicking a title shows the associated popup menu. While any popup is open, moving the cursor onto a different title automatically switches to that title's popup. Clicking the already-open title closes its popup.

func (m *Menubar[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error

Build implements guigui.Widget.Build.

func (m *Menubar[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

Layout implements guigui.Widget.Layout.

func (m *Menubar[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

Measure implements guigui.Widget.Measure.

func (m *Menubar[T]) OnItemSelected(f func(context *guigui.Context, menuIndex, itemIndex int))

OnItemSelected sets the event handler that is invoked when a popup menu item is selected. menuIndex identifies the title and itemIndex identifies the selected item within that title's popup.

func (m *Menubar[T]) PopupMenuAt(index int) *PopupMenu[T]

PopupMenuAt returns the popup menu associated with the i-th item. Menubar.SetItems must be called first so that the popup at i exists.

Items shown in the popup are configured via PopupMenu.SetItems. A title whose popup has no items is automatically disabled.

func (m *Menubar[T]) SetItems(items []MenubarItem)

SetItems sets the menubar's items. After this call, the popup menu for each item can be configured via Menubar.PopupMenuAt.

func (m *Menubar[T]) WriteStateKey(w *guigui.StateKeyWriter)

WriteStateKey implements guigui.Widget.WriteStateKey.

type MenubarItem struct {
	Text     string
	Disabled bool
}

MenubarItem is a single entry in a Menubar. Each entry has a title text; the popup menu shown when the title is clicked is configured separately via Menubar.PopupMenuAt.

type NumberInput

type NumberInput struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*NumberInput) Build

func (n *NumberInput) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*NumberInput) CanCopy

func (n *NumberInput) CanCopy() bool

func (*NumberInput) CanCut

func (n *NumberInput) CanCut() bool

func (*NumberInput) CanPaste

func (n *NumberInput) CanPaste() bool

func (*NumberInput) CommitWithCurrentInputValue

func (n *NumberInput) CommitWithCurrentInputValue()

func (*NumberInput) Copy

func (n *NumberInput) Copy() bool

func (*NumberInput) Cut

func (n *NumberInput) Cut() bool

func (*NumberInput) ForceSetValue

func (n *NumberInput) ForceSetValue(value int)

func (*NumberInput) ForceSetValueBigInt

func (n *NumberInput) ForceSetValueBigInt(value *big.Int)

func (*NumberInput) ForceSetValueInt64

func (n *NumberInput) ForceSetValueInt64(value int64)

func (*NumberInput) ForceSetValueUint64

func (n *NumberInput) ForceSetValueUint64(value uint64)

func (*NumberInput) IsEditable

func (n *NumberInput) IsEditable() bool

func (*NumberInput) IsError

func (n *NumberInput) IsError() bool

IsError reports whether the number input is in the error state.

func (*NumberInput) Layout

func (n *NumberInput) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*NumberInput) MaximumValueBigInt

func (n *NumberInput) MaximumValueBigInt() *big.Int

func (*NumberInput) Measure

func (n *NumberInput) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*NumberInput) MinimumValueBigInt

func (n *NumberInput) MinimumValueBigInt() *big.Int

func (*NumberInput) OnHandleButtonInput

func (n *NumberInput) OnHandleButtonInput(f func(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult)

func (*NumberInput) OnValueChanged

func (n *NumberInput) OnValueChanged(f func(context *guigui.Context, value int, committed bool))

func (*NumberInput) OnValueChangedBigInt

func (n *NumberInput) OnValueChangedBigInt(f func(context *guigui.Context, value *big.Int, committed bool))

func (*NumberInput) OnValueChangedInt64

func (n *NumberInput) OnValueChangedInt64(f func(context *guigui.Context, value int64, committed bool))

func (*NumberInput) OnValueChangedUint64

func (n *NumberInput) OnValueChangedUint64(f func(context *guigui.Context, value uint64, committed bool))

func (*NumberInput) Paste

func (n *NumberInput) Paste() bool

func (*NumberInput) SetEditable

func (n *NumberInput) SetEditable(editable bool)

func (*NumberInput) SetError

func (n *NumberInput) SetError(hasError bool)

SetError sets whether the number input is in the error state. When the error state is true, the number input border is drawn in a danger color.

func (*NumberInput) SetMaximumValue

func (n *NumberInput) SetMaximumValue(maximum int)

func (*NumberInput) SetMaximumValueBigInt

func (n *NumberInput) SetMaximumValueBigInt(maximum *big.Int)

func (*NumberInput) SetMaximumValueInt64

func (n *NumberInput) SetMaximumValueInt64(maximum int64)

func (*NumberInput) SetMaximumValueUint64

func (n *NumberInput) SetMaximumValueUint64(maximum uint64)

func (*NumberInput) SetMinimumValue

func (n *NumberInput) SetMinimumValue(minimum int)

func (*NumberInput) SetMinimumValueBigInt

func (n *NumberInput) SetMinimumValueBigInt(minimum *big.Int)

func (*NumberInput) SetMinimumValueInt64

func (n *NumberInput) SetMinimumValueInt64(minimum int64)

func (*NumberInput) SetMinimumValueUint64

func (n *NumberInput) SetMinimumValueUint64(minimum uint64)

func (*NumberInput) SetStep

func (n *NumberInput) SetStep(step int)

func (*NumberInput) SetStepBigInt

func (n *NumberInput) SetStepBigInt(step *big.Int)

func (*NumberInput) SetStepInt64

func (n *NumberInput) SetStepInt64(step int64)

func (*NumberInput) SetStepUint64

func (n *NumberInput) SetStepUint64(step uint64)

func (*NumberInput) SetSupportText

func (n *NumberInput) SetSupportText(text string)

SetSupportText sets the support text displayed below the number input. The support text is shown in a subdued color, or in a danger color when the error state is true.

func (*NumberInput) SetValue

func (n *NumberInput) SetValue(value int)

func (*NumberInput) SetValueBigInt

func (n *NumberInput) SetValueBigInt(value *big.Int)

func (*NumberInput) SetValueInt64

func (n *NumberInput) SetValueInt64(value int64)

func (*NumberInput) SetValueUint64

func (n *NumberInput) SetValueUint64(value uint64)

func (*NumberInput) SupportText

func (n *NumberInput) SupportText() string

SupportText returns the support text displayed below the number input.

func (*NumberInput) Value

func (n *NumberInput) Value() int

func (*NumberInput) ValueBigInt

func (n *NumberInput) ValueBigInt() *big.Int

func (*NumberInput) ValueInt64

func (n *NumberInput) ValueInt64() int64

func (*NumberInput) ValueUint64

func (n *NumberInput) ValueUint64() uint64

type Panel

type Panel struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Panel) Build

func (p *Panel) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Panel) EnsureRectangleVisible

func (p *Panel) EnsureRectangleVisible(rect image.Rectangle)

EnsureRectangleVisible ensures the given rectangle, in content-local coordinates, is visible in the viewport by scrolling if necessary. If the rectangle is larger than the viewport, its top-left corner is aligned with the top-left of the viewport.

func (*Panel) ForceSetScrollOffset

func (p *Panel) ForceSetScrollOffset(offsetX, offsetY float64)

func (*Panel) ForceSetScrollOffsetByDelta

func (p *Panel) ForceSetScrollOffsetByDelta(offsetXDelta, offsetYDelta float64)

func (*Panel) Layout

func (p *Panel) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Panel) Measure

func (p *Panel) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Panel) OnScroll

func (p *Panel) OnScroll(callback func(context *guigui.Context, offsetX, offsetY float64))

func (*Panel) SetAutoBorder

func (p *Panel) SetAutoBorder(auto bool)

func (*Panel) SetBorders

func (p *Panel) SetBorders(borders PanelBorders)

func (*Panel) SetContent

func (p *Panel) SetContent(widget guigui.Widget)

func (*Panel) SetContentConstraints

func (p *Panel) SetContentConstraints(c PanelContentConstraints)

func (*Panel) SetScrollOffset

func (p *Panel) SetScrollOffset(offsetX, offsetY float64)

func (*Panel) SetScrollOffsetByDelta

func (p *Panel) SetScrollOffsetByDelta(offsetXDelta, offsetYDelta float64)

func (*Panel) SetStyle

func (p *Panel) SetStyle(typ PanelStyle)

type PanelBorders

type PanelBorders struct {
	Start  bool
	Top    bool
	End    bool
	Bottom bool
}

type PanelContentConstraints

type PanelContentConstraints int
const (
	PanelContentConstraintsNone PanelContentConstraints = iota
	PanelContentConstraintsFixedWidth
	PanelContentConstraintsFixedHeight
)

type PanelStyle

type PanelStyle int
const (
	PanelStyleDefault PanelStyle = iota
	PanelStyleSide
)
type Popup struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

Popup is a widget that displays its content on a separate layer.

Popup manages its own passthrough state based on whether it is open. Do not call guigui.Context.SetPassthrough on a Popup.

func (*Popup) BringToFrontLayer

func (p *Popup) BringToFrontLayer(context *guigui.Context)

BringToFrontLayer brings the popup to the front layer.

func (*Popup) Build

func (p *Popup) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Popup) Env

func (p *Popup) Env(context *guigui.Context, key guigui.EnvKey, source *guigui.EnvSource) (any, bool)

func (*Popup) IsOpen

func (p *Popup) IsOpen() bool

func (*Popup) Layout

func (p *Popup) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Popup) Measure

func (p *Popup) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Popup) OnClose

func (p *Popup) OnClose(f func(context *guigui.Context, reason PopupCloseReason))

func (*Popup) SetAnimated

func (p *Popup) SetAnimated(animateOnFading bool)

func (*Popup) SetBackgroundBlurred

func (p *Popup) SetBackgroundBlurred(blurred bool)

func (*Popup) SetBackgroundBounds

func (p *Popup) SetBackgroundBounds(bounds image.Rectangle)

func (*Popup) SetBackgroundDark

func (p *Popup) SetBackgroundDark(dark bool)

func (*Popup) SetBackgroundSemanticColor

func (p *Popup) SetBackgroundSemanticColor(semanticColor basicwidgetdraw.SemanticColor)

func (*Popup) SetCloseByClickingOutside

func (p *Popup) SetCloseByClickingOutside(closeByClickingOutside bool)

func (*Popup) SetContent

func (p *Popup) SetContent(widget guigui.Widget)

func (*Popup) SetModal

func (p *Popup) SetModal(modal bool)

func (*Popup) SetOpen

func (p *Popup) SetOpen(open bool)

type PopupCloseReason

type PopupCloseReason int
const (
	PopupCloseReasonNone PopupCloseReason = iota
	PopupCloseReasonFuncCall
	PopupCloseReasonClickOutside
	PopupCloseReasonReopen
)

type PopupMenu

type PopupMenu[T comparable] struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*PopupMenu[T]) Build

func (p *PopupMenu[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*PopupMenu[T]) HandleButtonInput

func (p *PopupMenu[T]) HandleButtonInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult

HandleButtonInput implements guigui.Widget.HandleButtonInput.

func (*PopupMenu[T]) IsOpen

func (p *PopupMenu[T]) IsOpen() bool

func (*PopupMenu[T]) ItemByIndex

func (p *PopupMenu[T]) ItemByIndex(index int) (PopupMenuItem[T], bool)

func (*PopupMenu[T]) Layout

func (p *PopupMenu[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*PopupMenu[T]) Measure

func (p *PopupMenu[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*PopupMenu[T]) OnClose

func (p *PopupMenu[T]) OnClose(f func(context *guigui.Context, reason PopupCloseReason))

func (*PopupMenu[T]) OnItemSelected

func (p *PopupMenu[T]) OnItemSelected(f func(context *guigui.Context, index int))

func (*PopupMenu[T]) SelectItemByIndex

func (p *PopupMenu[T]) SelectItemByIndex(index int)

func (*PopupMenu[T]) SelectItemByValue

func (p *PopupMenu[T]) SelectItemByValue(value T)

func (*PopupMenu[T]) SelectedItem

func (p *PopupMenu[T]) SelectedItem() (PopupMenuItem[T], bool)

func (*PopupMenu[T]) SelectedItemIndex

func (p *PopupMenu[T]) SelectedItemIndex() int

func (*PopupMenu[T]) SetItems

func (p *PopupMenu[T]) SetItems(items []PopupMenuItem[T])

func (*PopupMenu[T]) SetItemsByStrings

func (p *PopupMenu[T]) SetItemsByStrings(items []string)

func (*PopupMenu[T]) SetOpen

func (p *PopupMenu[T]) SetOpen(open bool)

func (*PopupMenu[T]) SetReservesCheckmarkSpace

func (p *PopupMenu[T]) SetReservesCheckmarkSpace(reserves bool)

SetReservesCheckmarkSpace sets whether the popup menu reserves space for the checkmark column even when no item is currently checked. This keeps item widths and positions stable across check-state changes.

Items can independently toggle [PopupMenuItem.Checked] to render a checkmark. The column is automatically reserved when at least one item is checked, so this setter is only needed when no items are currently checked but might be in the future.

type PopupMenuItem

type PopupMenuItem[T comparable] struct {
	Text         string
	TextColor    color.Color
	Header       bool
	Content      guigui.Widget
	KeyText      string
	Unselectable bool
	Border       bool
	Disabled     bool
	Checked      bool
	Value        T
}

type RadioButton

type RadioButton[T comparable] struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

RadioButton is a radio button to choose one value from a group of values.

RadioButton should not be created directly. Use RadioButtonGroup instead.

func (*RadioButton[T]) Build

func (r *RadioButton[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*RadioButton[T]) CursorShape

func (r *RadioButton[T]) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)

func (*RadioButton[T]) Draw

func (r *RadioButton[T]) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

func (*RadioButton[T]) HandlePointingInput

func (r *RadioButton[T]) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult

func (*RadioButton[T]) Layout

func (r *RadioButton[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*RadioButton[T]) Measure

func (r *RadioButton[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*RadioButton[T]) Tick

func (r *RadioButton[T]) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error

func (*RadioButton[T]) WriteStateKey

func (r *RadioButton[T]) WriteStateKey(w *guigui.StateKeyWriter)

type RadioButtonGroup

type RadioButtonGroup[T comparable] struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

RadioButtonGroup is a group of radio buttons.

RadioButtonGroup holds RadioButton widgets, but doesn't add them to the widget tree. The user must add the RadioButton widgets to the widget tree manually.

func (*RadioButtonGroup[T]) OnItemSelected

func (r *RadioButtonGroup[T]) OnItemSelected(f func(context *guigui.Context, index int))

func (*RadioButtonGroup[T]) RadioButton

func (r *RadioButtonGroup[T]) RadioButton(index int) *RadioButton[T]

RadioButton returns the radio button at the specified index.

func (*RadioButtonGroup[T]) SelectItemByIndex

func (r *RadioButtonGroup[T]) SelectItemByIndex(index int)

func (*RadioButtonGroup[T]) SelectItemByValue

func (r *RadioButtonGroup[T]) SelectItemByValue(value T)

func (*RadioButtonGroup[T]) SelectedIndex

func (r *RadioButtonGroup[T]) SelectedIndex() int

func (*RadioButtonGroup[T]) SelectedValue

func (r *RadioButtonGroup[T]) SelectedValue() (T, bool)

func (*RadioButtonGroup[T]) SetValues

func (r *RadioButtonGroup[T]) SetValues(values []T)

SetValues sets the values of the radio buttons. The length of the values slice determines the number of radio buttons.

func (*RadioButtonGroup[T]) WriteStateKey

func (r *RadioButtonGroup[T]) WriteStateKey(w *guigui.StateKeyWriter)

type SegmentedControl

type SegmentedControl[T comparable] struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*SegmentedControl[T]) AppendSelectedItemIndices

func (s *SegmentedControl[T]) AppendSelectedItemIndices(indices []int) []int

func (*SegmentedControl[T]) Build

func (s *SegmentedControl[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*SegmentedControl[T]) ItemByIndex

func (s *SegmentedControl[T]) ItemByIndex(index int) (SegmentedControlItem[T], bool)

func (*SegmentedControl[T]) Layout

func (s *SegmentedControl[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*SegmentedControl[T]) Measure

func (s *SegmentedControl[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*SegmentedControl[T]) OnItemSelected

func (s *SegmentedControl[T]) OnItemSelected(f func(context *guigui.Context, index int))

func (*SegmentedControl[T]) OnItemsSelected

func (s *SegmentedControl[T]) OnItemsSelected(f func(context *guigui.Context, indices []int))

func (*SegmentedControl[T]) SelectItemByIndex

func (s *SegmentedControl[T]) SelectItemByIndex(index int)

func (*SegmentedControl[T]) SelectItemByValue

func (s *SegmentedControl[T]) SelectItemByValue(value T)

func (*SegmentedControl[T]) SelectItemsByIndices

func (s *SegmentedControl[T]) SelectItemsByIndices(indices []int)

func (*SegmentedControl[T]) SelectItemsByValues

func (s *SegmentedControl[T]) SelectItemsByValues(values []T)

func (*SegmentedControl[T]) SelectedItem

func (s *SegmentedControl[T]) SelectedItem() (SegmentedControlItem[T], bool)

func (*SegmentedControl[T]) SelectedItemCount

func (s *SegmentedControl[T]) SelectedItemCount() int

func (*SegmentedControl[T]) SelectedItemIndex

func (s *SegmentedControl[T]) SelectedItemIndex() int

func (*SegmentedControl[T]) SetDirection

func (s *SegmentedControl[T]) SetDirection(direction SegmentedControlDirection)

func (*SegmentedControl[T]) SetItems

func (s *SegmentedControl[T]) SetItems(items []SegmentedControlItem[T])

func (*SegmentedControl[T]) SetMultiSelection

func (s *SegmentedControl[T]) SetMultiSelection(multi bool)

func (*SegmentedControl[T]) WriteStateKey

func (s *SegmentedControl[T]) WriteStateKey(w *guigui.StateKeyWriter)

type SegmentedControlDirection

type SegmentedControlDirection int
const (
	SegmentedControlDirectionHorizontal SegmentedControlDirection = iota
	SegmentedControlDirectionVertical
)

type SegmentedControlItem

type SegmentedControlItem[T comparable] struct {
	Text      string
	Icon      *ebiten.Image
	IconAlign IconAlign
	Disabled  bool
	Value     T
}

type Select

type Select[T comparable] struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Select[T]) Build

func (s *Select[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Select[T]) IsPopupOpen

func (s *Select[T]) IsPopupOpen() bool

func (*Select[T]) ItemByIndex

func (s *Select[T]) ItemByIndex(index int) (SelectItem[T], bool)

func (*Select[T]) Layout

func (s *Select[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Select[T]) Measure

func (s *Select[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Select[T]) OnItemSelected

func (s *Select[T]) OnItemSelected(f func(context *guigui.Context, index int))

func (*Select[T]) SelectItemByIndex

func (s *Select[T]) SelectItemByIndex(index int)

func (*Select[T]) SelectItemByValue

func (s *Select[T]) SelectItemByValue(value T)

func (*Select[T]) SelectedItem

func (s *Select[T]) SelectedItem() (SelectItem[T], bool)

func (*Select[T]) SelectedItemIndex

func (s *Select[T]) SelectedItemIndex() int

func (*Select[T]) SetItems

func (s *Select[T]) SetItems(items []SelectItem[T])

func (*Select[T]) SetItemsByStrings

func (s *Select[T]) SetItemsByStrings(items []string)

type SelectItem

type SelectItem[T comparable] struct {
	Text         string
	TextColor    color.Color
	Header       bool
	Content      guigui.Widget
	Unselectable bool
	Border       bool
	Disabled     bool
	Value        T
}

type Slider

type Slider struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Slider) Build

func (s *Slider) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Slider) CursorShape

func (s *Slider) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)

func (*Slider) Draw

func (s *Slider) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

func (*Slider) HandlePointingInput

func (s *Slider) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult

func (*Slider) MaximumValueBigInt

func (s *Slider) MaximumValueBigInt() *big.Int

func (*Slider) Measure

func (s *Slider) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Slider) MinimumValueBigInt

func (s *Slider) MinimumValueBigInt() *big.Int

func (*Slider) OnValueChanged

func (s *Slider) OnValueChanged(f func(context *guigui.Context, value int))

func (*Slider) OnValueChangedBigInt

func (s *Slider) OnValueChangedBigInt(f func(context *guigui.Context, value *big.Int))

func (*Slider) OnValueChangedInt64

func (s *Slider) OnValueChangedInt64(f func(context *guigui.Context, value int64))

func (*Slider) OnValueChangedUint64

func (s *Slider) OnValueChangedUint64(f func(context *guigui.Context, value uint64))

func (*Slider) SetMaximumValue

func (s *Slider) SetMaximumValue(maximum int)

func (*Slider) SetMaximumValueBigInt

func (s *Slider) SetMaximumValueBigInt(maximum *big.Int)

func (*Slider) SetMaximumValueInt64

func (s *Slider) SetMaximumValueInt64(maximum int64)

func (*Slider) SetMaximumValueUint64

func (s *Slider) SetMaximumValueUint64(maximum uint64)

func (*Slider) SetMinimumValue

func (s *Slider) SetMinimumValue(minimum int)

func (*Slider) SetMinimumValueBigInt

func (s *Slider) SetMinimumValueBigInt(minimum *big.Int)

func (*Slider) SetMinimumValueInt64

func (s *Slider) SetMinimumValueInt64(minimum int64)

func (*Slider) SetMinimumValueUint64

func (s *Slider) SetMinimumValueUint64(minimum uint64)

func (*Slider) SetSnapOnly

func (s *Slider) SetSnapOnly(snapOnly bool)

func (*Slider) SetStep

func (s *Slider) SetStep(step int)

func (*Slider) SetStepBigInt

func (s *Slider) SetStepBigInt(step *big.Int)

func (*Slider) SetStepInt64

func (s *Slider) SetStepInt64(step int64)

func (*Slider) SetStepUint64

func (s *Slider) SetStepUint64(step uint64)

func (*Slider) SetValue

func (s *Slider) SetValue(value int)

func (*Slider) SetValueBigInt

func (s *Slider) SetValueBigInt(value *big.Int)

func (*Slider) SetValueInt64

func (s *Slider) SetValueInt64(value int64)

func (*Slider) SetValueUint64

func (s *Slider) SetValueUint64(value uint64)

func (*Slider) Tick

func (s *Slider) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error

func (*Slider) Value

func (s *Slider) Value() int

func (*Slider) ValueBigInt

func (s *Slider) ValueBigInt() *big.Int

func (*Slider) ValueInt64

func (s *Slider) ValueInt64() int64

func (*Slider) ValueUint64

func (s *Slider) ValueUint64() uint64

func (*Slider) WriteStateKey

func (s *Slider) WriteStateKey(w *guigui.StateKeyWriter)

type Table

type Table[T comparable] struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Table[T]) Build

func (t *Table[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Table[T]) CellBounds

func (t *Table[T]) CellBounds(rowIndex, colIndex int) image.Rectangle

CellBounds returns the bounds for the cell at the given row and column indices. CellBounds is valid only after the table's layout finishes.

func (*Table[T]) EnsureItemVisibleByIndex

func (t *Table[T]) EnsureItemVisibleByIndex(index int)

func (*Table[T]) ID

func (t *Table[T]) ID(index int) any

func (*Table[T]) IsItemAvailable

func (t *Table[T]) IsItemAvailable(index int) bool

IsItemAvailable reports whether the item at the given index is available in the list (i.e., not hidden by a collapsed ancestor).

func (*Table[T]) ItemBounds

func (t *Table[T]) ItemBounds(index int) image.Rectangle

func (*Table[T]) ItemByIndex

func (t *Table[T]) ItemByIndex(index int) (TableRow[T], bool)

func (*Table[T]) ItemCount

func (t *Table[T]) ItemCount() int

func (*Table[T]) JumpToItemByIndex

func (t *Table[T]) JumpToItemByIndex(index int)

func (*Table[T]) Layout

func (t *Table[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Table[T]) Measure

func (t *Table[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Table[T]) OnItemSelected

func (t *Table[T]) OnItemSelected(f func(context *guigui.Context, index int))

func (*Table[T]) OnItemsMoved

func (t *Table[T]) OnItemsMoved(f func(context *guigui.Context, from, count, to int))

func (*Table[T]) SelectItemByIndex

func (t *Table[T]) SelectItemByIndex(index int)

func (*Table[T]) SelectItemByValue

func (t *Table[T]) SelectItemByValue(value T)

func (*Table[T]) SelectedItem

func (t *Table[T]) SelectedItem() (TableRow[T], bool)

func (*Table[T]) SelectedItemIndex

func (t *Table[T]) SelectedItemIndex() int

func (*Table[T]) SetColumns

func (t *Table[T]) SetColumns(columns []TableColumn)

func (*Table[T]) SetFooterHeight

func (t *Table[T]) SetFooterHeight(height int)

func (*Table[T]) SetItems

func (t *Table[T]) SetItems(items []TableRow[T])

func (*Table[T]) SetReservesCheckmarkSpace

func (t *Table[T]) SetReservesCheckmarkSpace(reserves bool)

SetReservesCheckmarkSpace sets whether the table reserves space for the checkmark column even when no row is currently checked. See List.SetReservesCheckmarkSpace for details.

type TableCell

type TableCell struct {
	Text                string
	TextColor           color.Color
	TextHorizontalAlign HorizontalAlign
	TextVerticalAlign   VerticalAlign
	TextBold            bool
	TextTabular         bool
	Content             guigui.Widget
}

type TableColumn

type TableColumn struct {
	HeaderText                string
	HeaderTextHorizontalAlign HorizontalAlign
	Width                     guigui.Size
	MinWidth                  int
}

type TableRow

type TableRow[T comparable] struct {
	Cells        []TableCell
	Unselectable bool
	Movable      bool
	Checked      bool
	Value        T
}

type Text

type Text struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Text) Build

func (t *Text) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Text) CanCopy

func (t *Text) CanCopy() bool

func (*Text) CanCut

func (t *Text) CanCut() bool

func (*Text) CanPaste

func (t *Text) CanPaste() bool

func (*Text) CanRedo

func (t *Text) CanRedo() bool

func (*Text) CanUndo

func (t *Text) CanUndo() bool

func (*Text) CommitWithCurrentInputValue

func (t *Text) CommitWithCurrentInputValue()

func (*Text) Copy

func (t *Text) Copy() bool

func (*Text) CursorShape

func (t *Text) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)

func (*Text) Cut

func (t *Text) Cut() bool

func (*Text) Draw

func (t *Text) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

func (*Text) ForceSetValue

func (t *Text) ForceSetValue(text string)

func (*Text) HandleButtonInput

func (t *Text) HandleButtonInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult

func (*Text) HandlePointingInput

func (t *Text) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult

func (*Text) HasValue

func (t *Text) HasValue() bool

HasValue reports whether the text has a non-empty value. This is more efficient than checking Value() != "" as it avoids allocating a string.

func (*Text) HorizontalAlign

func (t *Text) HorizontalAlign() HorizontalAlign

func (*Text) IsEditable

func (t *Text) IsEditable() bool

func (*Text) IsMultiline

func (t *Text) IsMultiline() bool

func (*Text) Layout

func (t *Text) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Text) LineCount

func (t *Text) LineCount() int

LineCount returns the number of logical lines in the value. A logical line is a span between hard line breaks; soft-wrapped visual lines are not counted. The empty value has one logical line; a trailing line break creates an extra empty line at the end, so "abc\n" has 2 lines.

func (*Text) LineIndexFromTextIndexInBytes

func (t *Text) LineIndexFromTextIndexInBytes(textIndexInBytes int) int

LineIndexFromTextIndexInBytes returns the index of the logical line containing textIndexInBytes. textIndexInBytes is clamped: negative values map to line 0, values past the end map to the last line.

See Text.LineCount for what counts as a logical line.

func (*Text) LineStartInBytes

func (t *Text) LineStartInBytes(lineIndex int) int

LineStartInBytes returns the byte offset where the lineIndex-th logical line begins within the value. lineIndex must be in [0, Text.LineCount).

func (*Text) Measure

func (t *Text) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Text) OnHandleButtonInput

func (t *Text) OnHandleButtonInput(f func(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult)

func (*Text) OnValueChanged

func (t *Text) OnValueChanged(f func(context *guigui.Context, text string, committed bool))

OnValueChanged sets the event handler that is called when the text value changes. The handler receives the current text and whether the change is committed. A committed change occurs when the user presses Enter (for single-line text) or when the text input loses focus. An uncommitted change occurs on every keystroke or text modification during editing.

The handler fires only when the text content actually advances. Input activity that doesn't modify the text — cursor moves, focus changes, IME state replays, redundant commit gestures — does not trigger the handler.

If the handler does not need the text payload, prefer Text.OnValueChangedWithoutText to avoid materializing the value on every change.

func (*Text) OnValueChangedWithoutText

func (t *Text) OnValueChangedWithoutText(f func(context *guigui.Context, committed bool))

OnValueChangedWithoutText sets a handler that fires under the same conditions as Text.OnValueChanged but is not given the current text. Use this when the handler only needs to know that the value changed (e.g. to mark a document dirty) so the underlying value is not materialized into a string on every change.

The handler can be registered alongside Text.OnValueChanged; both fire on the same change.

func (*Text) Paste

func (t *Text) Paste() bool

func (*Text) ReadValueFrom

func (t *Text) ReadValueFrom(r io.Reader) (int64, error)

ReadValueFrom resets the value to the bytes read from r until EOF and returns the number of bytes read. It is the streaming counterpart of Text.ForceSetValue: the change is applied immediately, the undo history is cleared, and the selection is reset to (0, 0).

If r returns a non-EOF error, the value is reset to empty and the error is returned.

func (*Text) Redo

func (t *Text) Redo() bool

func (*Text) ReplaceValueAtSelection

func (t *Text) ReplaceValueAtSelection(text string)

func (*Text) Selection

func (t *Text) Selection() (start, end int)

func (*Text) SetAutoWrap

func (t *Text) SetAutoWrap(autoWrap bool)

func (*Text) SetBold

func (t *Text) SetBold(bold bool)

func (*Text) SetColor

func (t *Text) SetColor(color color.Color)

func (*Text) SetCursorBlinking

func (t *Text) SetCursorBlinking(cursorBlinking bool)

SetCursorBlinking sets whether the cursor blinks. The default value is true.

func (*Text) SetEditable

func (t *Text) SetEditable(editable bool)

func (*Text) SetEllipsisString

func (t *Text) SetEllipsisString(str string)

func (*Text) SetHorizontalAlign

func (t *Text) SetHorizontalAlign(align HorizontalAlign)

func (*Text) SetLocales

func (t *Text) SetLocales(locales []language.Tag)

func (*Text) SetMultiline

func (t *Text) SetMultiline(multiline bool)

func (*Text) SetOpacity

func (t *Text) SetOpacity(opacity float64)

func (*Text) SetScale

func (t *Text) SetScale(scale float64)

func (*Text) SetSelectable

func (t *Text) SetSelectable(selectable bool)

func (*Text) SetSelection

func (t *Text) SetSelection(start, end int)

func (*Text) SetSelectionVisibleWhenUnfocused

func (t *Text) SetSelectionVisibleWhenUnfocused(visible bool)

SetSelectionVisibleWhenUnfocused sets whether the selection range stays drawn while the widget is not focused. By default the selection is hidden when the widget loses focus. Enable this when a separate UI (e.g. a Find dialog) holds focus but the user still needs to see what was matched.

func (*Text) SetSemanticColor

func (t *Text) SetSemanticColor(semanticColor basicwidgetdraw.SemanticColor)

func (*Text) SetTabWidth

func (t *Text) SetTabWidth(tabWidth float64)

func (*Text) SetTabular

func (t *Text) SetTabular(tabular bool)

func (*Text) SetValue

func (t *Text) SetValue(text string)

func (*Text) SetVerticalAlign

func (t *Text) SetVerticalAlign(align VerticalAlign)

func (*Text) Tick

func (t *Text) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error

func (*Text) Undo

func (t *Text) Undo() bool

func (*Text) Value

func (t *Text) Value() string

Value returns the current value as a string. For large values, prefer Text.WriteValueTo to avoid allocating a copy.

func (*Text) VerticalAlign

func (t *Text) VerticalAlign() VerticalAlign

func (*Text) WriteStateKey

func (t *Text) WriteStateKey(w *guigui.StateKeyWriter)

func (*Text) WriteValueRangeTo

func (t *Text) WriteValueRangeTo(w io.Writer, startInBytes, endInBytes int) (int64, error)

WriteValueRangeTo writes the bytes of the current value in [startInBytes, endInBytes) to w. startInBytes and endInBytes are clamped to [0, len(value)]. If the clamped start is not less than the clamped end, nothing is written.

func (*Text) WriteValueTo

func (t *Text) WriteValueTo(w io.Writer) (int64, error)

WriteValueTo writes the current value to w and returns the number of bytes written. It is the streaming counterpart of Text.Value and avoids materializing the full value as a string.

type TextInput

type TextInput struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*TextInput) Build

func (t *TextInput) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*TextInput) CanCopy

func (t *TextInput) CanCopy() bool

func (*TextInput) CanCut

func (t *TextInput) CanCut() bool

func (*TextInput) CanPaste

func (t *TextInput) CanPaste() bool

func (*TextInput) CanRedo

func (t *TextInput) CanRedo() bool

func (*TextInput) CanUndo

func (t *TextInput) CanUndo() bool

func (*TextInput) CommitWithCurrentInputValue

func (t *TextInput) CommitWithCurrentInputValue()

func (*TextInput) Copy

func (t *TextInput) Copy() bool

func (*TextInput) Cut

func (t *TextInput) Cut() bool

func (*TextInput) ForceSetValue

func (t *TextInput) ForceSetValue(text string)

func (*TextInput) HasValue

func (t *TextInput) HasValue() bool

HasValue reports whether the text input has a non-empty value. This is more efficient than checking Value() != "" as it avoids allocating a string.

func (*TextInput) IsEditable

func (t *TextInput) IsEditable() bool

func (*TextInput) IsError

func (t *TextInput) IsError() bool

IsError reports whether the text input is in the error state.

func (*TextInput) Layout

func (t *TextInput) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*TextInput) LineCount

func (t *TextInput) LineCount() int

LineCount returns the number of logical lines in the value. See Text.LineCount for details.

func (*TextInput) LineIndexFromTextIndexInBytes

func (t *TextInput) LineIndexFromTextIndexInBytes(textIndexInBytes int) int

LineIndexFromTextIndexInBytes returns the index of the logical line containing textIndexInBytes. See Text.LineIndexFromTextIndexInBytes for details.

func (*TextInput) LineStartInBytes

func (t *TextInput) LineStartInBytes(lineIndex int) int

LineStartInBytes returns the byte offset where the lineIndex-th logical line begins within the value. See Text.LineStartInBytes for details.

func (*TextInput) Measure

func (t *TextInput) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*TextInput) OnHandleButtonInput

func (t *TextInput) OnHandleButtonInput(f func(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult)

func (*TextInput) OnValueChanged

func (t *TextInput) OnValueChanged(f func(context *guigui.Context, text string, committed bool))

OnValueChanged sets the event handler that is called when the text value changes. The handler receives the current text and whether the change is committed. A committed change occurs when the user presses Enter (for single-line text) or when the text input loses focus. An uncommitted change occurs on every keystroke or text modification during editing. Note that the handler might be called even when the text content has not actually changed.

If the handler does not need the text payload, prefer TextInput.OnValueChangedWithoutText to avoid materializing the value on every change.

func (*TextInput) OnValueChangedWithoutText

func (t *TextInput) OnValueChangedWithoutText(f func(context *guigui.Context, committed bool))

OnValueChangedWithoutText sets a handler that fires under the same conditions as TextInput.OnValueChanged but is not given the current text. Use this when the handler only needs to know that the value changed so the underlying value is not materialized into a string on every change.

func (*TextInput) Paste

func (t *TextInput) Paste() bool

func (*TextInput) ReadValueFrom

func (t *TextInput) ReadValueFrom(r io.Reader) (int64, error)

ReadValueFrom resets the value to the bytes read from r until EOF. See Text.ReadValueFrom for details.

func (*TextInput) Redo

func (t *TextInput) Redo() bool

func (*TextInput) ReplaceValueAtSelection

func (t *TextInput) ReplaceValueAtSelection(text string)

func (*TextInput) SelectAll

func (t *TextInput) SelectAll()

func (*TextInput) Selection

func (t *TextInput) Selection() (start, end int)

func (*TextInput) SetAutoWrap

func (t *TextInput) SetAutoWrap(autoWrap bool)

func (*TextInput) SetCursorBlinking

func (t *TextInput) SetCursorBlinking(cursorBlinking bool)

SetCursorBlinking sets whether the cursor blinks. The default value is true.

func (*TextInput) SetEditable

func (t *TextInput) SetEditable(editable bool)

func (*TextInput) SetError

func (t *TextInput) SetError(hasError bool)

SetError sets whether the text input is in the error state. When the error state is true, the text input border is drawn in a danger color.

func (*TextInput) SetFocusBorderVisible

func (t *TextInput) SetFocusBorderVisible(visible bool)

SetFocusBorderVisible sets whether the focus border is drawn around the text input when it has focus. The default is true. The focus border is always hidden for TextInputStyleInline regardless of this setting.

func (*TextInput) SetHorizontalAlign

func (t *TextInput) SetHorizontalAlign(halign HorizontalAlign)

func (*TextInput) SetIcon

func (t *TextInput) SetIcon(icon *ebiten.Image)

func (*TextInput) SetMultiline

func (t *TextInput) SetMultiline(multiline bool)

func (*TextInput) SetSelection

func (t *TextInput) SetSelection(start, end int)

func (*TextInput) SetSelectionVisibleWhenUnfocused

func (t *TextInput) SetSelectionVisibleWhenUnfocused(visible bool)

SetSelectionVisibleWhenUnfocused sets whether the selection range stays drawn while the widget is not focused. By default the selection is hidden when the widget loses focus.

func (*TextInput) SetStyle

func (t *TextInput) SetStyle(style TextInputStyle)

func (*TextInput) SetSupportText

func (t *TextInput) SetSupportText(text string)

SetSupportText sets the support text displayed below the text input. The support text is shown in a subdued color, or in a danger color when the error state is true.

func (*TextInput) SetTabular

func (t *TextInput) SetTabular(tabular bool)

func (*TextInput) SetValue

func (t *TextInput) SetValue(text string)

func (*TextInput) SetVerticalAlign

func (t *TextInput) SetVerticalAlign(valign VerticalAlign)

func (*TextInput) SupportText

func (t *TextInput) SupportText() string

SupportText returns the support text displayed below the text input.

func (*TextInput) Tick

func (t *TextInput) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error

func (*TextInput) Undo

func (t *TextInput) Undo() bool

func (*TextInput) Value

func (t *TextInput) Value() string

Value returns the current value as a string. For large values, prefer TextInput.WriteValueTo to avoid allocating a copy.

func (*TextInput) WriteStateKey

func (t *TextInput) WriteStateKey(w *guigui.StateKeyWriter)

func (*TextInput) WriteValueRangeTo

func (t *TextInput) WriteValueRangeTo(w io.Writer, startInBytes, endInBytes int) (int64, error)

WriteValueRangeTo writes the bytes of the current value in [startInBytes, endInBytes) to w. See Text.WriteValueRangeTo for details.

func (*TextInput) WriteValueTo

func (t *TextInput) WriteValueTo(w io.Writer) (int64, error)

WriteValueTo writes the current value to w and returns the number of bytes written. See Text.WriteValueTo for details.

type TextInputStyle

type TextInputStyle int
const (
	TextInputStyleNormal TextInputStyle = iota
	TextInputStyleInline
)

type Toggle

type Toggle struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*Toggle) CursorShape

func (t *Toggle) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)

func (*Toggle) Draw

func (t *Toggle) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)

func (*Toggle) HandlePointingInput

func (t *Toggle) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult

func (*Toggle) Measure

func (t *Toggle) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*Toggle) OnValueChanged

func (t *Toggle) OnValueChanged(f func(context *guigui.Context, value bool))

func (*Toggle) SetValue

func (t *Toggle) SetValue(value bool)

func (*Toggle) Tick

func (t *Toggle) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error

func (*Toggle) Value

func (t *Toggle) Value() bool

func (*Toggle) WriteStateKey

func (t *Toggle) WriteStateKey(w *guigui.StateKeyWriter)

type TooltipArea

type TooltipArea struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

TooltipArea is a standalone widget that shows a balloon popup when the mouse cursor hovers over the area specified by its bounds. The tooltip appears above the bounds and has a black background regardless of the color mode. The tooltip automatically disappears when the mouse cursor moves out of the bounds.

TooltipArea shows a modeless popup: it does not prevent user interactions with other widgets.

func (*TooltipArea) Build

func (t *TooltipArea) Build(context *guigui.Context, adder *guigui.ChildAdder) error

Build implements guigui.Widget.Build.

func (*TooltipArea) HandlePointingInput

func (t *TooltipArea) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult

HandlePointingInput implements guigui.Widget.HandlePointingInput.

func (*TooltipArea) Layout

func (t *TooltipArea) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

Layout implements guigui.Widget.Layout.

func (*TooltipArea) SetContent

func (t *TooltipArea) SetContent(widget guigui.Widget)

SetContent sets a custom content widget for the tooltip balloon. TooltipArea.SetContent and TooltipArea.SetText are exclusive; TooltipArea.SetContent takes priority.

func (*TooltipArea) SetText

func (t *TooltipArea) SetText(text string)

SetText sets the tooltip balloon text. TooltipArea.SetContent and TooltipArea.SetText are exclusive; TooltipArea.SetContent takes priority.

func (*TooltipArea) Tick

func (t *TooltipArea) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error

Tick implements guigui.Widget.Tick.

func (*TooltipArea) WriteStateKey

func (t *TooltipArea) WriteStateKey(w *guigui.StateKeyWriter)

type UnicodeRange

type UnicodeRange struct {
	Min rune
	Max rune
}

type VerticalAlign

type VerticalAlign int

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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