Documentation
¶
Index ¶
- Constants
- Variables
- func CreateMonochromeImage(colorMode ebiten.ColorMode, img image.Image) image.Image
- func FontSize(context *guigui.Context) float64
- func LineHeight(context *guigui.Context) int
- func ListItemIndentSize(context *guigui.Context, level int) int
- func ListItemTextPadding(context *guigui.Context) guigui.Padding
- func MoveItemsInSlice[T any](slice []T, from int, count int, to int) int
- func RegisterFonts(appendEntries func([]FaceSourceEntry, *guigui.Context) []FaceSourceEntry, ...)
- func RoundedCornerRadius(context *guigui.Context) int
- func SetFaceSources(entries []FaceSourceEntry)
- func TooltipTextPadding(context *guigui.Context) guigui.Padding
- func UnitSize(context *guigui.Context) int
- type Background
- type Button
- func (b *Button) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (b *Button) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
- func (b *Button) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (b *Button) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
- func (b *Button) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (b *Button) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (b *Button) OnDown(f func(context *guigui.Context))
- func (b *Button) OnUp(f func(context *guigui.Context))
- func (b *Button) SetContent(content guigui.Widget)
- func (b *Button) SetIcon(icon *ebiten.Image)
- func (b *Button) SetIconAlign(align IconAlign)
- func (b *Button) SetSemanticColor(semanticColor basicwidgetdraw.SemanticColor)
- func (b *Button) SetSharpCorners(sharpCorners Corners)
- func (b *Button) SetText(text string)
- func (b *Button) SetTextBold(bold bool)
- func (b *Button) SetType(typ ButtonType)
- func (b *Button) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (b *Button) WriteStateKey(w *guigui.StateKeyWriter)
- type ButtonType
- type Checkbox
- func (c *Checkbox) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (c *Checkbox) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
- func (c *Checkbox) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (c *Checkbox) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
- func (c *Checkbox) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (c *Checkbox) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (c *Checkbox) OnValueChanged(f func(context *guigui.Context, value bool))
- func (c *Checkbox) SetValue(value bool)
- func (c *Checkbox) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (c *Checkbox) Value() bool
- func (c *Checkbox) WriteStateKey(w *guigui.StateKeyWriter)
- type Combobox
- func (c *Combobox) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (c *Combobox) IsError() bool
- func (c *Combobox) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (c *Combobox) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (c *Combobox) OnValueChanged(f func(context *guigui.Context, value string, committed bool))
- func (c *Combobox) SetAllowFreeInput(allow bool)
- func (c *Combobox) SetError(hasError bool)
- func (c *Combobox) SetItems(items []string)
- func (c *Combobox) SetSupportText(text string)
- func (c *Combobox) SetValue(value string)
- func (c *Combobox) SupportText() string
- func (c *Combobox) TextInput() *TextInput
- func (c *Combobox) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (c *Combobox) Value() string
- type ContextMenuArea
- func (c *ContextMenuArea[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (c *ContextMenuArea[T]) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
- func (c *ContextMenuArea[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (c *ContextMenuArea[T]) PopupMenu() *PopupMenu[T]
- type Corners
- type Divider
- type Drawer
- func (d *Drawer) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (d *Drawer) IsOpen() bool
- func (d *Drawer) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (d *Drawer) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (d *Drawer) OnClose(onClose func(context *guigui.Context, reason PopupCloseReason))
- func (d *Drawer) SetAnimated(animateOnFading bool)
- func (d *Drawer) SetBackgroundBlurred(blurred bool)
- func (d *Drawer) SetBackgroundBounds(bounds image.Rectangle)
- func (d *Drawer) SetBackgroundDark(dark bool)
- func (d *Drawer) SetBackgroundSemanticColor(semanticColor basicwidgetdraw.SemanticColor)
- func (d *Drawer) SetCloseByClickingOutside(closeByClickingOutside bool)
- func (d *Drawer) SetContent(widget guigui.Widget)
- func (d *Drawer) SetDrawerEdge(edge DrawerEdge)
- func (d *Drawer) SetOpen(open bool)
- type DrawerEdge
- type Expander
- func (e *Expander) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (e *Expander) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (e *Expander) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (e *Expander) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (e *Expander) OnExpansionChanged(callback func(context *guigui.Context, expanded bool))
- func (e *Expander) SetContentWidget(w guigui.Widget)
- func (e *Expander) SetExpanded(expanded bool)
- func (e *Expander) SetHeaderWidget(w guigui.Widget)
- func (e *Expander) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (e *Expander) WriteStateKey(w *guigui.StateKeyWriter)
- type FaceSourceEntry
- type FontPriority
- type Form
- func (f *Form) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (f *Form) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (f *Form) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (f *Form) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (f *Form) SetItems(items []FormItem)
- type FormItem
- type HorizontalAlign
- type IconAlign
- type Image
- func (i *Image) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (i *Image) HasImage() bool
- func (i *Image) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (i *Image) SetImage(image *ebiten.Image)
- func (i *Image) WriteStateKey(w *guigui.StateKeyWriter)
- type List
- func (l *List[T]) AppendSelectedItemIndices(indices []int) []int
- func (l *List[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (l *List[T]) EnsureItemVisibleByIndex(index int)
- func (l *List[T]) ID(index int) any
- func (l *List[T]) IndexByValue(value T) int
- func (l *List[T]) IsItemAvailable(index int) bool
- func (l *List[T]) IsItemInViewport(index int) bool
- func (l *List[T]) ItemBounds(index int) image.Rectangle
- func (l *List[T]) ItemByIndex(index int) (ListItem[T], bool)
- func (l *List[T]) ItemCount() int
- func (l *List[T]) JumpToItemByIndex(index int)
- func (l *List[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (l *List[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (l *List[T]) OnItemExpanderToggled(f func(context *guigui.Context, index int, expanded bool))
- func (l *List[T]) OnItemSelected(f func(context *guigui.Context, index int))
- func (l *List[T]) OnItemsCanMove(f func(context *guigui.Context, from, count, to int) bool)
- func (l *List[T]) OnItemsMoved(f func(context *guigui.Context, from, count, to int))
- func (l *List[T]) OnItemsSelected(f func(context *guigui.Context, indices []int))
- func (l *List[T]) SelectAllItems()
- func (l *List[T]) SelectItemByIndex(index int)
- func (l *List[T]) SelectItemByValue(value T)
- func (l *List[T]) SelectItemsByIndices(indices []int)
- func (l *List[T]) SelectItemsByValues(values []T)
- func (l *List[T]) SelectedItem() (ListItem[T], bool)
- func (l *List[T]) SelectedItemCount() int
- func (l *List[T]) SelectedItemIndex() int
- func (l *List[T]) SetBackground(widget guigui.Widget)
- func (l *List[T]) SetFooterHeight(height int)
- func (l *List[T]) SetHeaderHeight(height int)
- func (l *List[T]) SetItemHeight(height int)
- func (l *List[T]) SetItemString(str string, index int)
- func (l *List[T]) SetItems(items []ListItem[T])
- func (l *List[T]) SetItemsByStrings(strs []string)
- func (l *List[T]) SetMultiSelection(multi bool)
- func (l *List[T]) SetReservesCheckmarkSpace(reserves bool)
- func (l *List[T]) SetStripeVisible(visible bool)
- func (l *List[T]) SetStyle(style ListStyle)
- func (l *List[T]) SetUnfocusedSelectionVisible(visible bool)
- func (l *List[T]) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (l *List[T]) WriteStateKey(w *guigui.StateKeyWriter)
- type ListItem
- type ListItemColorType
- type ListStyle
- type Menubar
- func (m *Menubar[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (m *Menubar[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (m *Menubar[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (m *Menubar[T]) OnItemSelected(f func(context *guigui.Context, menuIndex, itemIndex int))
- func (m *Menubar[T]) PopupMenuAt(index int) *PopupMenu[T]
- func (m *Menubar[T]) SetItems(items []MenubarItem)
- func (m *Menubar[T]) WriteStateKey(w *guigui.StateKeyWriter)
- type MenubarItem
- type NumberInput
- func (n *NumberInput) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (n *NumberInput) CanCopy() bool
- func (n *NumberInput) CanCut() bool
- func (n *NumberInput) CanPaste() bool
- func (n *NumberInput) CommitWithCurrentInputValue()
- func (n *NumberInput) Copy() bool
- func (n *NumberInput) Cut() bool
- func (n *NumberInput) ForceSetValue(value int)
- func (n *NumberInput) ForceSetValueBigInt(value *big.Int)
- func (n *NumberInput) ForceSetValueInt64(value int64)
- func (n *NumberInput) ForceSetValueUint64(value uint64)
- func (n *NumberInput) IsEditable() bool
- func (n *NumberInput) IsError() bool
- func (n *NumberInput) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (n *NumberInput) MaximumValueBigInt() *big.Int
- func (n *NumberInput) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (n *NumberInput) MinimumValueBigInt() *big.Int
- func (n *NumberInput) OnHandleButtonInput(...)
- func (n *NumberInput) OnValueChanged(f func(context *guigui.Context, value int, committed bool))
- func (n *NumberInput) OnValueChangedBigInt(f func(context *guigui.Context, value *big.Int, committed bool))
- func (n *NumberInput) OnValueChangedInt64(f func(context *guigui.Context, value int64, committed bool))
- func (n *NumberInput) OnValueChangedUint64(f func(context *guigui.Context, value uint64, committed bool))
- func (n *NumberInput) Paste() bool
- func (n *NumberInput) SetEditable(editable bool)
- func (n *NumberInput) SetError(hasError bool)
- func (n *NumberInput) SetMaximumValue(maximum int)
- func (n *NumberInput) SetMaximumValueBigInt(maximum *big.Int)
- func (n *NumberInput) SetMaximumValueInt64(maximum int64)
- func (n *NumberInput) SetMaximumValueUint64(maximum uint64)
- func (n *NumberInput) SetMinimumValue(minimum int)
- func (n *NumberInput) SetMinimumValueBigInt(minimum *big.Int)
- func (n *NumberInput) SetMinimumValueInt64(minimum int64)
- func (n *NumberInput) SetMinimumValueUint64(minimum uint64)
- func (n *NumberInput) SetStep(step int)
- func (n *NumberInput) SetStepBigInt(step *big.Int)
- func (n *NumberInput) SetStepInt64(step int64)
- func (n *NumberInput) SetStepUint64(step uint64)
- func (n *NumberInput) SetSupportText(text string)
- func (n *NumberInput) SetValue(value int)
- func (n *NumberInput) SetValueBigInt(value *big.Int)
- func (n *NumberInput) SetValueInt64(value int64)
- func (n *NumberInput) SetValueUint64(value uint64)
- func (n *NumberInput) SupportText() string
- func (n *NumberInput) Value() int
- func (n *NumberInput) ValueBigInt() *big.Int
- func (n *NumberInput) ValueInt64() int64
- func (n *NumberInput) ValueUint64() uint64
- type Panel
- func (p *Panel) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (p *Panel) EnsureRectangleVisible(rect image.Rectangle)
- func (p *Panel) ForceSetScrollOffset(offsetX, offsetY float64)
- func (p *Panel) ForceSetScrollOffsetByDelta(offsetXDelta, offsetYDelta float64)
- func (p *Panel) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (p *Panel) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (p *Panel) OnScroll(callback func(context *guigui.Context, offsetX, offsetY float64))
- func (p *Panel) SetAutoBorder(auto bool)
- func (p *Panel) SetBorders(borders PanelBorders)
- func (p *Panel) SetContent(widget guigui.Widget)
- func (p *Panel) SetContentConstraints(c PanelContentConstraints)
- func (p *Panel) SetScrollOffset(offsetX, offsetY float64)
- func (p *Panel) SetScrollOffsetByDelta(offsetXDelta, offsetYDelta float64)
- func (p *Panel) SetStyle(typ PanelStyle)
- type PanelBorders
- type PanelContentConstraints
- type PanelStyle
- type Popup
- func (p *Popup) BringToFrontLayer(context *guigui.Context)
- func (p *Popup) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (p *Popup) Env(context *guigui.Context, key guigui.EnvKey, source *guigui.EnvSource) (any, bool)
- func (p *Popup) IsOpen() bool
- func (p *Popup) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (p *Popup) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (p *Popup) OnClose(f func(context *guigui.Context, reason PopupCloseReason))
- func (p *Popup) SetAnimated(animateOnFading bool)
- func (p *Popup) SetBackgroundBlurred(blurred bool)
- func (p *Popup) SetBackgroundBounds(bounds image.Rectangle)
- func (p *Popup) SetBackgroundDark(dark bool)
- func (p *Popup) SetBackgroundSemanticColor(semanticColor basicwidgetdraw.SemanticColor)
- func (p *Popup) SetCloseByClickingOutside(closeByClickingOutside bool)
- func (p *Popup) SetContent(widget guigui.Widget)
- func (p *Popup) SetModal(modal bool)
- func (p *Popup) SetOpen(open bool)
- type PopupCloseReason
- type PopupMenu
- func (p *PopupMenu[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (p *PopupMenu[T]) HandleButtonInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
- func (p *PopupMenu[T]) IsOpen() bool
- func (p *PopupMenu[T]) ItemByIndex(index int) (PopupMenuItem[T], bool)
- func (p *PopupMenu[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (p *PopupMenu[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (p *PopupMenu[T]) OnClose(f func(context *guigui.Context, reason PopupCloseReason))
- func (p *PopupMenu[T]) OnItemSelected(f func(context *guigui.Context, index int))
- func (p *PopupMenu[T]) SelectItemByIndex(index int)
- func (p *PopupMenu[T]) SelectItemByValue(value T)
- func (p *PopupMenu[T]) SelectedItem() (PopupMenuItem[T], bool)
- func (p *PopupMenu[T]) SelectedItemIndex() int
- func (p *PopupMenu[T]) SetItems(items []PopupMenuItem[T])
- func (p *PopupMenu[T]) SetItemsByStrings(items []string)
- func (p *PopupMenu[T]) SetOpen(open bool)
- func (p *PopupMenu[T]) SetReservesCheckmarkSpace(reserves bool)
- type PopupMenuItem
- type RadioButton
- func (r *RadioButton[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (r *RadioButton[T]) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
- func (r *RadioButton[T]) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (r *RadioButton[T]) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
- func (r *RadioButton[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (r *RadioButton[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (r *RadioButton[T]) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (r *RadioButton[T]) WriteStateKey(w *guigui.StateKeyWriter)
- type RadioButtonGroup
- func (r *RadioButtonGroup[T]) OnItemSelected(f func(context *guigui.Context, index int))
- func (r *RadioButtonGroup[T]) RadioButton(index int) *RadioButton[T]
- func (r *RadioButtonGroup[T]) SelectItemByIndex(index int)
- func (r *RadioButtonGroup[T]) SelectItemByValue(value T)
- func (r *RadioButtonGroup[T]) SelectedIndex() int
- func (r *RadioButtonGroup[T]) SelectedValue() (T, bool)
- func (r *RadioButtonGroup[T]) SetValues(values []T)
- func (r *RadioButtonGroup[T]) WriteStateKey(w *guigui.StateKeyWriter)
- type SegmentedControl
- func (s *SegmentedControl[T]) AppendSelectedItemIndices(indices []int) []int
- func (s *SegmentedControl[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (s *SegmentedControl[T]) ItemByIndex(index int) (SegmentedControlItem[T], bool)
- func (s *SegmentedControl[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (s *SegmentedControl[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (s *SegmentedControl[T]) OnItemSelected(f func(context *guigui.Context, index int))
- func (s *SegmentedControl[T]) OnItemsSelected(f func(context *guigui.Context, indices []int))
- func (s *SegmentedControl[T]) SelectItemByIndex(index int)
- func (s *SegmentedControl[T]) SelectItemByValue(value T)
- func (s *SegmentedControl[T]) SelectItemsByIndices(indices []int)
- func (s *SegmentedControl[T]) SelectItemsByValues(values []T)
- func (s *SegmentedControl[T]) SelectedItem() (SegmentedControlItem[T], bool)
- func (s *SegmentedControl[T]) SelectedItemCount() int
- func (s *SegmentedControl[T]) SelectedItemIndex() int
- func (s *SegmentedControl[T]) SetDirection(direction SegmentedControlDirection)
- func (s *SegmentedControl[T]) SetItems(items []SegmentedControlItem[T])
- func (s *SegmentedControl[T]) SetMultiSelection(multi bool)
- func (s *SegmentedControl[T]) WriteStateKey(w *guigui.StateKeyWriter)
- type SegmentedControlDirection
- type SegmentedControlItem
- type Select
- func (s *Select[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (s *Select[T]) IsPopupOpen() bool
- func (s *Select[T]) ItemByIndex(index int) (SelectItem[T], bool)
- func (s *Select[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (s *Select[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (s *Select[T]) OnItemSelected(f func(context *guigui.Context, index int))
- func (s *Select[T]) SelectItemByIndex(index int)
- func (s *Select[T]) SelectItemByValue(value T)
- func (s *Select[T]) SelectedItem() (SelectItem[T], bool)
- func (s *Select[T]) SelectedItemIndex() int
- func (s *Select[T]) SetItems(items []SelectItem[T])
- func (s *Select[T]) SetItemsByStrings(items []string)
- type SelectItem
- type Slider
- func (s *Slider) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (s *Slider) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
- func (s *Slider) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (s *Slider) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
- func (s *Slider) MaximumValueBigInt() *big.Int
- func (s *Slider) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (s *Slider) MinimumValueBigInt() *big.Int
- func (s *Slider) OnValueChanged(f func(context *guigui.Context, value int))
- func (s *Slider) OnValueChangedBigInt(f func(context *guigui.Context, value *big.Int))
- func (s *Slider) OnValueChangedInt64(f func(context *guigui.Context, value int64))
- func (s *Slider) OnValueChangedUint64(f func(context *guigui.Context, value uint64))
- func (s *Slider) SetMaximumValue(maximum int)
- func (s *Slider) SetMaximumValueBigInt(maximum *big.Int)
- func (s *Slider) SetMaximumValueInt64(maximum int64)
- func (s *Slider) SetMaximumValueUint64(maximum uint64)
- func (s *Slider) SetMinimumValue(minimum int)
- func (s *Slider) SetMinimumValueBigInt(minimum *big.Int)
- func (s *Slider) SetMinimumValueInt64(minimum int64)
- func (s *Slider) SetMinimumValueUint64(minimum uint64)
- func (s *Slider) SetSnapOnly(snapOnly bool)
- func (s *Slider) SetStep(step int)
- func (s *Slider) SetStepBigInt(step *big.Int)
- func (s *Slider) SetStepInt64(step int64)
- func (s *Slider) SetStepUint64(step uint64)
- func (s *Slider) SetValue(value int)
- func (s *Slider) SetValueBigInt(value *big.Int)
- func (s *Slider) SetValueInt64(value int64)
- func (s *Slider) SetValueUint64(value uint64)
- func (s *Slider) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (s *Slider) Value() int
- func (s *Slider) ValueBigInt() *big.Int
- func (s *Slider) ValueInt64() int64
- func (s *Slider) ValueUint64() uint64
- func (s *Slider) WriteStateKey(w *guigui.StateKeyWriter)
- type Table
- func (t *Table[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (t *Table[T]) CellBounds(rowIndex, colIndex int) image.Rectangle
- func (t *Table[T]) EnsureItemVisibleByIndex(index int)
- func (t *Table[T]) ID(index int) any
- func (t *Table[T]) IsItemAvailable(index int) bool
- func (t *Table[T]) ItemBounds(index int) image.Rectangle
- func (t *Table[T]) ItemByIndex(index int) (TableRow[T], bool)
- func (t *Table[T]) ItemCount() int
- func (t *Table[T]) JumpToItemByIndex(index int)
- func (t *Table[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (t *Table[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (t *Table[T]) OnItemSelected(f func(context *guigui.Context, index int))
- func (t *Table[T]) OnItemsMoved(f func(context *guigui.Context, from, count, to int))
- func (t *Table[T]) SelectItemByIndex(index int)
- func (t *Table[T]) SelectItemByValue(value T)
- func (t *Table[T]) SelectedItem() (TableRow[T], bool)
- func (t *Table[T]) SelectedItemIndex() int
- func (t *Table[T]) SetColumns(columns []TableColumn)
- func (t *Table[T]) SetFooterHeight(height int)
- func (t *Table[T]) SetItems(items []TableRow[T])
- func (t *Table[T]) SetReservesCheckmarkSpace(reserves bool)
- type TableCell
- type TableColumn
- type TableRow
- type Text
- func (t *Text) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (t *Text) CanCopy() bool
- func (t *Text) CanCut() bool
- func (t *Text) CanPaste() bool
- func (t *Text) CanRedo() bool
- func (t *Text) CanUndo() bool
- func (t *Text) CommitWithCurrentInputValue()
- func (t *Text) Copy() bool
- func (t *Text) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
- func (t *Text) Cut() bool
- func (t *Text) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (t *Text) ForceSetValue(text string)
- func (t *Text) HandleButtonInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
- func (t *Text) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
- func (t *Text) HasValue() bool
- func (t *Text) HorizontalAlign() HorizontalAlign
- func (t *Text) IsEditable() bool
- func (t *Text) IsMultiline() bool
- func (t *Text) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (t *Text) LineCount() int
- func (t *Text) LineIndexFromTextIndexInBytes(textIndexInBytes int) int
- func (t *Text) LineStartInBytes(lineIndex int) int
- func (t *Text) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (t *Text) OnHandleButtonInput(...)
- func (t *Text) OnValueChanged(f func(context *guigui.Context, text string, committed bool))
- func (t *Text) OnValueChangedWithoutText(f func(context *guigui.Context, committed bool))
- func (t *Text) Paste() bool
- func (t *Text) ReadValueFrom(r io.Reader) (int64, error)
- func (t *Text) Redo() bool
- func (t *Text) ReplaceValueAtSelection(text string)
- func (t *Text) Selection() (start, end int)
- func (t *Text) SetAutoWrap(autoWrap bool)
- func (t *Text) SetBold(bold bool)
- func (t *Text) SetColor(color color.Color)
- func (t *Text) SetCursorBlinking(cursorBlinking bool)
- func (t *Text) SetEditable(editable bool)
- func (t *Text) SetEllipsisString(str string)
- func (t *Text) SetHorizontalAlign(align HorizontalAlign)
- func (t *Text) SetLocales(locales []language.Tag)
- func (t *Text) SetMultiline(multiline bool)
- func (t *Text) SetOpacity(opacity float64)
- func (t *Text) SetScale(scale float64)
- func (t *Text) SetSelectable(selectable bool)
- func (t *Text) SetSelection(start, end int)
- func (t *Text) SetSelectionVisibleWhenUnfocused(visible bool)
- func (t *Text) SetSemanticColor(semanticColor basicwidgetdraw.SemanticColor)
- func (t *Text) SetTabWidth(tabWidth float64)
- func (t *Text) SetTabular(tabular bool)
- func (t *Text) SetValue(text string)
- func (t *Text) SetVerticalAlign(align VerticalAlign)
- func (t *Text) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (t *Text) Undo() bool
- func (t *Text) Value() string
- func (t *Text) VerticalAlign() VerticalAlign
- func (t *Text) WriteStateKey(w *guigui.StateKeyWriter)
- func (t *Text) WriteValueRangeTo(w io.Writer, startInBytes, endInBytes int) (int64, error)
- func (t *Text) WriteValueTo(w io.Writer) (int64, error)
- type TextInput
- func (t *TextInput) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (t *TextInput) CanCopy() bool
- func (t *TextInput) CanCut() bool
- func (t *TextInput) CanPaste() bool
- func (t *TextInput) CanRedo() bool
- func (t *TextInput) CanUndo() bool
- func (t *TextInput) CommitWithCurrentInputValue()
- func (t *TextInput) Copy() bool
- func (t *TextInput) Cut() bool
- func (t *TextInput) ForceSetValue(text string)
- func (t *TextInput) HasValue() bool
- func (t *TextInput) IsEditable() bool
- func (t *TextInput) IsError() bool
- func (t *TextInput) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (t *TextInput) LineCount() int
- func (t *TextInput) LineIndexFromTextIndexInBytes(textIndexInBytes int) int
- func (t *TextInput) LineStartInBytes(lineIndex int) int
- func (t *TextInput) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (t *TextInput) OnHandleButtonInput(...)
- func (t *TextInput) OnValueChanged(f func(context *guigui.Context, text string, committed bool))
- func (t *TextInput) OnValueChangedWithoutText(f func(context *guigui.Context, committed bool))
- func (t *TextInput) Paste() bool
- func (t *TextInput) ReadValueFrom(r io.Reader) (int64, error)
- func (t *TextInput) Redo() bool
- func (t *TextInput) ReplaceValueAtSelection(text string)
- func (t *TextInput) SelectAll()
- func (t *TextInput) Selection() (start, end int)
- func (t *TextInput) SetAutoWrap(autoWrap bool)
- func (t *TextInput) SetCursorBlinking(cursorBlinking bool)
- func (t *TextInput) SetEditable(editable bool)
- func (t *TextInput) SetError(hasError bool)
- func (t *TextInput) SetFocusBorderVisible(visible bool)
- func (t *TextInput) SetHorizontalAlign(halign HorizontalAlign)
- func (t *TextInput) SetIcon(icon *ebiten.Image)
- func (t *TextInput) SetMultiline(multiline bool)
- func (t *TextInput) SetSelection(start, end int)
- func (t *TextInput) SetSelectionVisibleWhenUnfocused(visible bool)
- func (t *TextInput) SetStyle(style TextInputStyle)
- func (t *TextInput) SetSupportText(text string)
- func (t *TextInput) SetTabular(tabular bool)
- func (t *TextInput) SetValue(text string)
- func (t *TextInput) SetVerticalAlign(valign VerticalAlign)
- func (t *TextInput) SupportText() string
- func (t *TextInput) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (t *TextInput) Undo() bool
- func (t *TextInput) Value() string
- func (t *TextInput) WriteStateKey(w *guigui.StateKeyWriter)
- func (t *TextInput) WriteValueRangeTo(w io.Writer, startInBytes, endInBytes int) (int64, error)
- func (t *TextInput) WriteValueTo(w io.Writer) (int64, error)
- type TextInputStyle
- type Toggle
- func (t *Toggle) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
- func (t *Toggle) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (t *Toggle) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
- func (t *Toggle) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (t *Toggle) OnValueChanged(f func(context *guigui.Context, value bool))
- func (t *Toggle) SetValue(value bool)
- func (t *Toggle) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (t *Toggle) Value() bool
- func (t *Toggle) WriteStateKey(w *guigui.StateKeyWriter)
- type TooltipArea
- func (t *TooltipArea) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (t *TooltipArea) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
- func (t *TooltipArea) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (t *TooltipArea) SetContent(widget guigui.Widget)
- func (t *TooltipArea) SetText(text string)
- func (t *TooltipArea) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (t *TooltipArea) WriteStateKey(w *guigui.StateKeyWriter)
- type UnicodeRange
- type VerticalAlign
Constants ¶
const ( FontPriorityLow = 100 FontPriorityNormal = 200 FontPriorityHigh = 300 )
Variables ¶
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 LineHeight ¶
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 SetFaceSources ¶
func SetFaceSources(entries []FaceSourceEntry)
SetFaceSources sets the face sources.
func TooltipTextPadding ¶
TooltipTextPadding returns the padding for tooltip text content.
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) CursorShape ¶
func (b *Button) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
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) SetContent ¶
func (*Button) SetIconAlign ¶
func (*Button) SetSemanticColor ¶
func (b *Button) SetSemanticColor(semanticColor basicwidgetdraw.SemanticColor)
func (*Button) SetSharpCorners ¶
func (*Button) SetTextBold ¶
func (*Button) SetType ¶
func (b *Button) SetType(typ ButtonType)
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) CursorShape ¶
func (c *Checkbox) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
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) OnValueChanged ¶
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) Layout ¶
func (c *Combobox) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*Combobox) OnValueChanged ¶
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 ¶
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 ¶
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) SetSupportText ¶
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) SupportText ¶
SupportText returns the support text displayed below the combobox.
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 Drawer ¶
type Drawer struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
func (*Drawer) Layout ¶
func (d *Drawer) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*Drawer) OnClose ¶
func (d *Drawer) OnClose(onClose func(context *guigui.Context, reason PopupCloseReason))
func (*Drawer) SetAnimated ¶
func (*Drawer) SetBackgroundBlurred ¶
func (*Drawer) SetBackgroundBounds ¶
func (*Drawer) SetBackgroundDark ¶
func (*Drawer) SetBackgroundSemanticColor ¶
func (d *Drawer) SetBackgroundSemanticColor(semanticColor basicwidgetdraw.SemanticColor)
func (*Drawer) SetCloseByClickingOutside ¶
func (*Drawer) SetContent ¶
func (*Drawer) SetDrawerEdge ¶
func (d *Drawer) SetDrawerEdge(edge DrawerEdge)
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) Layout ¶
func (e *Expander) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*Expander) OnExpansionChanged ¶
func (*Expander) SetContentWidget ¶
func (*Expander) SetExpanded ¶
func (*Expander) SetHeaderWidget ¶
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) Layout ¶
func (f *Form) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
type HorizontalAlign ¶
type HorizontalAlign int
const ( HorizontalAlignStart HorizontalAlign = HorizontalAlign(textutil.HorizontalAlignStart) HorizontalAlignCenter HorizontalAlign = HorizontalAlign(textutil.HorizontalAlignCenter) HorizontalAlignEnd HorizontalAlign = HorizontalAlign(textutil.HorizontalAlignEnd) HorizontalAlignLeft HorizontalAlign = HorizontalAlign(textutil.HorizontalAlignLeft) HorizontalAlignRight HorizontalAlign = HorizontalAlign(textutil.HorizontalAlignRight) )
type Image ¶
type Image struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
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 (*List[T]) EnsureItemVisibleByIndex ¶
func (*List[T]) IndexByValue ¶
func (*List[T]) IsItemAvailable ¶
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 ¶
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]) JumpToItemByIndex ¶
func (*List[T]) Layout ¶
func (l *List[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*List[T]) OnItemExpanderToggled ¶
func (*List[T]) OnItemSelected ¶
func (*List[T]) OnItemsCanMove ¶
func (*List[T]) OnItemsMoved ¶
func (*List[T]) OnItemsSelected ¶
func (*List[T]) SelectAllItems ¶
func (l *List[T]) SelectAllItems()
func (*List[T]) SelectItemByIndex ¶
func (*List[T]) SelectItemByValue ¶
func (l *List[T]) SelectItemByValue(value T)
func (*List[T]) SelectItemsByIndices ¶
func (*List[T]) SelectItemsByValues ¶
func (l *List[T]) SelectItemsByValues(values []T)
func (*List[T]) SelectedItem ¶
func (*List[T]) SelectedItemCount ¶
func (*List[T]) SelectedItemIndex ¶
func (*List[T]) SetBackground ¶
func (*List[T]) SetFooterHeight ¶
func (*List[T]) SetHeaderHeight ¶
func (*List[T]) SetItemHeight ¶
func (*List[T]) SetItemString ¶
func (*List[T]) SetItemsByStrings ¶
func (*List[T]) SetMultiSelection ¶
func (*List[T]) SetReservesCheckmarkSpace ¶
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 (*List[T]) SetUnfocusedSelectionVisible ¶
SetUnfocusedSelectionVisible sets whether to show the selection background when the list is unfocused. The default is true.
func (*List[T]) WriteStateKey ¶
func (l *List[T]) WriteStateKey(w *guigui.StateKeyWriter)
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.
type Menubar ¶
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 (*Menubar[T]) Build ¶
Build implements guigui.Widget.Build.
func (*Menubar[T]) Layout ¶
func (m *Menubar[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
Layout implements guigui.Widget.Layout.
func (*Menubar[T]) Measure ¶
Measure implements guigui.Widget.Measure.
func (*Menubar[T]) OnItemSelected ¶
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 (*Menubar[T]) PopupMenuAt ¶
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 (*Menubar[T]) SetItems ¶
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 (*Menubar[T]) WriteStateKey ¶
func (m *Menubar[T]) WriteStateKey(w *guigui.StateKeyWriter)
WriteStateKey implements guigui.Widget.WriteStateKey.
type MenubarItem ¶
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 (*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) EnsureRectangleVisible ¶
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 (*Panel) ForceSetScrollOffsetByDelta ¶
func (*Panel) Layout ¶
func (p *Panel) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*Panel) SetAutoBorder ¶
func (*Panel) SetBorders ¶
func (p *Panel) SetBorders(borders PanelBorders)
func (*Panel) SetContent ¶
func (*Panel) SetContentConstraints ¶
func (p *Panel) SetContentConstraints(c PanelContentConstraints)
func (*Panel) SetScrollOffset ¶
func (*Panel) SetScrollOffsetByDelta ¶
func (*Panel) SetStyle ¶
func (p *Panel) SetStyle(typ PanelStyle)
type PanelContentConstraints ¶
type PanelContentConstraints int
const ( PanelContentConstraintsNone PanelContentConstraints = iota PanelContentConstraintsFixedWidth PanelContentConstraintsFixedHeight )
type Popup ¶
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 ¶
BringToFrontLayer brings the popup to the front layer.
func (*Popup) Layout ¶
func (p *Popup) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*Popup) OnClose ¶
func (p *Popup) OnClose(f func(context *guigui.Context, reason PopupCloseReason))
func (*Popup) SetAnimated ¶
func (*Popup) SetBackgroundBlurred ¶
func (*Popup) SetBackgroundBounds ¶
func (*Popup) SetBackgroundDark ¶
func (*Popup) SetBackgroundSemanticColor ¶
func (p *Popup) SetBackgroundSemanticColor(semanticColor basicwidgetdraw.SemanticColor)
func (*Popup) SetCloseByClickingOutside ¶
func (*Popup) SetContent ¶
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]) HandleButtonInput ¶
func (p *PopupMenu[T]) HandleButtonInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
HandleButtonInput implements guigui.Widget.HandleButtonInput.
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]) OnClose ¶
func (p *PopupMenu[T]) OnClose(f func(context *guigui.Context, reason PopupCloseReason))
func (*PopupMenu[T]) OnItemSelected ¶
func (*PopupMenu[T]) SelectItemByIndex ¶
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 (*PopupMenu[T]) SetItems ¶
func (p *PopupMenu[T]) SetItems(items []PopupMenuItem[T])
func (*PopupMenu[T]) SetItemsByStrings ¶
func (*PopupMenu[T]) SetReservesCheckmarkSpace ¶
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 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 Select ¶
type Select[T comparable] struct { guigui.DefaultWidget // contains filtered or unexported fields }
func (*Select[T]) IsPopupOpen ¶
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]) OnItemSelected ¶
func (*Select[T]) SelectItemByIndex ¶
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 (*Select[T]) SetItems ¶
func (s *Select[T]) SetItems(items []SelectItem[T])
func (*Select[T]) SetItemsByStrings ¶
type SelectItem ¶
type Slider ¶
type Slider struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
func (*Slider) CursorShape ¶
func (s *Slider) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
func (*Slider) HandlePointingInput ¶
func (s *Slider) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
func (*Slider) MaximumValueBigInt ¶
func (*Slider) MinimumValueBigInt ¶
func (*Slider) OnValueChanged ¶
func (*Slider) OnValueChangedBigInt ¶
func (*Slider) OnValueChangedInt64 ¶
func (*Slider) OnValueChangedUint64 ¶
func (*Slider) SetMaximumValue ¶
func (*Slider) SetMaximumValueBigInt ¶
func (*Slider) SetMaximumValueInt64 ¶
func (*Slider) SetMaximumValueUint64 ¶
func (*Slider) SetMinimumValue ¶
func (*Slider) SetMinimumValueBigInt ¶
func (*Slider) SetMinimumValueInt64 ¶
func (*Slider) SetMinimumValueUint64 ¶
func (*Slider) SetSnapOnly ¶
func (*Slider) SetStepBigInt ¶
func (*Slider) SetStepInt64 ¶
func (*Slider) SetStepUint64 ¶
func (*Slider) SetValueBigInt ¶
func (*Slider) SetValueInt64 ¶
func (*Slider) SetValueUint64 ¶
func (*Slider) ValueBigInt ¶
func (*Slider) ValueInt64 ¶
func (*Slider) ValueUint64 ¶
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]) CellBounds ¶
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 (*Table[T]) IsItemAvailable ¶
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]) JumpToItemByIndex ¶
func (*Table[T]) Layout ¶
func (t *Table[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*Table[T]) OnItemSelected ¶
func (*Table[T]) OnItemsMoved ¶
func (*Table[T]) SelectItemByIndex ¶
func (*Table[T]) SelectItemByValue ¶
func (t *Table[T]) SelectItemByValue(value T)
func (*Table[T]) SelectedItem ¶
func (*Table[T]) SelectedItemIndex ¶
func (*Table[T]) SetColumns ¶
func (t *Table[T]) SetColumns(columns []TableColumn)
func (*Table[T]) SetFooterHeight ¶
func (*Table[T]) SetReservesCheckmarkSpace ¶
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) CommitWithCurrentInputValue ¶
func (t *Text) CommitWithCurrentInputValue()
func (*Text) CursorShape ¶
func (t *Text) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
func (*Text) ForceSetValue ¶
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 ¶
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 (*Text) IsMultiline ¶
func (*Text) Layout ¶
func (t *Text) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*Text) LineCount ¶
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 ¶
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 ¶
LineStartInBytes returns the byte offset where the lineIndex-th logical line begins within the value. lineIndex must be in [0, Text.LineCount).
func (*Text) OnHandleButtonInput ¶
func (t *Text) OnHandleButtonInput(f func(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult)
func (*Text) OnValueChanged ¶
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 ¶
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) ReadValueFrom ¶
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) ReplaceValueAtSelection ¶
func (*Text) SetAutoWrap ¶
func (*Text) SetCursorBlinking ¶
SetCursorBlinking sets whether the cursor blinks. The default value is true.
func (*Text) SetEditable ¶
func (*Text) SetEllipsisString ¶
func (*Text) SetHorizontalAlign ¶
func (t *Text) SetHorizontalAlign(align HorizontalAlign)
func (*Text) SetLocales ¶
func (*Text) SetMultiline ¶
func (*Text) SetOpacity ¶
func (*Text) SetSelectable ¶
func (*Text) SetSelection ¶
func (*Text) SetSelectionVisibleWhenUnfocused ¶
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 (*Text) SetTabular ¶
func (*Text) SetVerticalAlign ¶
func (t *Text) SetVerticalAlign(align VerticalAlign)
func (*Text) Value ¶
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 ¶
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 ¶
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) CommitWithCurrentInputValue ¶
func (t *TextInput) CommitWithCurrentInputValue()
func (*TextInput) ForceSetValue ¶
func (*TextInput) HasValue ¶
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 (*TextInput) Layout ¶
func (t *TextInput) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*TextInput) LineCount ¶
LineCount returns the number of logical lines in the value. See Text.LineCount for details.
func (*TextInput) LineIndexFromTextIndexInBytes ¶
LineIndexFromTextIndexInBytes returns the index of the logical line containing textIndexInBytes. See Text.LineIndexFromTextIndexInBytes for details.
func (*TextInput) LineStartInBytes ¶
LineStartInBytes returns the byte offset where the lineIndex-th logical line begins within the value. See Text.LineStartInBytes for details.
func (*TextInput) OnHandleButtonInput ¶
func (t *TextInput) OnHandleButtonInput(f func(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult)
func (*TextInput) OnValueChanged ¶
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 ¶
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) ReadValueFrom ¶
ReadValueFrom resets the value to the bytes read from r until EOF. See Text.ReadValueFrom for details.
func (*TextInput) ReplaceValueAtSelection ¶
func (*TextInput) SetAutoWrap ¶
func (*TextInput) SetCursorBlinking ¶
SetCursorBlinking sets whether the cursor blinks. The default value is true.
func (*TextInput) SetEditable ¶
func (*TextInput) SetError ¶
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 ¶
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) SetMultiline ¶
func (*TextInput) SetSelection ¶
func (*TextInput) SetSelectionVisibleWhenUnfocused ¶
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 ¶
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 (*TextInput) SetVerticalAlign ¶
func (t *TextInput) SetVerticalAlign(valign VerticalAlign)
func (*TextInput) SupportText ¶
SupportText returns the support text displayed below the text input.
func (*TextInput) Value ¶
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 ¶
WriteValueRangeTo writes the bytes of the current value in [startInBytes, endInBytes) to w. See Text.WriteValueRangeTo for details.
func (*TextInput) WriteValueTo ¶
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) HandlePointingInput ¶
func (t *Toggle) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
func (*Toggle) OnValueChanged ¶
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 VerticalAlign ¶
type VerticalAlign int
const ( VerticalAlignTop VerticalAlign = VerticalAlign(textutil.VerticalAlignTop) VerticalAlignMiddle VerticalAlign = VerticalAlign(textutil.VerticalAlignMiddle) VerticalAlignBottom VerticalAlign = VerticalAlign(textutil.VerticalAlignBottom) )
Source Files
¶
- abstractlist.go
- abstractnumberinput.go
- background.go
- button.go
- checkbox.go
- combobox.go
- contextmenuarea.go
- divider.go
- drawer.go
- expander.go
- face.go
- form.go
- image.go
- list.go
- menubar.go
- numberinput.go
- os_other.go
- panel.go
- popup.go
- popupmenu.go
- radiobutton.go
- resourceimage.go
- roundedcornerwidget.go
- scroll.go
- segmentedcontrol.go
- select.go
- size.go
- slider.go
- statekey.go
- table.go
- text.go
- textinput.go
- toggle.go
- tooltiparea.go
- util.go
- virtualscrollpanel.go