Documentation
¶
Overview ¶
Accessibility semantics for the widget tree: semantic roles plus a state snapshot that assistive technology can consume. This is the plain-Go layer only - how it reaches a screen reader is recorded in docs/a11y.md.
The CSS box model the styled widgets share: a margin box a container arranges, the border box the widget owns (its Bounds, hit area, and damage), and the content box its children or text fill — with padding, per-side borders, min sizes, and the background layers painted in GTK's order. Margins are self-applied: a widget measures its margin box and insets itself inside whatever rect its container hands it, so every container gets margins for free.
Damage tracking turns per-widget invalidation flags into the repaint rects one frame needs. Widgets mark themselves through Invalidate, InvalidateRect, and InvalidateLayout; CollectDamage drains the flags into a rect list the app clips painting to and sends as wl_surface.damage_buffer.
Debug plumbing shared by every widget: optional names plus the live tree snapshot the inspector's dump and overlay render. This is the always-available half of the inspector (see docs/inspector.md): the dump only reads state, so it ships in prod binaries; the app-level overlay and its keybindings live in internal/inspect and the app package, gated behind LYS_UI_INSPECT or an explicit opt-in.
Echo masking for Entry: password fields render one dot per rune while the contents, caret, click mapping, and selection stay logical. Because masking is one-to-one per rune, every display-space index is also the logical rune index, so nothing about the editing model changes — only the pixels do.
Input method support: the widget side of zwp_text_input_v3. Editable widgets show composing (preedit) text and receive committed text through IMEClient, and expose their caret state through IMETracker so the host can push surrounding text and the caret rectangle.
The CSS interaction surfaces (docs/css.md): cursor, pointer-events, user-select, caret-shape, accent-color, appearance, and touch-action — the computed values the input path and the painters read.
Rich-label markup: a strict allowlist subset of HTML parsed into styled runs. ParseMarkup is total - it never panics on any input - and anything outside the allowlist fails the parse, which callers handle by rendering the input literally (RichLabel does).
Subtree opacity: the embeddable state and the PushAlpha discipline around child paint. A fade today would mean threading an alpha factor through every widget color by hand; an Opacity-carrying widget pushes the factor onto the canvas instead (render.Canvas.PushAlpha), so every color its subtree produces — fills, borders, text, image blits — is modulated in one place, and nested carriers multiply.
Box shadows for floating surfaces. Menus, popovers, tooltips, toasts, and dialogs all read their elevation from here, so one theme knob (ShadowBlur, ShadowColor) restyles — or disables — every shadow at once, and the look never drifts per widget.
Two invariants hold everywhere:
- The shadow paints OUTSIDE the widget's logical bounds. Layout, hit-testing, and the bounds the damage collector sees are never widened by it: a point in the shadow gutter is not a hit, the one rule that keeps click-away dismissal and padding math honest.
- The pixels a shadow owes beyond the bounds are tracked as a damage ring (shadowTracker), invalidated only when the bounds move or the theme's shadow restyles — a hover twitch repaints the card, never the falloff.
The CSS layer (docs/css.md): classes, ids, states, and inline styles on the shared node; prioritized stylesheets with hot reload; and the per-widget computed style the render path reads where it reads Theme fields.
The data flow is one direction. AddStylesheet and LoadStylesheet parse once and install the layer; a style generation stamp goes stale everywhere at once. Each widget's cascade is computed lazily on first read after an invalidation — never per paint — and the diff against the previous values drives the smallest correct invalidation: repaint the widget, relayout it when a layout-affecting property moved, and mark the subtree when an inherited one (a custom property included) did. A state, class, or id flip restyles the widget alone unless a loaded selector reads that fact left of a combinator; then the subtree (and, for sibling selectors, the neighbors) restyle too. With no stylesheet loaded the cascade is empty, every consumer falls through to its theme-derived value, and the pixels are exactly the pre-CSS ones.
The edit history shared by the editable text widgets (Entry, TextArea): every content mutation records a before/after state pair on a bounded stack, consecutive typed runes coalesce into one entry GTK-style, and undo/redo restore snapshots exactly as the edits left them. routeKey reaches it through Undoer.
Package widget is lys-ui's retained-mode widget layer: a tree of widgets measured against constraints, arranged into pixel rects, and painted onto a render.Canvas. Input handling arrives in M4; HitTest is already here so event dispatch can hook into the same geometry.
API conventions ¶
Constructors are positional, in one fixed order: the font first, then the pixel size (sizePx, logical, when the widget paints text at a configurable size), then the widget's content and initial state, then colors. A nil face panics in the constructor with a message naming the argument (see requireFace) — it never fails later, deep in shaping.
Event hooks are exported function fields set after construction (Button.OnClick, Entry.OnChanged, Dropdown.OnSelect, ...), one per event, fired synchronously from whatever produced it. The Router methods and the handler interfaces they dispatch to (Clicker, KeyActionHandler, HoverSetter, ...) are input plumbing, not app hooks, and are not part of this convention.
State comes in getter/setter pairs with no Get prefix: Text and SetText, On and SetOn, Alignment and SetAlignment. Every Set* whose state is app-meaningful has a matching getter; the router-facing Set* methods (SetHovered, SetPressed, SetDragOver) are interface plumbing, not state API. Bounds returns the last arranged rect, and the zero rect before the first Arrange — a defined value, never a panic.
Every coordinate, size, and pixel parameter is logical pixels; the device scale is applied exactly once, at the buffer boundary in the app and render packages.
Index ¶
- Constants
- Variables
- func A11yGeneration() uint64
- func ActivateMnemonic(w Widget, sym xkb.Keysym) bool
- func ArrangeAsChild(w Widget, r render.Rect)
- func BackdropRegion(root Widget) []render.Rect
- func BackdropWalks() int
- func CSSCursorOf(w Widget) string
- func CascadeBorder(w Widget) render.Insets
- func CascadeColor(w Widget) render.Color
- func CollectDamage(root Widget) (rects []render.Rect, any bool)
- func CollectDamageInto(buf []render.Rect, root Widget) (rects []render.Rect, any bool)
- func CornerRadii(w Widget) render.Corners
- func CursorNameOf(w Widget) string
- func DamageArea(rects []render.Rect) int
- func DamageGeneration() uint64
- func DamageReport() string
- func DamageWalks() uint64
- func DefaultSwatches() []render.Color
- func DescendsFrom(w, ancestor Widget) bool
- func Detach(w Widget)
- func DeviceScaleOf(w Widget) (num, denom int)
- func DumpTree(root Widget, r *Router) string
- func DumpTreeTo(w io.Writer, root Widget, r *Router)
- func ErrorBell(w Widget)
- func FocusRingRect(w Widget) render.Rect
- func FocusVisible(w Widget) bool
- func FontFaceResolved()
- func FormatColor(c Color) string
- func GrabFocus(w Widget) error
- func HasClass(w Widget, class string) bool
- func Host(root Widget) (unhost func())
- func IconSearchPaths() []string
- func InkOutset(w Widget) render.Insets
- func InputRegionOf(root Widget) ([]render.Rect, bool)
- func IsEnabled(w Widget) bool
- func IsInteractive(w Widget) bool
- func IsVisible(w Widget) bool
- func LayoutPending(w Widget) bool
- func LoadStylesheet(css string)
- func LoadStylesheetFile(path string) error
- func MarkA11yChanged()
- func MarkLoop()
- func MeasureMissReport() string
- func MediaViewportOf(w Widget) (int, int)
- func OpenMenu(from Widget, anchor Boundser, face render.Font, sizePx float64, ...)
- func OpenPopover(from Widget, anchor Boundser, content Widget, opts PopoverOptions) (close func())
- func PaintBoxLayers(cv *render.Canvas, w Widget)
- func PaintChild(cv *render.Canvas, w Widget)
- func PaintFocusRing(cv *render.Canvas, w Widget)
- func PreloadThemeIcon(name string, size, num, denom int)
- func PseudoContent(w Widget, pseudo string) string
- func PseudoStyle(w Widget, pseudo string) *style.Values
- func RefreshIcons()
- func RevealRect(w Widget, r render.Rect)
- func RootFontSize() float64
- func SetAnimationsInstant(on bool) (restore func())
- func SetDeviceScale(root Widget, num, denom int)
- func SetErrorBell(fn func(w Widget))
- func SetFaceResolver(f func(family string, weight int) (render.Font, bool))
- func SetGPUHost(fn func(a *GPUArea) (GPUSurface, error))
- func SetIconNamespace(dir string, prefixes []string)
- func SetIconSearchPaths(paths []string)
- func SetInvoker(fn func(func())) (remove func())
- func SetMediaContrast(on bool)
- func SetMediaResolution(dpi float64)
- func SetMediaViewport(w, h int)
- func SetMediaViewportFor(root Widget, w, h int)
- func SetMessageCatalog(c Catalog)
- func SetOffLoopHook(hook func(what string))
- func SetParents(parent Widget, kids ...Widget)
- func SetParseWarn(f func(msg string))
- func SetReducedMotion(on bool)
- func SetRemovedHook(fn func(Widget))
- func SetRootFontSize(px float64)
- func SetStyleAnchor(w, anchor Widget)
- func SetStyleRoot(w Widget)
- func SetStylesheetWatcher(watch StylesheetWatcher)
- func SetSurfaceHost(root Widget, h SurfaceHost)
- func SetSurfaceOriginResolver(resolve func(root Widget) (Point, bool))
- func SetTheme(t *Theme)
- func SharedMorphPending(tree Widget) bool
- func ShownRect(w Widget) render.Rect
- func StopAssetLoads()
- func StyleBackground(w Widget) render.Color
- func StylesBackground(w Widget) bool
- func ThemeIconExists(name string) bool
- func ThemeIconPreloaded(name string, size, num, denom int) bool
- func Tr(s string) string
- func TrCtx(ctx, s string) string
- func TrN(singular, plural string, n int) string
- func TreeCell[T any](tree *FlatTree[T], sizePx float64, cell func(T) Widget) func(FlatRow[T]) Widget
- func UnmarkLoop()
- func WaitAssetLoads()
- func WantsExpand(w Widget, axis Axis) bool
- type A11yState
- type Accordion
- func (a *Accordion) Append(it *AccordionItem)
- func (c *Accordion) Arrange(r render.Rect)
- func (c *Accordion) Baseline() (int, bool)
- func (c *Accordion) Children() []Widget
- func (c *Accordion) HitTest(p Point) Widget
- func (a *Accordion) Items() []*AccordionItem
- func (c *Accordion) Measure(axis Axis, forSize int) Sizes
- func (a *Accordion) NavigateFocus(target Widget, k KeyAction) Widget
- func (c *Accordion) Paint(cv *render.Canvas)
- func (a *Accordion) SetCollapsible(on bool)
- type AccordionItem
- func (c *AccordionItem) Arrange(r render.Rect)
- func (c *AccordionItem) Baseline() (int, bool)
- func (c *AccordionItem) Children() []Widget
- func (c *AccordionItem) HitTest(p Point) Widget
- func (c *AccordionItem) Measure(axis Axis, forSize int) Sizes
- func (it *AccordionItem) Open() bool
- func (c *AccordionItem) Paint(cv *render.Canvas)
- func (it *AccordionItem) SetOpen(open bool)
- func (it *AccordionItem) SetTitle(s string)
- func (it *AccordionItem) Title() string
- type AccordionMode
- type Action
- type ActionBar
- func (c *ActionBar) Arrange(r render.Rect)
- func (c *ActionBar) Baseline() (int, bool)
- func (c *ActionBar) Children() []Widget
- func (c *ActionBar) HitTest(p Point) Widget
- func (c *ActionBar) Measure(axis Axis, forSize int) Sizes
- func (p *ActionBar) PackEnd(w Widget)
- func (p *ActionBar) PackStart(w Widget)
- func (c *ActionBar) Paint(cv *render.Canvas)
- type ActionRow
- func (r *ActionRow) Activatable() bool
- func (c *ActionRow) Arrange(r render.Rect)
- func (c *ActionRow) Baseline() (int, bool)
- func (c *ActionRow) Children() []Widget
- func (r *ActionRow) ClickAt(p Point)
- func (r *ActionRow) Direction() Direction
- func (c *ActionRow) HitTest(p Point) Widget
- func (r *ActionRow) KeyAction(a KeyAction, mods Mods)
- func (c *ActionRow) Measure(axis Axis, forSize int) Sizes
- func (p *ActionRow) PackEnd(w Widget)
- func (p *ActionRow) PackStart(w Widget)
- func (r *ActionRow) Paint(cv *render.Canvas)
- func (r *ActionRow) Revealed() bool
- func (r *ActionRow) Selected() bool
- func (r *ActionRow) SetActivatable(on bool)
- func (r *ActionRow) SetDirection(d Direction)
- func (r *ActionRow) SetDisclosure(w Widget)
- func (r *ActionRow) SetPressed(on bool)
- func (r *ActionRow) SetRevealed(on bool)
- func (r *ActionRow) SetSearchable(on bool)
- func (r *ActionRow) SetSelected(on bool)
- func (r *ActionRow) SetSubtitle(s string)
- func (r *ActionRow) SetTitle(t string)
- func (r *ActionRow) ShowChevron(on bool)
- func (r *ActionRow) Subtitle() string
- func (r *ActionRow) Title() string
- type Activatable
- type Adjustable
- type Alert
- func (c *Alert) Arrange(r render.Rect)
- func (c *Alert) Baseline() (int, bool)
- func (c *Alert) Children() []Widget
- func (a *Alert) Description() string
- func (c *Alert) HitTest(p Point) Widget
- func (c *Alert) Measure(axis Axis, forSize int) Sizes
- func (c *Alert) Paint(cv *render.Canvas)
- func (a *Alert) Role() Role
- func (a *Alert) SetDescription(s string)
- func (a *Alert) SetIcon(w Widget)
- func (a *Alert) SetTitle(s string)
- func (a *Alert) SetVariant(v AlertVariant)
- func (a *Alert) Title() string
- func (a *Alert) Variant() AlertVariant
- type AlertVariant
- type Align
- type AspectFrame
- func (a *AspectFrame) Arrange(r render.Rect)
- func (c *AspectFrame) Baseline() (int, bool)
- func (c *AspectFrame) Children() []Widget
- func (c *AspectFrame) HitTest(p Point) Widget
- func (a *AspectFrame) Measure(axis Axis, forSize int) Sizes
- func (c *AspectFrame) Paint(cv *render.Canvas)
- func (a *AspectFrame) Ratio() float64
- func (a *AspectFrame) SetRatio(r float64)
- type Avatar
- func (n *Avatar) AccessibleName() string
- func (n *Avatar) AddClass(names ...string)
- func (a *Avatar) Arrange(r render.Rect)
- func (n *Avatar) AttachStylesheet(s *Stylesheet)
- func (n *Avatar) Attr(name string) (string, bool)
- func (n *Avatar) Bounds() render.Rect
- func (n *Avatar) Classes() []string
- func (n *Avatar) DebugName() string
- func (n *Avatar) DetachStylesheet(s *Stylesheet)
- func (n *Avatar) Element() string
- func (n *Avatar) Enabled() bool
- func (n *Avatar) HAlign() Align
- func (n *Avatar) HasClass(name string) bool
- func (n *Avatar) HasState(flags StateFlags) bool
- func (n *Avatar) HitLeaf(self Widget, p Point) Widget
- func (a *Avatar) HitTest(p Point) Widget
- func (n *Avatar) HoverWithin() bool
- func (n *Avatar) ID() string
- func (a *Avatar) Initials() string
- func (n *Avatar) InlineStyle() string
- func (n *Avatar) Invalidate()
- func (n *Avatar) InvalidateLayout()
- func (n *Avatar) InvalidateRect(r render.Rect)
- func (n *Avatar) LayoutMotion() LayoutMotion
- func (n *Avatar) Margin() render.Insets
- func (n *Avatar) MaximumSize() Size
- func (a *Avatar) Measure(axis Axis, forSize int) Sizes
- func (a *Avatar) Paint(cv *render.Canvas)
- func (n *Avatar) Parent() Widget
- func (n *Avatar) RemoveAttr(name string)
- func (n *Avatar) RemoveClass(names ...string)
- func (n *Avatar) SetAccessibleName(name string)
- func (n *Avatar) SetAttr(name, value string)
- func (n *Avatar) SetClass(name string, on bool)
- func (n *Avatar) SetClasses(names ...string)
- func (n *Avatar) SetCursorName(s string)
- func (n *Avatar) SetDebugName(name string)
- func (n *Avatar) SetElement(name string)
- func (n *Avatar) SetEnabled(enabled bool)
- func (n *Avatar) SetFocusOnClick(on bool)
- func (n *Avatar) SetHAlign(a Align)
- func (n *Avatar) SetHExpand(on bool)
- func (n *Avatar) SetID(id string)
- func (a *Avatar) SetImage(img image.Image)
- func (n *Avatar) SetInlineStyle(css string)
- func (n *Avatar) SetInlineStylePriority(css string, priority int)
- func (n *Avatar) SetLayoutMotion(m LayoutMotion)
- func (n *Avatar) SetMargin(m render.Insets)
- func (n *Avatar) SetMaximumSize(w, h int)
- func (a *Avatar) SetName(name string)
- func (n *Avatar) SetOnClickWithin(fn func())
- func (n *Avatar) SetOnFocusChanged(fn func(focused bool))
- func (n *Avatar) SetOnHoverWithin(fn func(on bool))
- func (n *Avatar) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Avatar) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Avatar) SetSharedElement(tag string)
- func (n *Avatar) SetSizeRequest(w, h int)
- func (n *Avatar) SetState(flags StateFlags, on bool)
- func (n *Avatar) SetTooltip(s string)
- func (n *Avatar) SetTooltipMarkup(markup string)
- func (n *Avatar) SetVAlign(a Align)
- func (n *Avatar) SetVExpand(on bool)
- func (n *Avatar) SetVisible(visible bool)
- func (n *Avatar) SharedElement() string
- func (n *Avatar) SizeRequest() Size
- func (n *Avatar) TooltipMarkup() (string, bool)
- func (n *Avatar) TooltipText() string
- func (n *Avatar) VAlign() Align
- func (n *Avatar) Visible() bool
- type Axis
- type BackdropRegioner
- type Badge
- func (c *Badge) Arrange(r render.Rect)
- func (c *Badge) Baseline() (int, bool)
- func (c *Badge) Children() []Widget
- func (c *Badge) HitTest(p Point) Widget
- func (c *Badge) Measure(axis Axis, forSize int) Sizes
- func (c *Badge) Paint(cv *render.Canvas)
- func (b *Badge) SetIcon(w Widget)
- func (b *Badge) SetText(text string)
- func (b *Badge) SetVariant(v BadgeVariant)
- func (b *Badge) Text() string
- func (b *Badge) Variant() BadgeVariant
- type BadgeVariant
- type Banner
- func (c *Banner) Arrange(r render.Rect)
- func (c *Banner) Baseline() (int, bool)
- func (c *Banner) Children() []Widget
- func (c *Banner) HitTest(p Point) Widget
- func (c *Banner) Measure(axis Axis, forSize int) Sizes
- func (c *Banner) Paint(cv *render.Canvas)
- func (b *Banner) Revealed() bool
- func (b *Banner) SetRevealed(on bool)
- func (b *Banner) SetTitle(s string)
- type Bar
- func (c *Bar) Arrange(r render.Rect)
- func (c *Bar) Baseline() (int, bool)
- func (b *Bar) Center() *Box
- func (c *Bar) Children() []Widget
- func (b *Bar) Edge() BarEdge
- func (b *Bar) End() *Box
- func (c *Bar) HitTest(p Point) Widget
- func (c *Bar) Measure(axis Axis, forSize int) Sizes
- func (c *Bar) Paint(cv *render.Canvas)
- func (b *Bar) SetEdge(edge BarEdge)
- func (b *Bar) Start() *Box
- type BarButton
- func (n *BarButton) AccessibleName() string
- func (n *BarButton) AddClass(names ...string)
- func (b *BarButton) Arrange(r render.Rect)
- func (n *BarButton) AttachStylesheet(s *Stylesheet)
- func (n *BarButton) Attr(name string) (string, bool)
- func (n *BarButton) Bounds() render.Rect
- func (n *BarButton) Classes() []string
- func (n *BarButton) DebugName() string
- func (n *BarButton) DetachStylesheet(s *Stylesheet)
- func (n *BarButton) Element() string
- func (n *BarButton) Enabled() bool
- func (n *BarButton) HAlign() Align
- func (n *BarButton) HasClass(name string) bool
- func (n *BarButton) HasState(flags StateFlags) bool
- func (n *BarButton) HitLeaf(self Widget, p Point) Widget
- func (n *BarButton) HoverWithin() bool
- func (n *BarButton) ID() string
- func (n *BarButton) InlineStyle() string
- func (n *BarButton) Invalidate()
- func (n *BarButton) InvalidateLayout()
- func (n *BarButton) InvalidateRect(r render.Rect)
- func (b *BarButton) Label() *Label
- func (n *BarButton) LayoutMotion() LayoutMotion
- func (n *BarButton) Margin() render.Insets
- func (n *BarButton) MaximumSize() Size
- func (n *BarButton) Parent() Widget
- func (n *BarButton) RemoveAttr(name string)
- func (n *BarButton) RemoveClass(names ...string)
- func (n *BarButton) SetAccessibleName(name string)
- func (n *BarButton) SetAttr(name, value string)
- func (b *BarButton) SetBadge(text string)
- func (n *BarButton) SetClass(name string, on bool)
- func (n *BarButton) SetClasses(names ...string)
- func (n *BarButton) SetCursorName(s string)
- func (n *BarButton) SetDebugName(name string)
- func (n *BarButton) SetElement(name string)
- func (n *BarButton) SetEnabled(enabled bool)
- func (n *BarButton) SetFocusOnClick(on bool)
- func (n *BarButton) SetHAlign(a Align)
- func (n *BarButton) SetHExpand(on bool)
- func (n *BarButton) SetID(id string)
- func (b *BarButton) SetIcon(w Widget)
- func (b *BarButton) SetIconPosition(p IconPosition)
- func (n *BarButton) SetInlineStyle(css string)
- func (n *BarButton) SetInlineStylePriority(css string, priority int)
- func (b *BarButton) SetLabel(s string)
- func (n *BarButton) SetLayoutMotion(m LayoutMotion)
- func (n *BarButton) SetMargin(m render.Insets)
- func (n *BarButton) SetMaximumSize(w, h int)
- func (n *BarButton) SetOnClickWithin(fn func())
- func (n *BarButton) SetOnFocusChanged(fn func(focused bool))
- func (n *BarButton) SetOnHoverWithin(fn func(on bool))
- func (n *BarButton) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *BarButton) SetOnScroll(fn func(e ScrollEvent) bool)
- func (b *BarButton) SetPopover(build func() Widget)
- func (n *BarButton) SetSharedElement(tag string)
- func (n *BarButton) SetSizeRequest(w, h int)
- func (n *BarButton) SetState(flags StateFlags, on bool)
- func (n *BarButton) SetTooltip(s string)
- func (n *BarButton) SetTooltipMarkup(markup string)
- func (n *BarButton) SetVAlign(a Align)
- func (n *BarButton) SetVExpand(on bool)
- func (n *BarButton) SetVisible(visible bool)
- func (n *BarButton) SharedElement() string
- func (n *BarButton) SizeRequest() Size
- func (n *BarButton) TooltipMarkup() (string, bool)
- func (n *BarButton) TooltipText() string
- func (n *BarButton) VAlign() Align
- func (n *BarButton) Visible() bool
- type BarEdge
- type BarSeparator
- func (n *BarSeparator) AccessibleName() string
- func (n *BarSeparator) AddClass(names ...string)
- func (n *BarSeparator) Arrange(r render.Rect)
- func (n *BarSeparator) AttachStylesheet(s *Stylesheet)
- func (n *BarSeparator) Attr(name string) (string, bool)
- func (n *BarSeparator) Bounds() render.Rect
- func (n *BarSeparator) Classes() []string
- func (n *BarSeparator) DebugName() string
- func (n *BarSeparator) DetachStylesheet(s *Stylesheet)
- func (n *BarSeparator) Element() string
- func (n *BarSeparator) Enabled() bool
- func (n *BarSeparator) HAlign() Align
- func (n *BarSeparator) HasClass(name string) bool
- func (n *BarSeparator) HasState(flags StateFlags) bool
- func (n *BarSeparator) HitLeaf(self Widget, p Point) Widget
- func (n *BarSeparator) HoverWithin() bool
- func (n *BarSeparator) ID() string
- func (n *BarSeparator) InlineStyle() string
- func (n *BarSeparator) Invalidate()
- func (n *BarSeparator) InvalidateLayout()
- func (n *BarSeparator) InvalidateRect(r render.Rect)
- func (n *BarSeparator) LayoutMotion() LayoutMotion
- func (n *BarSeparator) Margin() render.Insets
- func (n *BarSeparator) MaximumSize() Size
- func (s *BarSeparator) Measure(axis Axis, forSize int) Sizes
- func (s *BarSeparator) Paint(cv *render.Canvas)
- func (n *BarSeparator) Parent() Widget
- func (n *BarSeparator) RemoveAttr(name string)
- func (n *BarSeparator) RemoveClass(names ...string)
- func (n *BarSeparator) SetAccessibleName(name string)
- func (n *BarSeparator) SetAttr(name, value string)
- func (n *BarSeparator) SetClass(name string, on bool)
- func (n *BarSeparator) SetClasses(names ...string)
- func (n *BarSeparator) SetCursorName(s string)
- func (n *BarSeparator) SetDebugName(name string)
- func (n *BarSeparator) SetElement(name string)
- func (n *BarSeparator) SetEnabled(enabled bool)
- func (n *BarSeparator) SetFocusOnClick(on bool)
- func (n *BarSeparator) SetHAlign(a Align)
- func (n *BarSeparator) SetHExpand(on bool)
- func (n *BarSeparator) SetID(id string)
- func (n *BarSeparator) SetInlineStyle(css string)
- func (n *BarSeparator) SetInlineStylePriority(css string, priority int)
- func (n *BarSeparator) SetLayoutMotion(m LayoutMotion)
- func (n *BarSeparator) SetMargin(m render.Insets)
- func (n *BarSeparator) SetMaximumSize(w, h int)
- func (n *BarSeparator) SetOnClickWithin(fn func())
- func (n *BarSeparator) SetOnFocusChanged(fn func(focused bool))
- func (n *BarSeparator) SetOnHoverWithin(fn func(on bool))
- func (n *BarSeparator) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *BarSeparator) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *BarSeparator) SetSharedElement(tag string)
- func (n *BarSeparator) SetSizeRequest(w, h int)
- func (n *BarSeparator) SetState(flags StateFlags, on bool)
- func (n *BarSeparator) SetTooltip(s string)
- func (n *BarSeparator) SetTooltipMarkup(markup string)
- func (n *BarSeparator) SetVAlign(a Align)
- func (n *BarSeparator) SetVExpand(on bool)
- func (n *BarSeparator) SetVisible(visible bool)
- func (n *BarSeparator) SharedElement() string
- func (n *BarSeparator) SizeRequest() Size
- func (n *BarSeparator) TooltipMarkup() (string, bool)
- func (n *BarSeparator) TooltipText() string
- func (n *BarSeparator) VAlign() Align
- func (n *BarSeparator) Visible() bool
- type Base
- func (n *Base) AccessibleName() string
- func (n *Base) AddClass(names ...string)
- func (n *Base) Arrange(r render.Rect)
- func (b *Base) ArrangeSelf(r render.Rect)
- func (n *Base) AttachStylesheet(s *Stylesheet)
- func (n *Base) Attr(name string) (string, bool)
- func (n *Base) Bounds() render.Rect
- func (n *Base) Classes() []string
- func (n *Base) DebugName() string
- func (n *Base) DetachStylesheet(s *Stylesheet)
- func (n *Base) Element() string
- func (n *Base) Enabled() bool
- func (n *Base) HAlign() Align
- func (n *Base) HasClass(name string) bool
- func (n *Base) HasState(flags StateFlags) bool
- func (n *Base) HitLeaf(self Widget, p Point) Widget
- func (n *Base) HoverWithin() bool
- func (n *Base) ID() string
- func (n *Base) InlineStyle() string
- func (n *Base) Invalidate()
- func (n *Base) InvalidateLayout()
- func (n *Base) InvalidateRect(r render.Rect)
- func (n *Base) LayoutMotion() LayoutMotion
- func (n *Base) Margin() render.Insets
- func (n *Base) MaximumSize() Size
- func (n *Base) Parent() Widget
- func (n *Base) RemoveAttr(name string)
- func (n *Base) RemoveClass(names ...string)
- func (n *Base) SetAccessibleName(name string)
- func (n *Base) SetAttr(name, value string)
- func (n *Base) SetClass(name string, on bool)
- func (n *Base) SetClasses(names ...string)
- func (n *Base) SetCursorName(s string)
- func (n *Base) SetDebugName(name string)
- func (n *Base) SetElement(name string)
- func (n *Base) SetEnabled(enabled bool)
- func (n *Base) SetFocusOnClick(on bool)
- func (n *Base) SetHAlign(a Align)
- func (n *Base) SetHExpand(on bool)
- func (n *Base) SetID(id string)
- func (n *Base) SetInlineStyle(css string)
- func (n *Base) SetInlineStylePriority(css string, priority int)
- func (n *Base) SetLayoutMotion(m LayoutMotion)
- func (n *Base) SetMargin(m render.Insets)
- func (n *Base) SetMaximumSize(w, h int)
- func (n *Base) SetOnClickWithin(fn func())
- func (n *Base) SetOnFocusChanged(fn func(focused bool))
- func (n *Base) SetOnHoverWithin(fn func(on bool))
- func (n *Base) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Base) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Base) SetSharedElement(tag string)
- func (n *Base) SetSizeRequest(w, h int)
- func (n *Base) SetState(flags StateFlags, on bool)
- func (n *Base) SetTooltip(s string)
- func (n *Base) SetTooltipMarkup(markup string)
- func (n *Base) SetVAlign(a Align)
- func (n *Base) SetVExpand(on bool)
- func (n *Base) SetVisible(visible bool)
- func (n *Base) SharedElement() string
- func (n *Base) SizeRequest() Size
- func (n *Base) TooltipMarkup() (string, bool)
- func (n *Base) TooltipText() string
- func (n *Base) VAlign() Align
- func (n *Base) Visible() bool
- type Baseliner
- type Binding
- type Boundser
- type Box
- func NewBox(axis Axis, spacing, padding int) *Box
- func NewBulletList(face render.Font, sizePx float64, items ...string) *Box
- func NewFieldGroup() *Box
- func NewKbdGroup(face render.Font, keys ...string) *Box
- func NewShortcutLabel(face render.Font, keys string) *Box
- func NewSkeleton(width, height int) *Box
- func NewTooltipCard(face render.Font, text string, markup bool) *Box
- func (n *Box) AccessibleName() string
- func (n *Box) AddClass(names ...string)
- func (b *Box) Append(w Widget, expand bool) *Box
- func (b *Box) AppendAligned(w Widget, expand bool, cross Align) *Box
- func (b *Box) Arrange(r render.Rect)
- func (b *Box) ArrangeRoot(r render.Rect)
- func (n *Box) AttachStylesheet(s *Stylesheet)
- func (n *Box) Attr(name string) (string, bool)
- func (b *Box) Axis() Axis
- func (b *Box) Baseline() (int, bool)
- func (n *Box) Bounds() render.Rect
- func (b *Box) Children() []Widget
- func (n *Box) Classes() []string
- func (b *Box) Clear()
- func (n *Box) DebugName() string
- func (n *Box) DetachStylesheet(s *Stylesheet)
- func (b *Box) Direction() Direction
- func (n *Box) Element() string
- func (n *Box) Enabled() bool
- func (n *Box) HAlign() Align
- func (n *Box) HasClass(name string) bool
- func (n *Box) HasState(flags StateFlags) bool
- func (n *Box) HitLeaf(self Widget, p Point) Widget
- func (b *Box) HitTest(p Point) Widget
- func (b *Box) Homogeneous() bool
- func (n *Box) HoverWithin() bool
- func (n *Box) ID() string
- func (n *Box) InlineStyle() string
- func (b *Box) InsertAligned(i int, w Widget, expand bool, cross Align)
- func (b *Box) InsertAt(i int, w Widget, expand bool)
- func (n *Box) Invalidate()
- func (n *Box) InvalidateLayout()
- func (n *Box) InvalidateRect(r render.Rect)
- func (n *Box) LayoutMotion() LayoutMotion
- func (n *Box) Margin() render.Insets
- func (n *Box) MaximumSize() Size
- func (b *Box) Measure(axis Axis, forSize int) Sizes
- func (b *Box) Move(from, to int)
- func (b *Box) Padding() render.Insets
- func (b *Box) Paint(cv *render.Canvas)
- func (n *Box) Parent() Widget
- func (b *Box) Remove(w Widget) bool
- func (b *Box) RemoveAt(i int)
- func (n *Box) RemoveAttr(name string)
- func (n *Box) RemoveClass(names ...string)
- func (n *Box) SetAccessibleName(name string)
- func (n *Box) SetAttr(name, value string)
- func (b *Box) SetAxis(a Axis)
- func (n *Box) SetClass(name string, on bool)
- func (n *Box) SetClasses(names ...string)
- func (n *Box) SetCursorName(s string)
- func (n *Box) SetDebugName(name string)
- func (b *Box) SetDirection(d Direction)
- func (n *Box) SetElement(name string)
- func (b *Box) SetEnabled(enabled bool)
- func (n *Box) SetFocusOnClick(on bool)
- func (n *Box) SetHAlign(a Align)
- func (n *Box) SetHExpand(on bool)
- func (b *Box) SetHomogeneous(on bool)
- func (n *Box) SetID(id string)
- func (n *Box) SetInlineStyle(css string)
- func (n *Box) SetInlineStylePriority(css string, priority int)
- func (n *Box) SetLayoutMotion(m LayoutMotion)
- func (n *Box) SetMargin(m render.Insets)
- func (n *Box) SetMaximumSize(w, h int)
- func (n *Box) SetOnClickWithin(fn func())
- func (n *Box) SetOnFocusChanged(fn func(focused bool))
- func (n *Box) SetOnHoverWithin(fn func(on bool))
- func (n *Box) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Box) SetOnScroll(fn func(e ScrollEvent) bool)
- func (b *Box) SetPadding(p render.Insets)
- func (n *Box) SetSharedElement(tag string)
- func (n *Box) SetSizeRequest(w, h int)
- func (b *Box) SetSpacing(spacing int)
- func (n *Box) SetState(flags StateFlags, on bool)
- func (n *Box) SetTooltip(s string)
- func (n *Box) SetTooltipMarkup(markup string)
- func (n *Box) SetVAlign(a Align)
- func (n *Box) SetVExpand(on bool)
- func (n *Box) SetVisible(visible bool)
- func (n *Box) SharedElement() string
- func (n *Box) SizeRequest() Size
- func (b *Box) Spacing() int
- func (n *Box) TooltipMarkup() (string, bool)
- func (n *Box) TooltipText() string
- func (n *Box) VAlign() Align
- func (n *Box) Visible() bool
- type Breadcrumb
- func (c *Breadcrumb) Arrange(r render.Rect)
- func (c *Breadcrumb) Baseline() (int, bool)
- func (c *Breadcrumb) Children() []Widget
- func (c *Breadcrumb) HitTest(p Point) Widget
- func (c *Breadcrumb) Measure(axis Axis, forSize int) Sizes
- func (c *Breadcrumb) Paint(cv *render.Canvas)
- func (b *Breadcrumb) Path() []string
- func (b *Breadcrumb) SetMaxItems(n int)
- func (b *Breadcrumb) SetPath(path ...string)
- type Breakpoint
- type BreakpointBin
- func (b *BreakpointBin) Add(bp Breakpoint)
- func (b *BreakpointBin) Arrange(r render.Rect)
- func (c *BreakpointBin) Baseline() (int, bool)
- func (c *BreakpointBin) Children() []Widget
- func (c *BreakpointBin) HitTest(p Point) Widget
- func (c *BreakpointBin) Measure(axis Axis, forSize int) Sizes
- func (c *BreakpointBin) Paint(cv *render.Canvas)
- func (b *BreakpointBin) Width() int
- type Button
- func (n *Button) AccessibleName() string
- func (n *Button) AddClass(names ...string)
- func (b *Button) Arrange(r render.Rect)
- func (b *Button) ArrangeRoot(r render.Rect)
- func (n *Button) AttachStylesheet(s *Stylesheet)
- func (n *Button) Attr(name string) (string, bool)
- func (b *Button) Baseline() (int, bool)
- func (b *Button) BindAction(a Activatable) (unbind func())
- func (n *Button) Bounds() render.Rect
- func (b *Button) Children() []Widget
- func (n *Button) Classes() []string
- func (b *Button) ClickAt(p Point)
- func (n *Button) DebugName() string
- func (n *Button) DetachStylesheet(s *Stylesheet)
- func (n *Button) Element() string
- func (n *Button) Enabled() bool
- func (n *Button) HAlign() Align
- func (n *Button) HasClass(name string) bool
- func (n *Button) HasState(flags StateFlags) bool
- func (n *Button) HitLeaf(self Widget, p Point) Widget
- func (b *Button) HitTest(p Point) Widget
- func (n *Button) HoverWithin() bool
- func (n *Button) ID() string
- func (n *Button) InlineStyle() string
- func (b *Button) InsertRune(r rune)
- func (n *Button) Invalidate()
- func (n *Button) InvalidateLayout()
- func (n *Button) InvalidateRect(r render.Rect)
- func (b *Button) KeyAction(a KeyAction, _ Mods)
- func (n *Button) LayoutMotion() LayoutMotion
- func (n *Button) Margin() render.Insets
- func (n *Button) MaximumSize() Size
- func (b *Button) Measure(axis Axis, forSize int) Sizes
- func (b *Button) Paint(cv *render.Canvas)
- func (n *Button) Parent() Widget
- func (n *Button) RemoveAttr(name string)
- func (n *Button) RemoveClass(names ...string)
- func (b *Button) Role() Role
- func (n *Button) SetAccessibleName(name string)
- func (n *Button) SetAttr(name, value string)
- func (n *Button) SetClass(name string, on bool)
- func (n *Button) SetClasses(names ...string)
- func (n *Button) SetCursorName(s string)
- func (n *Button) SetDebugName(name string)
- func (n *Button) SetElement(name string)
- func (n *Button) SetEnabled(enabled bool)
- func (n *Button) SetFocusOnClick(on bool)
- func (n *Button) SetHAlign(a Align)
- func (n *Button) SetHExpand(on bool)
- func (b *Button) SetHovered(on bool)
- func (n *Button) SetID(id string)
- func (n *Button) SetInlineStyle(css string)
- func (n *Button) SetInlineStylePriority(css string, priority int)
- func (n *Button) SetLayoutMotion(m LayoutMotion)
- func (n *Button) SetMargin(m render.Insets)
- func (n *Button) SetMaximumSize(w, h int)
- func (n *Button) SetOnClickWithin(fn func())
- func (n *Button) SetOnFocusChanged(fn func(focused bool))
- func (n *Button) SetOnHoverWithin(fn func(on bool))
- func (n *Button) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Button) SetOnScroll(fn func(e ScrollEvent) bool)
- func (b *Button) SetPressed(on bool)
- func (n *Button) SetSharedElement(tag string)
- func (n *Button) SetSizeRequest(w, h int)
- func (n *Button) SetState(flags StateFlags, on bool)
- func (n *Button) SetTooltip(s string)
- func (n *Button) SetTooltipMarkup(markup string)
- func (n *Button) SetVAlign(a Align)
- func (n *Button) SetVExpand(on bool)
- func (n *Button) SetVisible(visible bool)
- func (n *Button) SharedElement() string
- func (n *Button) SizeRequest() Size
- func (n *Button) TooltipMarkup() (string, bool)
- func (n *Button) TooltipText() string
- func (n *Button) VAlign() Align
- func (n *Button) Visible() bool
- type ButtonContent
- func (c *ButtonContent) Arrange(r render.Rect)
- func (c *ButtonContent) Baseline() (int, bool)
- func (c *ButtonContent) Children() []Widget
- func (c *ButtonContent) HitTest(p Point) Widget
- func (c *ButtonContent) Measure(axis Axis, forSize int) Sizes
- func (c *ButtonContent) Paint(cv *render.Canvas)
- func (c *ButtonContent) SetIconName(name string)
- func (c *ButtonContent) SetLabel(s string)
- type ButtonGroup
- func (g *ButtonGroup) Append(w Widget)
- func (c *ButtonGroup) Arrange(r render.Rect)
- func (c *ButtonGroup) Baseline() (int, bool)
- func (c *ButtonGroup) Children() []Widget
- func (c *ButtonGroup) HitTest(p Point) Widget
- func (c *ButtonGroup) Measure(axis Axis, forSize int) Sizes
- func (c *ButtonGroup) Paint(cv *render.Canvas)
- func (g *ButtonGroup) SetVertical(on bool)
- type ButtonRow
- type Calendar
- func (n *Calendar) AccessibleName() string
- func (n *Calendar) AddClass(names ...string)
- func (c *Calendar) Arrange(r render.Rect)
- func (n *Calendar) AttachStylesheet(s *Stylesheet)
- func (n *Calendar) Attr(name string) (string, bool)
- func (n *Calendar) Bounds() render.Rect
- func (c *Calendar) Children() []Widget
- func (n *Calendar) Classes() []string
- func (c *Calendar) ClearMarks()
- func (c *Calendar) ClickAt(p Point)
- func (c *Calendar) DayMarked(d Date) bool
- func (n *Calendar) DebugName() string
- func (n *Calendar) DetachStylesheet(s *Stylesheet)
- func (n *Calendar) Element() string
- func (n *Calendar) Enabled() bool
- func (n *Calendar) HAlign() Align
- func (n *Calendar) HasClass(name string) bool
- func (n *Calendar) HasState(flags StateFlags) bool
- func (n *Calendar) HitLeaf(self Widget, p Point) Widget
- func (c *Calendar) HitTest(p Point) Widget
- func (c *Calendar) HoverMove(p Point)
- func (n *Calendar) HoverWithin() bool
- func (n *Calendar) ID() string
- func (n *Calendar) InlineStyle() string
- func (n *Calendar) Invalidate()
- func (n *Calendar) InvalidateLayout()
- func (n *Calendar) InvalidateRect(r render.Rect)
- func (c *Calendar) KeyAction(a KeyAction, mods Mods)
- func (n *Calendar) LayoutMotion() LayoutMotion
- func (n *Calendar) Margin() render.Insets
- func (c *Calendar) MarkDay(d Date)
- func (n *Calendar) MaximumSize() Size
- func (c *Calendar) Measure(axis Axis, forSize int) Sizes
- func (c *Calendar) Mode() CalendarMode
- func (c *Calendar) Paint(cv *render.Canvas)
- func (n *Calendar) Parent() Widget
- func (c *Calendar) Range() (from, to Date)
- func (n *Calendar) RemoveAttr(name string)
- func (n *Calendar) RemoveClass(names ...string)
- func (c *Calendar) Role() Role
- func (c *Calendar) Select(d Date)
- func (c *Calendar) Selection() Date
- func (n *Calendar) SetAccessibleName(name string)
- func (n *Calendar) SetAttr(name, value string)
- func (n *Calendar) SetClass(name string, on bool)
- func (n *Calendar) SetClasses(names ...string)
- func (n *Calendar) SetCursorName(s string)
- func (n *Calendar) SetDebugName(name string)
- func (n *Calendar) SetElement(name string)
- func (n *Calendar) SetEnabled(enabled bool)
- func (c *Calendar) SetFirstWeekday(day time.Weekday)
- func (n *Calendar) SetFocusOnClick(on bool)
- func (n *Calendar) SetHAlign(a Align)
- func (n *Calendar) SetHExpand(on bool)
- func (c *Calendar) SetHovered(on bool)
- func (n *Calendar) SetID(id string)
- func (n *Calendar) SetInlineStyle(css string)
- func (n *Calendar) SetInlineStylePriority(css string, priority int)
- func (n *Calendar) SetLayoutMotion(m LayoutMotion)
- func (n *Calendar) SetMargin(m render.Insets)
- func (n *Calendar) SetMaximumSize(w, h int)
- func (c *Calendar) SetMode(m CalendarMode)
- func (c *Calendar) SetMonths(n int)
- func (c *Calendar) SetNames(names CalendarNames)
- func (n *Calendar) SetOnClickWithin(fn func())
- func (n *Calendar) SetOnFocusChanged(fn func(focused bool))
- func (n *Calendar) SetOnHoverWithin(fn func(on bool))
- func (n *Calendar) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Calendar) SetOnScroll(fn func(e ScrollEvent) bool)
- func (c *Calendar) SetRange(from, to Date)
- func (n *Calendar) SetSharedElement(tag string)
- func (n *Calendar) SetSizeRequest(w, h int)
- func (n *Calendar) SetState(flags StateFlags, on bool)
- func (c *Calendar) SetToday(d Date)
- func (n *Calendar) SetTooltip(s string)
- func (n *Calendar) SetTooltipMarkup(markup string)
- func (n *Calendar) SetVAlign(a Align)
- func (n *Calendar) SetVExpand(on bool)
- func (n *Calendar) SetVisible(visible bool)
- func (c *Calendar) SetWeekend(days ...time.Weekday)
- func (n *Calendar) SharedElement() string
- func (c *Calendar) ShowMonth(d Date)
- func (c *Calendar) Shown() Date
- func (n *Calendar) SizeRequest() Size
- func (c *Calendar) TooltipAnchor() render.Rect
- func (n *Calendar) TooltipMarkup() (string, bool)
- func (c *Calendar) TooltipText() string
- func (c *Calendar) UnmarkDay(d Date)
- func (n *Calendar) VAlign() Align
- func (n *Calendar) Visible() bool
- type CalendarCatalog
- type CalendarENUS
- type CalendarMode
- type CalendarNames
- type Card
- func (c *Card) Action() Widget
- func (c *Card) AppendFooter(w Widget)
- func (c *Card) Arrange(r render.Rect)
- func (c *Card) Baseline() (int, bool)
- func (c *Card) Children() []Widget
- func (c *Card) ClearFooter()
- func (c *Card) Content() Widget
- func (c *Card) Description() string
- func (c *Card) HitTest(p Point) Widget
- func (c *Card) Measure(axis Axis, forSize int) Sizes
- func (c *Card) Paint(cv *render.Canvas)
- func (c *Card) SetAction(w Widget)
- func (c *Card) SetContent(w Widget)
- func (c *Card) SetDescription(s string)
- func (c *Card) SetFooterAlign(a Align)
- func (c *Card) SetTitle(s string)
- func (c *Card) Title() string
- type Carousel
- func (n *Carousel) AccessibleName() string
- func (n *Carousel) AddClass(names ...string)
- func (c *Carousel) Append(w Widget)
- func (c *Carousel) Arrange(r render.Rect)
- func (n *Carousel) AttachStylesheet(s *Stylesheet)
- func (n *Carousel) Attr(name string) (string, bool)
- func (n *Carousel) Bounds() render.Rect
- func (c *Carousel) Children() []Widget
- func (n *Carousel) Classes() []string
- func (n *Carousel) DebugName() string
- func (n *Carousel) DetachStylesheet(s *Stylesheet)
- func (c *Carousel) DragMove(p Point)
- func (n *Carousel) Element() string
- func (n *Carousel) Enabled() bool
- func (c *Carousel) Gesture(g Gesture) bool
- func (n *Carousel) HAlign() Align
- func (n *Carousel) HasClass(name string) bool
- func (n *Carousel) HasState(flags StateFlags) bool
- func (n *Carousel) HitLeaf(self Widget, p Point) Widget
- func (c *Carousel) HitTest(p Point) Widget
- func (n *Carousel) HoverWithin() bool
- func (n *Carousel) ID() string
- func (n *Carousel) InlineStyle() string
- func (c *Carousel) InterceptKey(target Widget, a KeyAction, _ Mods) bool
- func (n *Carousel) Invalidate()
- func (n *Carousel) InvalidateLayout()
- func (n *Carousel) InvalidateRect(r render.Rect)
- func (n *Carousel) LayoutMotion() LayoutMotion
- func (n *Carousel) Margin() render.Insets
- func (n *Carousel) MaximumSize() Size
- func (c *Carousel) Measure(axis Axis, forSize int) Sizes
- func (c *Carousel) Page() int
- func (c *Carousel) Pages() int
- func (c *Carousel) Paint(cv *render.Canvas)
- func (n *Carousel) Parent() Widget
- func (c *Carousel) PressAt(p Point)
- func (c *Carousel) PressEnd()
- func (n *Carousel) RemoveAttr(name string)
- func (n *Carousel) RemoveClass(names ...string)
- func (n *Carousel) SetAccessibleName(name string)
- func (n *Carousel) SetAttr(name, value string)
- func (n *Carousel) SetClass(name string, on bool)
- func (n *Carousel) SetClasses(names ...string)
- func (n *Carousel) SetCursorName(s string)
- func (n *Carousel) SetDebugName(name string)
- func (n *Carousel) SetElement(name string)
- func (n *Carousel) SetEnabled(enabled bool)
- func (n *Carousel) SetFocusOnClick(on bool)
- func (n *Carousel) SetHAlign(a Align)
- func (n *Carousel) SetHExpand(on bool)
- func (n *Carousel) SetID(id string)
- func (n *Carousel) SetInlineStyle(css string)
- func (n *Carousel) SetInlineStylePriority(css string, priority int)
- func (n *Carousel) SetLayoutMotion(m LayoutMotion)
- func (n *Carousel) SetMargin(m render.Insets)
- func (n *Carousel) SetMaximumSize(w, h int)
- func (n *Carousel) SetOnClickWithin(fn func())
- func (n *Carousel) SetOnFocusChanged(fn func(focused bool))
- func (n *Carousel) SetOnHoverWithin(fn func(on bool))
- func (n *Carousel) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Carousel) SetOnScroll(fn func(e ScrollEvent) bool)
- func (c *Carousel) SetPage(i int)
- func (n *Carousel) SetSharedElement(tag string)
- func (n *Carousel) SetSizeRequest(w, h int)
- func (n *Carousel) SetState(flags StateFlags, on bool)
- func (n *Carousel) SetTooltip(s string)
- func (n *Carousel) SetTooltipMarkup(markup string)
- func (n *Carousel) SetVAlign(a Align)
- func (n *Carousel) SetVExpand(on bool)
- func (n *Carousel) SetVisible(visible bool)
- func (n *Carousel) SharedElement() string
- func (n *Carousel) SizeRequest() Size
- func (n *Carousel) TooltipMarkup() (string, bool)
- func (n *Carousel) TooltipText() string
- func (n *Carousel) VAlign() Align
- func (n *Carousel) Visible() bool
- type Catalog
- type CenterBox
- func (n *CenterBox) AccessibleName() string
- func (n *CenterBox) AddClass(names ...string)
- func (b *CenterBox) Arrange(r render.Rect)
- func (b *CenterBox) ArrangeRoot(r render.Rect)
- func (n *CenterBox) AttachStylesheet(s *Stylesheet)
- func (n *CenterBox) Attr(name string) (string, bool)
- func (n *CenterBox) Bounds() render.Rect
- func (b *CenterBox) Children() []Widget
- func (n *CenterBox) Classes() []string
- func (n *CenterBox) DebugName() string
- func (n *CenterBox) DetachStylesheet(s *Stylesheet)
- func (n *CenterBox) Element() string
- func (n *CenterBox) Enabled() bool
- func (n *CenterBox) HAlign() Align
- func (n *CenterBox) HasClass(name string) bool
- func (n *CenterBox) HasState(flags StateFlags) bool
- func (n *CenterBox) HitLeaf(self Widget, p Point) Widget
- func (b *CenterBox) HitTest(p Point) Widget
- func (n *CenterBox) HoverWithin() bool
- func (n *CenterBox) ID() string
- func (n *CenterBox) InlineStyle() string
- func (n *CenterBox) Invalidate()
- func (n *CenterBox) InvalidateLayout()
- func (n *CenterBox) InvalidateRect(r render.Rect)
- func (n *CenterBox) LayoutMotion() LayoutMotion
- func (n *CenterBox) Margin() render.Insets
- func (n *CenterBox) MaximumSize() Size
- func (b *CenterBox) Measure(axis Axis, forSize int) Sizes
- func (b *CenterBox) Orientation() Axis
- func (b *CenterBox) Paint(cv *render.Canvas)
- func (n *CenterBox) Parent() Widget
- func (n *CenterBox) RemoveAttr(name string)
- func (n *CenterBox) RemoveClass(names ...string)
- func (n *CenterBox) SetAccessibleName(name string)
- func (n *CenterBox) SetAttr(name, value string)
- func (n *CenterBox) SetClass(name string, on bool)
- func (n *CenterBox) SetClasses(names ...string)
- func (n *CenterBox) SetCursorName(s string)
- func (n *CenterBox) SetDebugName(name string)
- func (n *CenterBox) SetElement(name string)
- func (n *CenterBox) SetEnabled(enabled bool)
- func (n *CenterBox) SetFocusOnClick(on bool)
- func (n *CenterBox) SetHAlign(a Align)
- func (n *CenterBox) SetHExpand(on bool)
- func (n *CenterBox) SetID(id string)
- func (n *CenterBox) SetInlineStyle(css string)
- func (n *CenterBox) SetInlineStylePriority(css string, priority int)
- func (n *CenterBox) SetLayoutMotion(m LayoutMotion)
- func (n *CenterBox) SetMargin(m render.Insets)
- func (n *CenterBox) SetMaximumSize(w, h int)
- func (n *CenterBox) SetOnClickWithin(fn func())
- func (n *CenterBox) SetOnFocusChanged(fn func(focused bool))
- func (n *CenterBox) SetOnHoverWithin(fn func(on bool))
- func (n *CenterBox) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *CenterBox) SetOnScroll(fn func(e ScrollEvent) bool)
- func (b *CenterBox) SetOrientation(a Axis)
- func (n *CenterBox) SetSharedElement(tag string)
- func (n *CenterBox) SetSizeRequest(w, h int)
- func (n *CenterBox) SetState(flags StateFlags, on bool)
- func (n *CenterBox) SetTooltip(s string)
- func (n *CenterBox) SetTooltipMarkup(markup string)
- func (n *CenterBox) SetVAlign(a Align)
- func (n *CenterBox) SetVExpand(on bool)
- func (n *CenterBox) SetVisible(visible bool)
- func (n *CenterBox) SharedElement() string
- func (n *CenterBox) SizeRequest() Size
- func (n *CenterBox) TooltipMarkup() (string, bool)
- func (n *CenterBox) TooltipText() string
- func (n *CenterBox) VAlign() Align
- func (n *CenterBox) Visible() bool
- type Chart
- func (n *Chart) AccessibleName() string
- func (n *Chart) AddClass(names ...string)
- func (n *Chart) Arrange(r render.Rect)
- func (n *Chart) AttachStylesheet(s *Stylesheet)
- func (n *Chart) Attr(name string) (string, bool)
- func (n *Chart) Bounds() render.Rect
- func (n *Chart) Classes() []string
- func (n *Chart) DebugName() string
- func (n *Chart) DetachStylesheet(s *Stylesheet)
- func (n *Chart) Element() string
- func (n *Chart) Enabled() bool
- func (n *Chart) HAlign() Align
- func (n *Chart) HasClass(name string) bool
- func (n *Chart) HasState(flags StateFlags) bool
- func (n *Chart) HitLeaf(self Widget, p Point) Widget
- func (c *Chart) HitTest(p Point) Widget
- func (c *Chart) HoverMove(p Point)
- func (n *Chart) HoverWithin() bool
- func (n *Chart) ID() string
- func (n *Chart) InlineStyle() string
- func (n *Chart) Invalidate()
- func (n *Chart) InvalidateLayout()
- func (n *Chart) InvalidateRect(r render.Rect)
- func (n *Chart) LayoutMotion() LayoutMotion
- func (n *Chart) Margin() render.Insets
- func (n *Chart) MaximumSize() Size
- func (c *Chart) Measure(axis Axis, forSize int) Sizes
- func (c *Chart) Paint(cv *render.Canvas)
- func (n *Chart) Parent() Widget
- func (n *Chart) RemoveAttr(name string)
- func (n *Chart) RemoveClass(names ...string)
- func (c *Chart) Role() Role
- func (n *Chart) SetAccessibleName(name string)
- func (n *Chart) SetAttr(name, value string)
- func (n *Chart) SetClass(name string, on bool)
- func (n *Chart) SetClasses(names ...string)
- func (n *Chart) SetCursorName(s string)
- func (c *Chart) SetData(labels []string, series ...ChartSeries)
- func (n *Chart) SetDebugName(name string)
- func (c *Chart) SetDonut(on bool)
- func (n *Chart) SetElement(name string)
- func (n *Chart) SetEnabled(enabled bool)
- func (n *Chart) SetFocusOnClick(on bool)
- func (n *Chart) SetHAlign(a Align)
- func (n *Chart) SetHExpand(on bool)
- func (c *Chart) SetHovered(on bool)
- func (n *Chart) SetID(id string)
- func (n *Chart) SetInlineStyle(css string)
- func (n *Chart) SetInlineStylePriority(css string, priority int)
- func (n *Chart) SetLayoutMotion(m LayoutMotion)
- func (c *Chart) SetLegend(on bool)
- func (n *Chart) SetMargin(m render.Insets)
- func (n *Chart) SetMaximumSize(w, h int)
- func (n *Chart) SetOnClickWithin(fn func())
- func (n *Chart) SetOnFocusChanged(fn func(focused bool))
- func (n *Chart) SetOnHoverWithin(fn func(on bool))
- func (n *Chart) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Chart) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Chart) SetSharedElement(tag string)
- func (n *Chart) SetSizeRequest(w, h int)
- func (c *Chart) SetStacked(on bool)
- func (n *Chart) SetState(flags StateFlags, on bool)
- func (n *Chart) SetTooltip(s string)
- func (n *Chart) SetTooltipMarkup(markup string)
- func (n *Chart) SetVAlign(a Align)
- func (n *Chart) SetVExpand(on bool)
- func (n *Chart) SetVisible(visible bool)
- func (n *Chart) SharedElement() string
- func (n *Chart) SizeRequest() Size
- func (c *Chart) Summary() string
- func (n *Chart) TooltipMarkup() (string, bool)
- func (n *Chart) TooltipText() string
- func (n *Chart) VAlign() Align
- func (n *Chart) Visible() bool
- type ChartKind
- type ChartSeries
- type CheckButton
- func (n *CheckButton) AccessibleName() string
- func (n *CheckButton) AddClass(names ...string)
- func (c *CheckButton) Arrange(r render.Rect)
- func (n *CheckButton) AttachStylesheet(s *Stylesheet)
- func (n *CheckButton) Attr(name string) (string, bool)
- func (c *CheckButton) BindAction(target Checkable) (unbind func())
- func (c *CheckButton) BindChecked(b *Binding[bool]) (unbind func())
- func (n *CheckButton) Bounds() render.Rect
- func (c *CheckButton) Checked() bool
- func (c *CheckButton) Child() Widget
- func (n *CheckButton) Classes() []string
- func (c *CheckButton) ClickAt(Point)
- func (n *CheckButton) DebugName() string
- func (n *CheckButton) DetachStylesheet(s *Stylesheet)
- func (n *CheckButton) Element() string
- func (n *CheckButton) Enabled() bool
- func (n *CheckButton) HAlign() Align
- func (n *CheckButton) HasClass(name string) bool
- func (n *CheckButton) HasState(flags StateFlags) bool
- func (n *CheckButton) HitLeaf(self Widget, p Point) Widget
- func (c *CheckButton) HitTest(p Point) Widget
- func (n *CheckButton) HoverWithin() bool
- func (n *CheckButton) ID() string
- func (c *CheckButton) Inconsistent() bool
- func (n *CheckButton) InlineStyle() string
- func (c *CheckButton) InsertRune(r rune)
- func (n *CheckButton) Invalidate()
- func (n *CheckButton) InvalidateLayout()
- func (n *CheckButton) InvalidateRect(r render.Rect)
- func (c *CheckButton) KeyAction(a KeyAction, _ Mods)
- func (n *CheckButton) LayoutMotion() LayoutMotion
- func (n *CheckButton) Margin() render.Insets
- func (n *CheckButton) MaximumSize() Size
- func (c *CheckButton) Measure(axis Axis, forSize int) Sizes
- func (c *CheckButton) Paint(cv *render.Canvas)
- func (n *CheckButton) Parent() Widget
- func (n *CheckButton) RemoveAttr(name string)
- func (n *CheckButton) RemoveClass(names ...string)
- func (c *CheckButton) Role() Role
- func (n *CheckButton) SetAccessibleName(name string)
- func (n *CheckButton) SetAttr(name, value string)
- func (c *CheckButton) SetChecked(checked bool)
- func (c *CheckButton) SetChild(w Widget)
- func (n *CheckButton) SetClass(name string, on bool)
- func (n *CheckButton) SetClasses(names ...string)
- func (n *CheckButton) SetCursorName(s string)
- func (n *CheckButton) SetDebugName(name string)
- func (n *CheckButton) SetElement(name string)
- func (n *CheckButton) SetEnabled(enabled bool)
- func (n *CheckButton) SetFocusOnClick(on bool)
- func (c *CheckButton) SetGroup(other *CheckButton)
- func (n *CheckButton) SetHAlign(a Align)
- func (n *CheckButton) SetHExpand(on bool)
- func (n *CheckButton) SetID(id string)
- func (c *CheckButton) SetInconsistent(on bool)
- func (n *CheckButton) SetInlineStyle(css string)
- func (n *CheckButton) SetInlineStylePriority(css string, priority int)
- func (n *CheckButton) SetLayoutMotion(m LayoutMotion)
- func (n *CheckButton) SetMargin(m render.Insets)
- func (n *CheckButton) SetMaximumSize(w, h int)
- func (n *CheckButton) SetOnClickWithin(fn func())
- func (n *CheckButton) SetOnFocusChanged(fn func(focused bool))
- func (n *CheckButton) SetOnHoverWithin(fn func(on bool))
- func (n *CheckButton) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *CheckButton) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *CheckButton) SetSharedElement(tag string)
- func (n *CheckButton) SetSizeRequest(w, h int)
- func (n *CheckButton) SetState(flags StateFlags, on bool)
- func (n *CheckButton) SetTooltip(s string)
- func (n *CheckButton) SetTooltipMarkup(markup string)
- func (n *CheckButton) SetVAlign(a Align)
- func (n *CheckButton) SetVExpand(on bool)
- func (n *CheckButton) SetVisible(visible bool)
- func (n *CheckButton) SharedElement() string
- func (n *CheckButton) SizeRequest() Size
- func (c *CheckButton) Toggle()
- func (n *CheckButton) TooltipMarkup() (string, bool)
- func (n *CheckButton) TooltipText() string
- func (n *CheckButton) VAlign() Align
- func (n *CheckButton) Visible() bool
- type Checkable
- type Chip
- func (c *Chip) Arrange(r render.Rect)
- func (c *Chip) Baseline() (int, bool)
- func (c *Chip) Children() []Widget
- func (c *Chip) DragContent() *DragContent
- func (c *Chip) HitTest(p Point) Widget
- func (c *Chip) Measure(axis Axis, forSize int) Sizes
- func (c *Chip) Paint(cv *render.Canvas)
- func (c *Chip) SetContent(w Widget)
- func (c *Chip) SetLeading(w Widget)
- func (c *Chip) SetOnDismiss(fn func())
- func (c *Chip) SetText(text string)
- func (c *Chip) Text() string
- type ChipBox
- func (b *ChipBox) Append(c *Chip)
- func (c *ChipBox) Arrange(r render.Rect)
- func (c *ChipBox) Baseline() (int, bool)
- func (c *ChipBox) Children() []Widget
- func (b *ChipBox) ChipAt(i int) *Chip
- func (b *ChipBox) Chips() []*Chip
- func (b *ChipBox) Clear()
- func (b *ChipBox) DragEnter(mimes []string, p Point) string
- func (b *ChipBox) DragHover(p Point)
- func (b *ChipBox) DragLeave()
- func (b *ChipBox) Drop(_ string, data []byte, p Point)
- func (c *ChipBox) HitTest(p Point) Widget
- func (b *ChipBox) IndexOf(c *Chip) int
- func (b *ChipBox) Insert(i int, c *Chip)
- func (b *ChipBox) Len() int
- func (c *ChipBox) Measure(axis Axis, forSize int) Sizes
- func (b *ChipBox) Paint(cv *render.Canvas)
- func (b *ChipBox) Remove(c *Chip) bool
- type Clamp
- func (c *Clamp) Arrange(r render.Rect)
- func (c *Clamp) Baseline() (int, bool)
- func (c *Clamp) Children() []Widget
- func (c *Clamp) HitTest(p Point) Widget
- func (c *Clamp) Maximum() int
- func (c *Clamp) Measure(axis Axis, forSize int) Sizes
- func (c *Clamp) Paint(cv *render.Canvas)
- func (c *Clamp) SetMaximum(max int)
- type Clicker
- type Color
- type ColorButton
- func (n *ColorButton) AccessibleName() string
- func (n *ColorButton) AddClass(names ...string)
- func (n *ColorButton) AttachStylesheet(s *Stylesheet)
- func (n *ColorButton) Attr(name string) (string, bool)
- func (b *ColorButton) BindColor(binding *Binding[render.Color]) (unbind func())
- func (n *ColorButton) Bounds() render.Rect
- func (b *ColorButton) Choose(c render.Color)
- func (n *ColorButton) Classes() []string
- func (b *ColorButton) Color() render.Color
- func (n *ColorButton) DebugName() string
- func (n *ColorButton) DetachStylesheet(s *Stylesheet)
- func (n *ColorButton) Element() string
- func (n *ColorButton) Enabled() bool
- func (n *ColorButton) HAlign() Align
- func (n *ColorButton) HasClass(name string) bool
- func (n *ColorButton) HasState(flags StateFlags) bool
- func (n *ColorButton) HitLeaf(self Widget, p Point) Widget
- func (n *ColorButton) HoverWithin() bool
- func (n *ColorButton) ID() string
- func (n *ColorButton) InlineStyle() string
- func (n *ColorButton) Invalidate()
- func (n *ColorButton) InvalidateLayout()
- func (n *ColorButton) InvalidateRect(r render.Rect)
- func (n *ColorButton) LayoutMotion() LayoutMotion
- func (n *ColorButton) Margin() render.Insets
- func (n *ColorButton) MaximumSize() Size
- func (n *ColorButton) Parent() Widget
- func (n *ColorButton) RemoveAttr(name string)
- func (n *ColorButton) RemoveClass(names ...string)
- func (n *ColorButton) SetAccessibleName(name string)
- func (n *ColorButton) SetAttr(name, value string)
- func (n *ColorButton) SetClass(name string, on bool)
- func (n *ColorButton) SetClasses(names ...string)
- func (b *ColorButton) SetColor(c render.Color)
- func (n *ColorButton) SetCursorName(s string)
- func (n *ColorButton) SetDebugName(name string)
- func (n *ColorButton) SetElement(name string)
- func (n *ColorButton) SetEnabled(enabled bool)
- func (n *ColorButton) SetFocusOnClick(on bool)
- func (n *ColorButton) SetHAlign(a Align)
- func (n *ColorButton) SetHExpand(on bool)
- func (n *ColorButton) SetID(id string)
- func (n *ColorButton) SetInlineStyle(css string)
- func (n *ColorButton) SetInlineStylePriority(css string, priority int)
- func (n *ColorButton) SetLayoutMotion(m LayoutMotion)
- func (n *ColorButton) SetMargin(m render.Insets)
- func (n *ColorButton) SetMaximumSize(w, h int)
- func (n *ColorButton) SetOnClickWithin(fn func())
- func (n *ColorButton) SetOnFocusChanged(fn func(focused bool))
- func (n *ColorButton) SetOnHoverWithin(fn func(on bool))
- func (n *ColorButton) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *ColorButton) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *ColorButton) SetSharedElement(tag string)
- func (n *ColorButton) SetSizeRequest(w, h int)
- func (n *ColorButton) SetState(flags StateFlags, on bool)
- func (n *ColorButton) SetTooltip(s string)
- func (n *ColorButton) SetTooltipMarkup(markup string)
- func (n *ColorButton) SetVAlign(a Align)
- func (n *ColorButton) SetVExpand(on bool)
- func (n *ColorButton) SetVisible(visible bool)
- func (n *ColorButton) SharedElement() string
- func (n *ColorButton) SizeRequest() Size
- func (n *ColorButton) TooltipMarkup() (string, bool)
- func (n *ColorButton) TooltipText() string
- func (n *ColorButton) VAlign() Align
- func (n *ColorButton) Visible() bool
- type ColorChooser
- func (n *ColorChooser) AccessibleName() string
- func (n *ColorChooser) AddClass(names ...string)
- func (c *ColorChooser) Arrange(r render.Rect)
- func (n *ColorChooser) AttachStylesheet(s *Stylesheet)
- func (n *ColorChooser) Attr(name string) (string, bool)
- func (n *ColorChooser) Bounds() render.Rect
- func (c *ColorChooser) Children() []Widget
- func (n *ColorChooser) Classes() []string
- func (c *ColorChooser) ClickAt(p Point)
- func (c *ColorChooser) Color() render.Color
- func (n *ColorChooser) DebugName() string
- func (n *ColorChooser) DetachStylesheet(s *Stylesheet)
- func (c *ColorChooser) DragMove(p Point)
- func (n *ColorChooser) Element() string
- func (n *ColorChooser) Enabled() bool
- func (n *ColorChooser) HAlign() Align
- func (n *ColorChooser) HasClass(name string) bool
- func (n *ColorChooser) HasState(flags StateFlags) bool
- func (n *ColorChooser) HitLeaf(self Widget, p Point) Widget
- func (c *ColorChooser) HitTest(p Point) Widget
- func (n *ColorChooser) HoverWithin() bool
- func (n *ColorChooser) ID() string
- func (n *ColorChooser) InlineStyle() string
- func (n *ColorChooser) Invalidate()
- func (n *ColorChooser) InvalidateLayout()
- func (n *ColorChooser) InvalidateRect(r render.Rect)
- func (c *ColorChooser) KeyAction(a KeyAction, mods Mods)
- func (n *ColorChooser) LayoutMotion() LayoutMotion
- func (n *ColorChooser) Margin() render.Insets
- func (n *ColorChooser) MaximumSize() Size
- func (c *ColorChooser) Measure(axis Axis, forSize int) Sizes
- func (c *ColorChooser) Paint(cv *render.Canvas)
- func (n *ColorChooser) Parent() Widget
- func (n *ColorChooser) RemoveAttr(name string)
- func (n *ColorChooser) RemoveClass(names ...string)
- func (c *ColorChooser) Role() Role
- func (n *ColorChooser) SetAccessibleName(name string)
- func (n *ColorChooser) SetAttr(name, value string)
- func (n *ColorChooser) SetClass(name string, on bool)
- func (n *ColorChooser) SetClasses(names ...string)
- func (c *ColorChooser) SetColor(col render.Color)
- func (n *ColorChooser) SetCursorName(s string)
- func (n *ColorChooser) SetDebugName(name string)
- func (n *ColorChooser) SetElement(name string)
- func (n *ColorChooser) SetEnabled(enabled bool)
- func (c *ColorChooser) SetEyedropper(start func())
- func (n *ColorChooser) SetFocusOnClick(on bool)
- func (n *ColorChooser) SetHAlign(a Align)
- func (n *ColorChooser) SetHExpand(on bool)
- func (n *ColorChooser) SetID(id string)
- func (n *ColorChooser) SetInlineStyle(css string)
- func (n *ColorChooser) SetInlineStylePriority(css string, priority int)
- func (n *ColorChooser) SetLayoutMotion(m LayoutMotion)
- func (n *ColorChooser) SetMargin(m render.Insets)
- func (n *ColorChooser) SetMaximumSize(w, h int)
- func (n *ColorChooser) SetOnClickWithin(fn func())
- func (n *ColorChooser) SetOnFocusChanged(fn func(focused bool))
- func (n *ColorChooser) SetOnHoverWithin(fn func(on bool))
- func (n *ColorChooser) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *ColorChooser) SetOnScroll(fn func(e ScrollEvent) bool)
- func (c *ColorChooser) SetPaletteSource(colors func() []render.Color, add func(render.Color))
- func (n *ColorChooser) SetSharedElement(tag string)
- func (n *ColorChooser) SetSizeRequest(w, h int)
- func (n *ColorChooser) SetState(flags StateFlags, on bool)
- func (n *ColorChooser) SetTooltip(s string)
- func (n *ColorChooser) SetTooltipMarkup(markup string)
- func (n *ColorChooser) SetVAlign(a Align)
- func (n *ColorChooser) SetVExpand(on bool)
- func (n *ColorChooser) SetVisible(visible bool)
- func (n *ColorChooser) SharedElement() string
- func (n *ColorChooser) SizeRequest() Size
- func (n *ColorChooser) TooltipMarkup() (string, bool)
- func (n *ColorChooser) TooltipText() string
- func (n *ColorChooser) VAlign() Align
- func (n *ColorChooser) Visible() bool
- type ColorSwatch
- func (n *ColorSwatch) AccessibleName() string
- func (n *ColorSwatch) AddClass(names ...string)
- func (n *ColorSwatch) Arrange(r render.Rect)
- func (n *ColorSwatch) AttachStylesheet(s *Stylesheet)
- func (n *ColorSwatch) Attr(name string) (string, bool)
- func (n *ColorSwatch) Bounds() render.Rect
- func (n *ColorSwatch) Classes() []string
- func (s *ColorSwatch) Color() render.Color
- func (n *ColorSwatch) DebugName() string
- func (n *ColorSwatch) DetachStylesheet(s *Stylesheet)
- func (n *ColorSwatch) Element() string
- func (n *ColorSwatch) Enabled() bool
- func (n *ColorSwatch) HAlign() Align
- func (n *ColorSwatch) HasClass(name string) bool
- func (n *ColorSwatch) HasState(flags StateFlags) bool
- func (n *ColorSwatch) HitLeaf(self Widget, p Point) Widget
- func (s *ColorSwatch) HitTest(p Point) Widget
- func (n *ColorSwatch) HoverWithin() bool
- func (n *ColorSwatch) ID() string
- func (n *ColorSwatch) InlineStyle() string
- func (n *ColorSwatch) Invalidate()
- func (n *ColorSwatch) InvalidateLayout()
- func (n *ColorSwatch) InvalidateRect(r render.Rect)
- func (n *ColorSwatch) LayoutMotion() LayoutMotion
- func (n *ColorSwatch) Margin() render.Insets
- func (n *ColorSwatch) MaximumSize() Size
- func (s *ColorSwatch) Measure(axis Axis, forSize int) Sizes
- func (s *ColorSwatch) Paint(cv *render.Canvas)
- func (n *ColorSwatch) Parent() Widget
- func (n *ColorSwatch) RemoveAttr(name string)
- func (n *ColorSwatch) RemoveClass(names ...string)
- func (s *ColorSwatch) Selected() bool
- func (n *ColorSwatch) SetAccessibleName(name string)
- func (n *ColorSwatch) SetAttr(name, value string)
- func (n *ColorSwatch) SetClass(name string, on bool)
- func (n *ColorSwatch) SetClasses(names ...string)
- func (s *ColorSwatch) SetColor(c render.Color)
- func (n *ColorSwatch) SetCursorName(s string)
- func (n *ColorSwatch) SetDebugName(name string)
- func (n *ColorSwatch) SetElement(name string)
- func (n *ColorSwatch) SetEnabled(enabled bool)
- func (n *ColorSwatch) SetFocusOnClick(on bool)
- func (n *ColorSwatch) SetHAlign(a Align)
- func (n *ColorSwatch) SetHExpand(on bool)
- func (n *ColorSwatch) SetID(id string)
- func (n *ColorSwatch) SetInlineStyle(css string)
- func (n *ColorSwatch) SetInlineStylePriority(css string, priority int)
- func (n *ColorSwatch) SetLayoutMotion(m LayoutMotion)
- func (n *ColorSwatch) SetMargin(m render.Insets)
- func (n *ColorSwatch) SetMaximumSize(w, h int)
- func (n *ColorSwatch) SetOnClickWithin(fn func())
- func (n *ColorSwatch) SetOnFocusChanged(fn func(focused bool))
- func (n *ColorSwatch) SetOnHoverWithin(fn func(on bool))
- func (n *ColorSwatch) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *ColorSwatch) SetOnScroll(fn func(e ScrollEvent) bool)
- func (s *ColorSwatch) SetSelected(on bool)
- func (n *ColorSwatch) SetSharedElement(tag string)
- func (n *ColorSwatch) SetSizeRequest(w, h int)
- func (n *ColorSwatch) SetState(flags StateFlags, on bool)
- func (n *ColorSwatch) SetTooltip(s string)
- func (n *ColorSwatch) SetTooltipMarkup(markup string)
- func (n *ColorSwatch) SetVAlign(a Align)
- func (n *ColorSwatch) SetVExpand(on bool)
- func (n *ColorSwatch) SetVisible(visible bool)
- func (n *ColorSwatch) SharedElement() string
- func (n *ColorSwatch) SizeRequest() Size
- func (n *ColorSwatch) TooltipMarkup() (string, bool)
- func (n *ColorSwatch) TooltipText() string
- func (n *ColorSwatch) VAlign() Align
- func (n *ColorSwatch) Visible() bool
- type ColumnModel
- type ColumnView
- func (v *ColumnView[T]) AddFilter(keep func(T) bool) *ViewFilter[T]
- func (c *ColumnView) Arrange(r render.Rect)
- func (c *ColumnView) Baseline() (int, bool)
- func (c *ColumnView) Children() []Widget
- func (v *ColumnView[T]) ClearFilters()
- func (v *ColumnView[T]) EnableRowDrag(on bool)
- func (c *ColumnView) HitTest(p Point) Widget
- func (v *ColumnView[T]) List() *List
- func (v *ColumnView[T]) Matching() int
- func (c *ColumnView) Measure(axis Axis, forSize int) Sizes
- func (c *ColumnView) Paint(cv *render.Canvas)
- func (v *ColumnView[T]) PopFilter()
- func (v *ColumnView[T]) Row(i int) T
- func (v *ColumnView[T]) Rows() int
- func (v *ColumnView[T]) SetColumns(cols []TableColumn[T])
- func (v *ColumnView[T]) SetFilter(keep func(T) bool)
- func (v *ColumnView[T]) SetFilterStatus(f *ViewFilter[T], on bool)
- func (v *ColumnView[T]) SetModel(m ColumnModel[T])
- func (v *ColumnView[T]) SetWindow(offset, limit int)
- func (v *ColumnView[T]) SortBy(col int, desc bool)
- func (v *ColumnView[T]) SortedBy() (col int, ascending bool)
- func (v *ColumnView[T]) SourceIndex(i int) int
- type ComboEntry
- func (n ComboEntry) AccessibleName() string
- func (n ComboEntry) AddClass(names ...string)
- func (n ComboEntry) AttachStylesheet(s *Stylesheet)
- func (n ComboEntry) Attr(name string) (string, bool)
- func (n ComboEntry) Bounds() render.Rect
- func (n ComboEntry) Classes() []string
- func (n ComboEntry) DebugName() string
- func (n ComboEntry) DetachStylesheet(s *Stylesheet)
- func (n ComboEntry) Element() string
- func (n ComboEntry) Enabled() bool
- func (n ComboEntry) HAlign() Align
- func (n ComboEntry) HasClass(name string) bool
- func (n ComboEntry) HasState(flags StateFlags) bool
- func (n ComboEntry) HitLeaf(self Widget, p Point) Widget
- func (n ComboEntry) HoverWithin() bool
- func (n ComboEntry) ID() string
- func (n ComboEntry) InlineStyle() string
- func (n ComboEntry) Invalidate()
- func (n ComboEntry) InvalidateLayout()
- func (n ComboEntry) InvalidateRect(r render.Rect)
- func (n ComboEntry) LayoutMotion() LayoutMotion
- func (n ComboEntry) Margin() render.Insets
- func (n ComboEntry) MaximumSize() Size
- func (n ComboEntry) Parent() Widget
- func (n ComboEntry) RemoveAttr(name string)
- func (n ComboEntry) RemoveClass(names ...string)
- func (n ComboEntry) SetAccessibleName(name string)
- func (n ComboEntry) SetAttr(name, value string)
- func (n ComboEntry) SetClass(name string, on bool)
- func (n ComboEntry) SetClasses(names ...string)
- func (n ComboEntry) SetCursorName(s string)
- func (n ComboEntry) SetDebugName(name string)
- func (n ComboEntry) SetElement(name string)
- func (n ComboEntry) SetEnabled(enabled bool)
- func (n ComboEntry) SetFocusOnClick(on bool)
- func (n ComboEntry) SetHAlign(a Align)
- func (n ComboEntry) SetHExpand(on bool)
- func (n ComboEntry) SetID(id string)
- func (n ComboEntry) SetInlineStyle(css string)
- func (n ComboEntry) SetInlineStylePriority(css string, priority int)
- func (c *ComboEntry) SetItems(items []string)
- func (n ComboEntry) SetLayoutMotion(m LayoutMotion)
- func (n ComboEntry) SetMargin(m render.Insets)
- func (n ComboEntry) SetMaximumSize(w, h int)
- func (n ComboEntry) SetOnClickWithin(fn func())
- func (n ComboEntry) SetOnFocusChanged(fn func(focused bool))
- func (n ComboEntry) SetOnHoverWithin(fn func(on bool))
- func (n ComboEntry) SetOnPointer(fn func(e PointerEvent) bool)
- func (n ComboEntry) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n ComboEntry) SetSharedElement(tag string)
- func (n ComboEntry) SetSizeRequest(w, h int)
- func (n ComboEntry) SetState(flags StateFlags, on bool)
- func (n ComboEntry) SetTooltip(s string)
- func (n ComboEntry) SetTooltipMarkup(markup string)
- func (n ComboEntry) SetVAlign(a Align)
- func (n ComboEntry) SetVExpand(on bool)
- func (n ComboEntry) SetVisible(visible bool)
- func (n ComboEntry) SharedElement() string
- func (n ComboEntry) SizeRequest() Size
- func (n ComboEntry) TooltipMarkup() (string, bool)
- func (n ComboEntry) TooltipText() string
- func (n ComboEntry) VAlign() Align
- func (n ComboEntry) Visible() bool
- type ComboRow
- func (c ComboRow) Arrange(r render.Rect)
- func (c ComboRow) Baseline() (int, bool)
- func (c ComboRow) Children() []Widget
- func (r *ComboRow) Dropdown() *Dropdown
- func (c ComboRow) HitTest(p Point) Widget
- func (c ComboRow) Measure(axis Axis, forSize int) Sizes
- func (p ComboRow) PackEnd(w Widget)
- func (p ComboRow) PackStart(w Widget)
- func (r *ComboRow) Selected() int
- func (r *ComboRow) SetSelected(i int)
- type Combobox
- func (c *Combobox) Arrange(r render.Rect)
- func (c *Combobox) Baseline() (int, bool)
- func (c *Combobox) Children() []Widget
- func (c *Combobox) HitTest(p Point) Widget
- func (c *Combobox) Measure(axis Axis, forSize int) Sizes
- func (c *Combobox) Paint(cv *render.Canvas)
- func (c *Combobox[T]) Selected() []T
- func (c *Combobox[T]) SetMultiple(on bool)
- func (c *Combobox[T]) SetSelected(values ...T)
- type ComboboxOption
- type Command
- func (c *Command) Arrange(r render.Rect)
- func (c *Command) Baseline() (int, bool)
- func (c *Command) Children() []Widget
- func (c *Command) FocusTarget() Widget
- func (c *Command) Highlighted() (CommandItem, bool)
- func (c *Command) HitTest(p Point) Widget
- func (c *Command) InsertRune(r rune)
- func (c *Command) InterceptKey(target Widget, a KeyAction, _ Mods) bool
- func (c *Command) KeyAction(a KeyAction, _ Mods)
- func (c *Command) Measure(axis Axis, forSize int) Sizes
- func (c *Command) Paint(cv *render.Canvas)
- func (c *Command) Query() string
- func (c *Command) SetEmptyText(s string)
- func (c *Command) SetGroups(groups ...CommandGroup)
- func (c *Command) SetQuery(q string)
- type CommandGroup
- type CommandItem
- type ContentPaster
- type ContextMenu
- func (c *ContextMenu) Arrange(r render.Rect)
- func (c *ContextMenu) Baseline() (int, bool)
- func (c *ContextMenu) Children() []Widget
- func (c *ContextMenu) Gesture(g Gesture) bool
- func (c *ContextMenu) HitTest(p Point) Widget
- func (c *ContextMenu) Items() []MenuItem
- func (c *ContextMenu) Measure(axis Axis, forSize int) Sizes
- func (c *ContextMenu) OpenContextMenu(at Point)
- func (c *ContextMenu) Paint(cv *render.Canvas)
- func (c *ContextMenu) SetItems(items ...MenuItem)
- type ContextMenuOpener
- type CursorNamer
- type DataTable
- func (c *DataTable) Arrange(r render.Rect)
- func (c *DataTable) Baseline() (int, bool)
- func (c *DataTable) Children() []Widget
- func (t *DataTable[T]) ColumnVisible(i int) bool
- func (c *DataTable) HitTest(p Point) Widget
- func (c *DataTable) Measure(axis Axis, forSize int) Sizes
- func (t *DataTable[T]) Page() int
- func (c *DataTable) Paint(cv *render.Canvas)
- func (t *DataTable[T]) Selected() []int
- func (t *DataTable[T]) SetColumnVisible(i int, on bool)
- func (t *DataTable[T]) SetPageSize(n int)
- func (t *DataTable[T]) SortBy(i int, desc bool)
- func (t *DataTable[T]) View() *ColumnView[T]
- type Date
- type DatePicker
- func (c *DatePicker) Arrange(r render.Rect)
- func (c *DatePicker) Baseline() (int, bool)
- func (c *DatePicker) Children() []Widget
- func (p *DatePicker) Date() Date
- func (c *DatePicker) HitTest(p Point) Widget
- func (c *DatePicker) Measure(axis Axis, forSize int) Sizes
- func (c *DatePicker) Paint(cv *render.Canvas)
- func (p *DatePicker) Range() (from, to Date)
- func (p *DatePicker) SetDate(d Date)
- func (p *DatePicker) SetMode(m CalendarMode)
- func (p *DatePicker) SetNames(names CalendarNames)
- func (p *DatePicker) SetPresets(presets ...DatePreset)
- func (p *DatePicker) SetRange(from, to Date)
- func (p *DatePicker) SetTime(t TimeOfDay)
- func (p *DatePicker) SetTimeInput(on bool)
- func (p *DatePicker) Time() TimeOfDay
- type DatePreset
- type DebugNamer
- type DirSource
- type Direction
- type DoubleClicker
- type DragContent
- type DragEnterer
- type DragHoverer
- type DragIconer
- type DragInterceptor
- type DragLeaver
- type DragMover
- type DragOverSetter
- type DragSource
- type DrawSurface
- func (n *DrawSurface) AccessibleName() string
- func (n *DrawSurface) AddClass(names ...string)
- func (n *DrawSurface) Arrange(r render.Rect)
- func (n *DrawSurface) AttachStylesheet(s *Stylesheet)
- func (n *DrawSurface) Attr(name string) (string, bool)
- func (n *DrawSurface) Bounds() render.Rect
- func (d *DrawSurface) Canvas() *render.Canvas
- func (n *DrawSurface) Classes() []string
- func (n *DrawSurface) DebugName() string
- func (n *DrawSurface) DetachStylesheet(s *Stylesheet)
- func (d *DrawSurface) Draw(r render.Rect, fn func(cv *render.Canvas))
- func (n *DrawSurface) Element() string
- func (n *DrawSurface) Enabled() bool
- func (n *DrawSurface) HAlign() Align
- func (n *DrawSurface) HasClass(name string) bool
- func (n *DrawSurface) HasState(flags StateFlags) bool
- func (n *DrawSurface) HitLeaf(self Widget, p Point) Widget
- func (d *DrawSurface) HitTest(p Point) Widget
- func (n *DrawSurface) HoverWithin() bool
- func (n *DrawSurface) ID() string
- func (n *DrawSurface) InlineStyle() string
- func (n *DrawSurface) Invalidate()
- func (n *DrawSurface) InvalidateLayout()
- func (n *DrawSurface) InvalidateRect(r render.Rect)
- func (n *DrawSurface) LayoutMotion() LayoutMotion
- func (n *DrawSurface) Margin() render.Insets
- func (n *DrawSurface) MaximumSize() Size
- func (d *DrawSurface) Measure(axis Axis, forSize int) Sizes
- func (d *DrawSurface) Paint(cv *render.Canvas)
- func (n *DrawSurface) Parent() Widget
- func (d *DrawSurface) QueueDraw()
- func (n *DrawSurface) RemoveAttr(name string)
- func (n *DrawSurface) RemoveClass(names ...string)
- func (n *DrawSurface) SetAccessibleName(name string)
- func (n *DrawSurface) SetAttr(name, value string)
- func (n *DrawSurface) SetClass(name string, on bool)
- func (n *DrawSurface) SetClasses(names ...string)
- func (d *DrawSurface) SetContentSize(w, h int)
- func (n *DrawSurface) SetCursorName(s string)
- func (n *DrawSurface) SetDebugName(name string)
- func (n *DrawSurface) SetElement(name string)
- func (n *DrawSurface) SetEnabled(enabled bool)
- func (n *DrawSurface) SetFocusOnClick(on bool)
- func (n *DrawSurface) SetHAlign(a Align)
- func (n *DrawSurface) SetHExpand(on bool)
- func (n *DrawSurface) SetID(id string)
- func (n *DrawSurface) SetInlineStyle(css string)
- func (n *DrawSurface) SetInlineStylePriority(css string, priority int)
- func (n *DrawSurface) SetLayoutMotion(m LayoutMotion)
- func (n *DrawSurface) SetMargin(m render.Insets)
- func (n *DrawSurface) SetMaximumSize(w, h int)
- func (n *DrawSurface) SetOnClickWithin(fn func())
- func (n *DrawSurface) SetOnFocusChanged(fn func(focused bool))
- func (n *DrawSurface) SetOnHoverWithin(fn func(on bool))
- func (n *DrawSurface) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *DrawSurface) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *DrawSurface) SetSharedElement(tag string)
- func (n *DrawSurface) SetSizeRequest(w, h int)
- func (n *DrawSurface) SetState(flags StateFlags, on bool)
- func (n *DrawSurface) SetTooltip(s string)
- func (n *DrawSurface) SetTooltipMarkup(markup string)
- func (n *DrawSurface) SetVAlign(a Align)
- func (n *DrawSurface) SetVExpand(on bool)
- func (n *DrawSurface) SetVisible(visible bool)
- func (n *DrawSurface) SharedElement() string
- func (n *DrawSurface) SizeRequest() Size
- func (d *DrawSurface) Stylus(s Stylus)
- func (n *DrawSurface) TooltipMarkup() (string, bool)
- func (n *DrawSurface) TooltipText() string
- func (n *DrawSurface) VAlign() Align
- func (n *DrawSurface) Visible() bool
- type DrawingArea
- func (n *DrawingArea) AccessibleName() string
- func (n *DrawingArea) AddClass(names ...string)
- func (n *DrawingArea) Arrange(r render.Rect)
- func (n *DrawingArea) AttachStylesheet(s *Stylesheet)
- func (n *DrawingArea) Attr(name string) (string, bool)
- func (n *DrawingArea) Bounds() render.Rect
- func (n *DrawingArea) Classes() []string
- func (n *DrawingArea) DebugName() string
- func (n *DrawingArea) DetachStylesheet(s *Stylesheet)
- func (n *DrawingArea) Element() string
- func (n *DrawingArea) Enabled() bool
- func (n *DrawingArea) HAlign() Align
- func (n *DrawingArea) HasClass(name string) bool
- func (n *DrawingArea) HasState(flags StateFlags) bool
- func (n *DrawingArea) HitLeaf(self Widget, p Point) Widget
- func (d *DrawingArea) HitTest(p Point) Widget
- func (n *DrawingArea) HoverWithin() bool
- func (n *DrawingArea) ID() string
- func (n *DrawingArea) InlineStyle() string
- func (n *DrawingArea) Invalidate()
- func (n *DrawingArea) InvalidateLayout()
- func (n *DrawingArea) InvalidateRect(r render.Rect)
- func (n *DrawingArea) LayoutMotion() LayoutMotion
- func (n *DrawingArea) Margin() render.Insets
- func (n *DrawingArea) MaximumSize() Size
- func (d *DrawingArea) Measure(axis Axis, forSize int) Sizes
- func (d *DrawingArea) Paint(cv *render.Canvas)
- func (n *DrawingArea) Parent() Widget
- func (d *DrawingArea) QueueDraw()
- func (n *DrawingArea) RemoveAttr(name string)
- func (n *DrawingArea) RemoveClass(names ...string)
- func (n *DrawingArea) SetAccessibleName(name string)
- func (n *DrawingArea) SetAttr(name, value string)
- func (n *DrawingArea) SetClass(name string, on bool)
- func (n *DrawingArea) SetClasses(names ...string)
- func (d *DrawingArea) SetContentSize(w, h int)
- func (n *DrawingArea) SetCursorName(s string)
- func (n *DrawingArea) SetDebugName(name string)
- func (n *DrawingArea) SetElement(name string)
- func (n *DrawingArea) SetEnabled(enabled bool)
- func (n *DrawingArea) SetFocusOnClick(on bool)
- func (n *DrawingArea) SetHAlign(a Align)
- func (n *DrawingArea) SetHExpand(on bool)
- func (n *DrawingArea) SetID(id string)
- func (n *DrawingArea) SetInlineStyle(css string)
- func (n *DrawingArea) SetInlineStylePriority(css string, priority int)
- func (n *DrawingArea) SetLayoutMotion(m LayoutMotion)
- func (n *DrawingArea) SetMargin(m render.Insets)
- func (n *DrawingArea) SetMaximumSize(w, h int)
- func (n *DrawingArea) SetOnClickWithin(fn func())
- func (n *DrawingArea) SetOnFocusChanged(fn func(focused bool))
- func (n *DrawingArea) SetOnHoverWithin(fn func(on bool))
- func (n *DrawingArea) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *DrawingArea) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *DrawingArea) SetSharedElement(tag string)
- func (n *DrawingArea) SetSizeRequest(w, h int)
- func (n *DrawingArea) SetState(flags StateFlags, on bool)
- func (n *DrawingArea) SetTooltip(s string)
- func (n *DrawingArea) SetTooltipMarkup(markup string)
- func (n *DrawingArea) SetVAlign(a Align)
- func (n *DrawingArea) SetVExpand(on bool)
- func (n *DrawingArea) SetVisible(visible bool)
- func (n *DrawingArea) SharedElement() string
- func (n *DrawingArea) SizeRequest() Size
- func (d *DrawingArea) Stylus(s Stylus)
- func (n *DrawingArea) TooltipMarkup() (string, bool)
- func (n *DrawingArea) TooltipText() string
- func (n *DrawingArea) VAlign() Align
- func (n *DrawingArea) Visible() bool
- type DropActionChooser
- type Dropdown
- func (n *Dropdown) AccessibleName() string
- func (n *Dropdown) AddClass(names ...string)
- func (n *Dropdown) Arrange(r render.Rect)
- func (n *Dropdown) AttachStylesheet(s *Stylesheet)
- func (n *Dropdown) Attr(name string) (string, bool)
- func (d *Dropdown) BindSelected(b *Binding[int]) (unbind func())
- func (n *Dropdown) Bounds() render.Rect
- func (n *Dropdown) Classes() []string
- func (d *Dropdown) ClickAt(Point)
- func (d *Dropdown) Close()
- func (n *Dropdown) DebugName() string
- func (n *Dropdown) DetachStylesheet(s *Stylesheet)
- func (d *Dropdown) Direction() Direction
- func (n *Dropdown) Element() string
- func (n *Dropdown) Enabled() bool
- func (n *Dropdown) HAlign() Align
- func (n *Dropdown) HasClass(name string) bool
- func (n *Dropdown) HasState(flags StateFlags) bool
- func (n *Dropdown) HitLeaf(self Widget, p Point) Widget
- func (d *Dropdown) HitTest(p Point) Widget
- func (n *Dropdown) HoverWithin() bool
- func (n *Dropdown) ID() string
- func (n *Dropdown) InlineStyle() string
- func (d *Dropdown) InsertRune(r rune)
- func (n *Dropdown) Invalidate()
- func (n *Dropdown) InvalidateLayout()
- func (n *Dropdown) InvalidateRect(r render.Rect)
- func (d *Dropdown) Items() []string
- func (d *Dropdown) KeyAction(a KeyAction, _ Mods)
- func (n *Dropdown) LayoutMotion() LayoutMotion
- func (n *Dropdown) Margin() render.Insets
- func (n *Dropdown) MaximumSize() Size
- func (d *Dropdown) Measure(axis Axis, forSize int) Sizes
- func (d *Dropdown) Open()
- func (d *Dropdown) Opened() bool
- func (d *Dropdown) Paint(cv *render.Canvas)
- func (n *Dropdown) Parent() Widget
- func (n *Dropdown) RemoveAttr(name string)
- func (n *Dropdown) RemoveClass(names ...string)
- func (d *Dropdown) Role() Role
- func (d *Dropdown) Selected() int
- func (d *Dropdown) Selection() string
- func (n *Dropdown) SetAccessibleName(name string)
- func (n *Dropdown) SetAttr(name, value string)
- func (n *Dropdown) SetClass(name string, on bool)
- func (n *Dropdown) SetClasses(names ...string)
- func (n *Dropdown) SetCursorName(s string)
- func (n *Dropdown) SetDebugName(name string)
- func (d *Dropdown) SetDirection(dir Direction)
- func (n *Dropdown) SetElement(name string)
- func (d *Dropdown) SetEnabled(enabled bool)
- func (n *Dropdown) SetFocusOnClick(on bool)
- func (n *Dropdown) SetHAlign(a Align)
- func (n *Dropdown) SetHExpand(on bool)
- func (d *Dropdown) SetHovered(on bool)
- func (n *Dropdown) SetID(id string)
- func (n *Dropdown) SetInlineStyle(css string)
- func (n *Dropdown) SetInlineStylePriority(css string, priority int)
- func (d *Dropdown) SetItems(items []string, selected int)
- func (n *Dropdown) SetLayoutMotion(m LayoutMotion)
- func (n *Dropdown) SetMargin(m render.Insets)
- func (n *Dropdown) SetMaximumSize(w, h int)
- func (n *Dropdown) SetOnClickWithin(fn func())
- func (n *Dropdown) SetOnFocusChanged(fn func(focused bool))
- func (n *Dropdown) SetOnHoverWithin(fn func(on bool))
- func (n *Dropdown) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Dropdown) SetOnScroll(fn func(e ScrollEvent) bool)
- func (d *Dropdown) SetRows(rows []DropdownRow, selected int)
- func (d *Dropdown) SetSelected(i int)
- func (n *Dropdown) SetSharedElement(tag string)
- func (n *Dropdown) SetSizeRequest(w, h int)
- func (n *Dropdown) SetState(flags StateFlags, on bool)
- func (n *Dropdown) SetTooltip(s string)
- func (n *Dropdown) SetTooltipMarkup(markup string)
- func (n *Dropdown) SetVAlign(a Align)
- func (n *Dropdown) SetVExpand(on bool)
- func (n *Dropdown) SetVisible(visible bool)
- func (n *Dropdown) SharedElement() string
- func (n *Dropdown) SizeRequest() Size
- func (n *Dropdown) TooltipMarkup() (string, bool)
- func (n *Dropdown) TooltipText() string
- func (n *Dropdown) VAlign() Align
- func (n *Dropdown) Visible() bool
- type DropdownItem
- type DropdownOf
- func (n DropdownOf) AccessibleName() string
- func (n DropdownOf) AddClass(names ...string)
- func (n DropdownOf) Arrange(r render.Rect)
- func (n DropdownOf) AttachStylesheet(s *Stylesheet)
- func (n DropdownOf) Attr(name string) (string, bool)
- func (n DropdownOf) Bounds() render.Rect
- func (n DropdownOf) Classes() []string
- func (n DropdownOf) DebugName() string
- func (n DropdownOf) DetachStylesheet(s *Stylesheet)
- func (n DropdownOf) Element() string
- func (n DropdownOf) Enabled() bool
- func (n DropdownOf) HAlign() Align
- func (n DropdownOf) HasClass(name string) bool
- func (n DropdownOf) HasState(flags StateFlags) bool
- func (n DropdownOf) HitLeaf(self Widget, p Point) Widget
- func (n DropdownOf) HoverWithin() bool
- func (n DropdownOf) ID() string
- func (n DropdownOf) InlineStyle() string
- func (n DropdownOf) Invalidate()
- func (n DropdownOf) InvalidateLayout()
- func (n DropdownOf) InvalidateRect(r render.Rect)
- func (n DropdownOf) LayoutMotion() LayoutMotion
- func (n DropdownOf) Margin() render.Insets
- func (n DropdownOf) MaximumSize() Size
- func (n DropdownOf) Parent() Widget
- func (n DropdownOf) RemoveAttr(name string)
- func (n DropdownOf) RemoveClass(names ...string)
- func (n DropdownOf) SetAccessibleName(name string)
- func (n DropdownOf) SetAttr(name, value string)
- func (n DropdownOf) SetClass(name string, on bool)
- func (n DropdownOf) SetClasses(names ...string)
- func (n DropdownOf) SetCursorName(s string)
- func (n DropdownOf) SetDebugName(name string)
- func (n DropdownOf) SetElement(name string)
- func (n DropdownOf) SetFocusOnClick(on bool)
- func (n DropdownOf) SetHAlign(a Align)
- func (n DropdownOf) SetHExpand(on bool)
- func (n DropdownOf) SetID(id string)
- func (n DropdownOf) SetInlineStyle(css string)
- func (n DropdownOf) SetInlineStylePriority(css string, priority int)
- func (n DropdownOf) SetLayoutMotion(m LayoutMotion)
- func (n DropdownOf) SetMargin(m render.Insets)
- func (n DropdownOf) SetMaximumSize(w, h int)
- func (n DropdownOf) SetOnClickWithin(fn func())
- func (n DropdownOf) SetOnFocusChanged(fn func(focused bool))
- func (n DropdownOf) SetOnHoverWithin(fn func(on bool))
- func (n DropdownOf) SetOnPointer(fn func(e PointerEvent) bool)
- func (n DropdownOf) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n DropdownOf) SetSharedElement(tag string)
- func (n DropdownOf) SetSizeRequest(w, h int)
- func (n DropdownOf) SetState(flags StateFlags, on bool)
- func (n DropdownOf) SetTooltip(s string)
- func (n DropdownOf) SetTooltipMarkup(markup string)
- func (n DropdownOf) SetVAlign(a Align)
- func (n DropdownOf) SetVExpand(on bool)
- func (n DropdownOf) SetVisible(visible bool)
- func (n DropdownOf) SharedElement() string
- func (n DropdownOf) SizeRequest() Size
- func (n DropdownOf) TooltipMarkup() (string, bool)
- func (n DropdownOf) TooltipText() string
- func (n DropdownOf) VAlign() Align
- func (d *DropdownOf[T]) Value() T
- func (n DropdownOf) Visible() bool
- type DropdownRow
- type Dropper
- type Echo
- type Edge
- type EditableLabel
- func (n EditableLabel) AccessibleName() string
- func (n EditableLabel) AddClass(names ...string)
- func (n EditableLabel) AttachStylesheet(s *Stylesheet)
- func (n EditableLabel) Attr(name string) (string, bool)
- func (n EditableLabel) Bounds() render.Rect
- func (n EditableLabel) Classes() []string
- func (l *EditableLabel) ClickAt(p Point)
- func (l *EditableLabel) CursorName() string
- func (n EditableLabel) DebugName() string
- func (n EditableLabel) DetachStylesheet(s *Stylesheet)
- func (l *EditableLabel) Editing() bool
- func (n EditableLabel) Element() string
- func (n EditableLabel) Enabled() bool
- func (n EditableLabel) HAlign() Align
- func (n EditableLabel) HasClass(name string) bool
- func (n EditableLabel) HasState(flags StateFlags) bool
- func (n EditableLabel) HitLeaf(self Widget, p Point) Widget
- func (n EditableLabel) HoverWithin() bool
- func (n EditableLabel) ID() string
- func (n EditableLabel) InlineStyle() string
- func (n EditableLabel) Invalidate()
- func (n EditableLabel) InvalidateLayout()
- func (n EditableLabel) InvalidateRect(r render.Rect)
- func (l *EditableLabel) KeyAction(a KeyAction, mods Mods)
- func (n EditableLabel) LayoutMotion() LayoutMotion
- func (n EditableLabel) Margin() render.Insets
- func (n EditableLabel) MaximumSize() Size
- func (n EditableLabel) Parent() Widget
- func (n EditableLabel) RemoveAttr(name string)
- func (n EditableLabel) RemoveClass(names ...string)
- func (n EditableLabel) SetAccessibleName(name string)
- func (n EditableLabel) SetAttr(name, value string)
- func (n EditableLabel) SetClass(name string, on bool)
- func (n EditableLabel) SetClasses(names ...string)
- func (n EditableLabel) SetCursorName(s string)
- func (n EditableLabel) SetDebugName(name string)
- func (n EditableLabel) SetElement(name string)
- func (n EditableLabel) SetEnabled(enabled bool)
- func (n EditableLabel) SetFocusOnClick(on bool)
- func (n EditableLabel) SetHAlign(a Align)
- func (n EditableLabel) SetHExpand(on bool)
- func (n EditableLabel) SetID(id string)
- func (n EditableLabel) SetInlineStyle(css string)
- func (n EditableLabel) SetInlineStylePriority(css string, priority int)
- func (n EditableLabel) SetLayoutMotion(m LayoutMotion)
- func (n EditableLabel) SetMargin(m render.Insets)
- func (n EditableLabel) SetMaximumSize(w, h int)
- func (n EditableLabel) SetOnClickWithin(fn func())
- func (n EditableLabel) SetOnFocusChanged(fn func(focused bool))
- func (n EditableLabel) SetOnHoverWithin(fn func(on bool))
- func (n EditableLabel) SetOnPointer(fn func(e PointerEvent) bool)
- func (n EditableLabel) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n EditableLabel) SetSharedElement(tag string)
- func (n EditableLabel) SetSizeRequest(w, h int)
- func (n EditableLabel) SetState(flags StateFlags, on bool)
- func (n EditableLabel) SetTooltip(s string)
- func (n EditableLabel) SetTooltipMarkup(markup string)
- func (n EditableLabel) SetVAlign(a Align)
- func (n EditableLabel) SetVExpand(on bool)
- func (n EditableLabel) SetVisible(visible bool)
- func (n EditableLabel) SharedElement() string
- func (n EditableLabel) SizeRequest() Size
- func (l *EditableLabel) StartEditing()
- func (l *EditableLabel) StopEditing(commit bool)
- func (n EditableLabel) TooltipMarkup() (string, bool)
- func (n EditableLabel) TooltipText() string
- func (n EditableLabel) VAlign() Align
- func (n EditableLabel) Visible() bool
- type Elevation
- func (n *Elevation) AccessibleName() string
- func (n *Elevation) AddClass(names ...string)
- func (e *Elevation) Arrange(r render.Rect)
- func (n *Elevation) AttachStylesheet(s *Stylesheet)
- func (n *Elevation) Attr(name string) (string, bool)
- func (n *Elevation) Bounds() render.Rect
- func (e *Elevation) Child() Widget
- func (e *Elevation) Children() []Widget
- func (n *Elevation) Classes() []string
- func (n *Elevation) DebugName() string
- func (n *Elevation) DetachStylesheet(s *Stylesheet)
- func (n *Elevation) Element() string
- func (n *Elevation) Enabled() bool
- func (n *Elevation) HAlign() Align
- func (n *Elevation) HasClass(name string) bool
- func (n *Elevation) HasState(flags StateFlags) bool
- func (n *Elevation) HitLeaf(self Widget, p Point) Widget
- func (e *Elevation) HitTest(p Point) Widget
- func (n *Elevation) HoverWithin() bool
- func (n *Elevation) ID() string
- func (n *Elevation) InlineStyle() string
- func (n *Elevation) Invalidate()
- func (n *Elevation) InvalidateLayout()
- func (n *Elevation) InvalidateRect(r render.Rect)
- func (n *Elevation) LayoutMotion() LayoutMotion
- func (n *Elevation) Margin() render.Insets
- func (n *Elevation) MaximumSize() Size
- func (e *Elevation) Measure(axis Axis, forSize int) Sizes
- func (e *Elevation) Paint(cv *render.Canvas)
- func (n *Elevation) Parent() Widget
- func (n *Elevation) RemoveAttr(name string)
- func (n *Elevation) RemoveClass(names ...string)
- func (n *Elevation) SetAccessibleName(name string)
- func (n *Elevation) SetAttr(name, value string)
- func (n *Elevation) SetClass(name string, on bool)
- func (n *Elevation) SetClasses(names ...string)
- func (n *Elevation) SetCursorName(s string)
- func (n *Elevation) SetDebugName(name string)
- func (n *Elevation) SetElement(name string)
- func (e *Elevation) SetEnabled(enabled bool)
- func (n *Elevation) SetFocusOnClick(on bool)
- func (n *Elevation) SetHAlign(a Align)
- func (n *Elevation) SetHExpand(on bool)
- func (n *Elevation) SetID(id string)
- func (n *Elevation) SetInlineStyle(css string)
- func (n *Elevation) SetInlineStylePriority(css string, priority int)
- func (n *Elevation) SetLayoutMotion(m LayoutMotion)
- func (n *Elevation) SetMargin(m render.Insets)
- func (n *Elevation) SetMaximumSize(w, h int)
- func (n *Elevation) SetOnClickWithin(fn func())
- func (n *Elevation) SetOnFocusChanged(fn func(focused bool))
- func (n *Elevation) SetOnHoverWithin(fn func(on bool))
- func (n *Elevation) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Elevation) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Elevation) SetSharedElement(tag string)
- func (n *Elevation) SetSizeRequest(w, h int)
- func (n *Elevation) SetState(flags StateFlags, on bool)
- func (n *Elevation) SetTooltip(s string)
- func (n *Elevation) SetTooltipMarkup(markup string)
- func (n *Elevation) SetVAlign(a Align)
- func (n *Elevation) SetVExpand(on bool)
- func (n *Elevation) SetVisible(visible bool)
- func (n *Elevation) SharedElement() string
- func (n *Elevation) SizeRequest() Size
- func (n *Elevation) TooltipMarkup() (string, bool)
- func (n *Elevation) TooltipText() string
- func (n *Elevation) VAlign() Align
- func (n *Elevation) Visible() bool
- func (e *Elevation) WithPlate(c Color) *Elevation
- func (e *Elevation) WithRadius(px int) *Elevation
- type EllipsizeMode
- type Entry
- func (n *Entry) AccessibleName() string
- func (n *Entry) AddClass(names ...string)
- func (e *Entry) Arrange(r render.Rect)
- func (n *Entry) AttachStylesheet(s *Stylesheet)
- func (n *Entry) Attr(name string) (string, bool)
- func (e *Entry) Backspace()
- func (e *Entry) Baseline() (int, bool)
- func (e *Entry) BindText(b *Binding[string]) (unbind func())
- func (n *Entry) Bounds() render.Rect
- func (e *Entry) CharExtents(offset int) (render.Rect, bool)
- func (n *Entry) Classes() []string
- func (e *Entry) ClickAt(p Point)
- func (e *Entry) Color() render.Color
- func (e *Entry) Composing() bool
- func (e *Entry) Cursor() int
- func (e *Entry) CursorName() string
- func (n *Entry) DebugName() string
- func (e *Entry) Delete()
- func (e *Entry) DeleteWordBackward()
- func (e *Entry) DeleteWordForward()
- func (n *Entry) DetachStylesheet(s *Stylesheet)
- func (e *Entry) Direction() Direction
- func (e *Entry) DoubleClickAt(p Point)
- func (e *Entry) DragMove(p Point)
- func (e *Entry) Echo() Echo
- func (e *Entry) EchoReveal(on bool)
- func (n *Entry) Element() string
- func (e *Entry) Ellipsize() EllipsizeMode
- func (n *Entry) Enabled() bool
- func (n *Entry) HAlign() Align
- func (n *Entry) HasClass(name string) bool
- func (n *Entry) HasState(flags StateFlags) bool
- func (n *Entry) HitLeaf(self Widget, p Point) Widget
- func (e *Entry) HitTest(p Point) Widget
- func (n *Entry) HoverWithin() bool
- func (n *Entry) ID() string
- func (e *Entry) IMECommit(text string)
- func (e *Entry) IMECursorRect() render.Rect
- func (e *Entry) IMEDelete(before, after int)
- func (e *Entry) IMEMultiline() bool
- func (e *Entry) IMEPreedit(text string, cursorBegin, cursorEnd int)
- func (e *Entry) IMERevision() IMERevision
- func (e *Entry) IMESurrounding(limit int) (string, int, int)
- func (n *Entry) InlineStyle() string
- func (e *Entry) Insert(s string)
- func (e *Entry) InsertRune(r rune)
- func (n *Entry) Invalidate()
- func (n *Entry) InvalidateLayout()
- func (n *Entry) InvalidateRect(r render.Rect)
- func (e *Entry) KeyAction(a KeyAction, mods Mods)
- func (n *Entry) LayoutMotion() LayoutMotion
- func (e *Entry) LeadingIcon() *Icon
- func (n *Entry) Margin() render.Insets
- func (n *Entry) MaximumSize() Size
- func (e *Entry) Measure(axis Axis, forSize int) Sizes
- func (e *Entry) MoveCursor(delta int)
- func (e *Entry) MoveCursorExtending(delta int)
- func (e *Entry) MoveEnd()
- func (e *Entry) MoveHome()
- func (e *Entry) MoveWord(delta int)
- func (e *Entry) MoveWordExtending(delta int)
- func (e *Entry) OffsetAt(p Point) int
- func (e *Entry) Paint(cv *render.Canvas)
- func (n *Entry) Parent() Widget
- func (e *Entry) Placeholder() string
- func (e *Entry) ReadOnly() bool
- func (e *Entry) Redo() bool
- func (n *Entry) RemoveAttr(name string)
- func (n *Entry) RemoveClass(names ...string)
- func (e *Entry) Revealing() bool
- func (e *Entry) Role() Role
- func (e *Entry) ScrollX() int
- func (e *Entry) Select(start, end int)
- func (e *Entry) SelectAll()
- func (e *Entry) SelectedText() (string, bool)
- func (e *Entry) Selection() (start, end int, active bool)
- func (n *Entry) SetAccessibleName(name string)
- func (n *Entry) SetAttr(name, value string)
- func (e *Entry) SetCaret(offset int)
- func (n *Entry) SetClass(name string, on bool)
- func (n *Entry) SetClasses(names ...string)
- func (e *Entry) SetColor(c render.Color)
- func (n *Entry) SetCursorName(s string)
- func (n *Entry) SetDebugName(name string)
- func (e *Entry) SetDirection(d Direction)
- func (e *Entry) SetEcho(mode Echo)
- func (n *Entry) SetElement(name string)
- func (e *Entry) SetEllipsize(mode EllipsizeMode)
- func (n *Entry) SetEnabled(enabled bool)
- func (n *Entry) SetFocusOnClick(on bool)
- func (n *Entry) SetHAlign(a Align)
- func (n *Entry) SetHExpand(on bool)
- func (n *Entry) SetID(id string)
- func (n *Entry) SetInlineStyle(css string)
- func (n *Entry) SetInlineStylePriority(css string, priority int)
- func (n *Entry) SetLayoutMotion(m LayoutMotion)
- func (e *Entry) SetLeadingIcon(name string, px float64, onClick func())
- func (n *Entry) SetMargin(m render.Insets)
- func (n *Entry) SetMaximumSize(w, h int)
- func (n *Entry) SetOnClickWithin(fn func())
- func (n *Entry) SetOnFocusChanged(fn func(focused bool))
- func (n *Entry) SetOnHoverWithin(fn func(on bool))
- func (n *Entry) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Entry) SetOnScroll(fn func(e ScrollEvent) bool)
- func (e *Entry) SetPlaceholder(s string)
- func (e *Entry) SetReadOnly(ro bool)
- func (n *Entry) SetSharedElement(tag string)
- func (n *Entry) SetSizeRequest(w, h int)
- func (n *Entry) SetState(flags StateFlags, on bool)
- func (e *Entry) SetText(s string)
- func (e *Entry) SetTextWidth(px int)
- func (n *Entry) SetTooltip(s string)
- func (n *Entry) SetTooltipMarkup(markup string)
- func (e *Entry) SetTrailingIcon(name string, px float64, onClick func())
- func (n *Entry) SetVAlign(a Align)
- func (n *Entry) SetVExpand(on bool)
- func (n *Entry) SetVisible(visible bool)
- func (e *Entry) SetWidthChars(minChars, maxChars int)
- func (n *Entry) SharedElement() string
- func (n *Entry) SizeRequest() Size
- func (e *Entry) Text() string
- func (e *Entry) TextWidth() int
- func (n *Entry) TooltipMarkup() (string, bool)
- func (n *Entry) TooltipText() string
- func (e *Entry) TrailingIcon() *Icon
- func (e *Entry) Undo() bool
- func (n *Entry) VAlign() Align
- func (n *Entry) Visible() bool
- func (e *Entry) WidthChars() (minChars, maxChars int)
- type EntryRow
- func (c EntryRow) Arrange(r render.Rect)
- func (c EntryRow) Baseline() (int, bool)
- func (c EntryRow) Children() []Widget
- func (r *EntryRow) Entry() *Entry
- func (c EntryRow) HitTest(p Point) Widget
- func (c EntryRow) Measure(axis Axis, forSize int) Sizes
- func (p EntryRow) PackEnd(w Widget)
- func (p EntryRow) PackStart(w Widget)
- func (r *EntryRow) SetText(s string)
- func (r *EntryRow) Text() string
- type Expander
- func (n *Expander) AccessibleName() string
- func (n *Expander) AddClass(names ...string)
- func (e *Expander) Arrange(r render.Rect)
- func (n *Expander) AttachStylesheet(s *Stylesheet)
- func (n *Expander) Attr(name string) (string, bool)
- func (n *Expander) Bounds() render.Rect
- func (e *Expander) Children() []Widget
- func (n *Expander) Classes() []string
- func (e *Expander) ClickAt(p Point)
- func (n *Expander) DebugName() string
- func (n *Expander) DetachStylesheet(s *Stylesheet)
- func (n *Expander) Element() string
- func (n *Expander) Enabled() bool
- func (n *Expander) HAlign() Align
- func (n *Expander) HasClass(name string) bool
- func (n *Expander) HasState(flags StateFlags) bool
- func (n *Expander) HitLeaf(self Widget, p Point) Widget
- func (e *Expander) HitTest(p Point) Widget
- func (n *Expander) HoverWithin() bool
- func (n *Expander) ID() string
- func (n *Expander) InlineStyle() string
- func (e *Expander) InsertRune(r rune)
- func (n *Expander) Invalidate()
- func (n *Expander) InvalidateLayout()
- func (n *Expander) InvalidateRect(r render.Rect)
- func (e *Expander) KeyAction(a KeyAction, _ Mods)
- func (n *Expander) LayoutMotion() LayoutMotion
- func (n *Expander) Margin() render.Insets
- func (n *Expander) MaximumSize() Size
- func (e *Expander) Measure(axis Axis, forSize int) Sizes
- func (e *Expander) Open() bool
- func (e *Expander) Paint(cv *render.Canvas)
- func (n *Expander) Parent() Widget
- func (n *Expander) RemoveAttr(name string)
- func (n *Expander) RemoveClass(names ...string)
- func (n *Expander) SetAccessibleName(name string)
- func (n *Expander) SetAttr(name, value string)
- func (n *Expander) SetClass(name string, on bool)
- func (n *Expander) SetClasses(names ...string)
- func (n *Expander) SetCursorName(s string)
- func (n *Expander) SetDebugName(name string)
- func (n *Expander) SetElement(name string)
- func (e *Expander) SetEnabled(enabled bool)
- func (n *Expander) SetFocusOnClick(on bool)
- func (n *Expander) SetHAlign(a Align)
- func (n *Expander) SetHExpand(on bool)
- func (e *Expander) SetHovered(on bool)
- func (n *Expander) SetID(id string)
- func (n *Expander) SetInlineStyle(css string)
- func (n *Expander) SetInlineStylePriority(css string, priority int)
- func (n *Expander) SetLayoutMotion(m LayoutMotion)
- func (n *Expander) SetMargin(m render.Insets)
- func (n *Expander) SetMaximumSize(w, h int)
- func (n *Expander) SetOnClickWithin(fn func())
- func (n *Expander) SetOnFocusChanged(fn func(focused bool))
- func (n *Expander) SetOnHoverWithin(fn func(on bool))
- func (n *Expander) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Expander) SetOnScroll(fn func(e ScrollEvent) bool)
- func (e *Expander) SetOpen(open bool)
- func (n *Expander) SetSharedElement(tag string)
- func (n *Expander) SetSizeRequest(w, h int)
- func (n *Expander) SetState(flags StateFlags, on bool)
- func (e *Expander) SetTitle(title string)
- func (n *Expander) SetTooltip(s string)
- func (n *Expander) SetTooltipMarkup(markup string)
- func (n *Expander) SetVAlign(a Align)
- func (n *Expander) SetVExpand(on bool)
- func (n *Expander) SetVisible(visible bool)
- func (n *Expander) SharedElement() string
- func (n *Expander) SizeRequest() Size
- func (e *Expander) Title() string
- func (e *Expander) Toggle()
- func (n *Expander) TooltipMarkup() (string, bool)
- func (n *Expander) TooltipText() string
- func (n *Expander) VAlign() Align
- func (n *Expander) Visible() bool
- type ExpanderRow
- func (r *ExpanderRow) Add(w Widget)
- func (c ExpanderRow) Arrange(r render.Rect)
- func (c ExpanderRow) Baseline() (int, bool)
- func (c ExpanderRow) Children() []Widget
- func (r *ExpanderRow) Expand()
- func (r *ExpanderRow) Expanded() bool
- func (c ExpanderRow) HitTest(p Point) Widget
- func (c ExpanderRow) Measure(axis Axis, forSize int) Sizes
- func (p ExpanderRow) PackEnd(w Widget)
- func (p ExpanderRow) PackStart(w Widget)
- type Fader
- func (n *Fader) AccessibleName() string
- func (n *Fader) AddClass(names ...string)
- func (f *Fader) Arrange(r render.Rect)
- func (f *Fader) ArrangeRoot(r render.Rect)
- func (n *Fader) AttachStylesheet(s *Stylesheet)
- func (n *Fader) Attr(name string) (string, bool)
- func (n *Fader) Bounds() render.Rect
- func (f *Fader) Child() Widget
- func (f *Fader) Children() []Widget
- func (n *Fader) Classes() []string
- func (n *Fader) DebugName() string
- func (n *Fader) DetachStylesheet(s *Stylesheet)
- func (n *Fader) Element() string
- func (n *Fader) Enabled() bool
- func (n *Fader) HAlign() Align
- func (n *Fader) HasClass(name string) bool
- func (n *Fader) HasState(flags StateFlags) bool
- func (n *Fader) HitLeaf(self Widget, p Point) Widget
- func (f *Fader) HitTest(p Point) Widget
- func (n *Fader) HoverWithin() bool
- func (n *Fader) ID() string
- func (n *Fader) InlineStyle() string
- func (n *Fader) Invalidate()
- func (n *Fader) InvalidateLayout()
- func (n *Fader) InvalidateRect(r render.Rect)
- func (n *Fader) LayoutMotion() LayoutMotion
- func (n *Fader) Margin() render.Insets
- func (n *Fader) MaximumSize() Size
- func (f *Fader) Measure(axis Axis, forSize int) Sizes
- func (f *Fader) Paint(cv *render.Canvas)
- func (n *Fader) Parent() Widget
- func (n *Fader) RemoveAttr(name string)
- func (n *Fader) RemoveClass(names ...string)
- func (n *Fader) SetAccessibleName(name string)
- func (n *Fader) SetAttr(name, value string)
- func (n *Fader) SetClass(name string, on bool)
- func (n *Fader) SetClasses(names ...string)
- func (n *Fader) SetCursorName(s string)
- func (n *Fader) SetDebugName(name string)
- func (n *Fader) SetElement(name string)
- func (f *Fader) SetEnabled(enabled bool)
- func (n *Fader) SetFocusOnClick(on bool)
- func (n *Fader) SetHAlign(a Align)
- func (n *Fader) SetHExpand(on bool)
- func (n *Fader) SetID(id string)
- func (n *Fader) SetInlineStyle(css string)
- func (n *Fader) SetInlineStylePriority(css string, priority int)
- func (n *Fader) SetLayoutMotion(m LayoutMotion)
- func (n *Fader) SetMargin(m render.Insets)
- func (n *Fader) SetMaximumSize(w, h int)
- func (n *Fader) SetOnClickWithin(fn func())
- func (n *Fader) SetOnFocusChanged(fn func(focused bool))
- func (n *Fader) SetOnHoverWithin(fn func(on bool))
- func (n *Fader) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Fader) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Fader) SetSharedElement(tag string)
- func (n *Fader) SetSizeRequest(w, h int)
- func (n *Fader) SetState(flags StateFlags, on bool)
- func (n *Fader) SetTooltip(s string)
- func (n *Fader) SetTooltipMarkup(markup string)
- func (n *Fader) SetVAlign(a Align)
- func (n *Fader) SetVExpand(on bool)
- func (n *Fader) SetVisible(visible bool)
- func (n *Fader) SharedElement() string
- func (n *Fader) SizeRequest() Size
- func (n *Fader) TooltipMarkup() (string, bool)
- func (n *Fader) TooltipText() string
- func (n *Fader) VAlign() Align
- func (n *Fader) Visible() bool
- type Field
- func (f *Field) Arrange(r render.Rect)
- func (c *Field) Baseline() (int, bool)
- func (c *Field) Children() []Widget
- func (f *Field) Control() Widget
- func (f *Field) Description() string
- func (f *Field) Error() string
- func (c *Field) HitTest(p Point) Widget
- func (f *Field) Label() string
- func (c *Field) Measure(axis Axis, forSize int) Sizes
- func (f *Field) Orientation() FieldOrientation
- func (c *Field) Paint(cv *render.Canvas)
- func (f *Field) SetDescription(s string)
- func (f *Field) SetError(msg string)
- func (f *Field) SetLabel(s string)
- func (f *Field) SetOrientation(o FieldOrientation)
- type FieldOrientation
- type FieldSet
- func (s *FieldSet) Add(w Widget)
- func (c *FieldSet) Arrange(r render.Rect)
- func (c *FieldSet) Baseline() (int, bool)
- func (c *FieldSet) Children() []Widget
- func (c *FieldSet) HitTest(p Point) Widget
- func (c *FieldSet) Measure(axis Axis, forSize int) Sizes
- func (c *FieldSet) Paint(cv *render.Canvas)
- func (s *FieldSet) SetDescription(text string)
- type FileChooser
- func (c *FileChooser) Apply() ([]string, bool)
- func (c *FileChooser) Arrange(r render.Rect)
- func (c *FileChooser) Baseline() (int, bool)
- func (c *FileChooser) Children() []Widget
- func (c *FileChooser) Dir() string
- func (c *FileChooser) HitTest(p Point) Widget
- func (c *FileChooser) Measure(axis Axis, forSize int) Sizes
- func (c *FileChooser) Paint(cv *render.Canvas)
- func (c *FileChooser) SetRecentsSource(paths func() []string)
- func (c *FileChooser) SetSaveName(name string)
- func (c *FileChooser) SetSource(src DirSource)
- func (c *FileChooser) SetStatus(text string)
- type FileEntry
- type FileFilter
- type FileMode
- type Fixed
- func (n *Fixed) AccessibleName() string
- func (n *Fixed) AddClass(names ...string)
- func (f *Fixed) Arrange(r render.Rect)
- func (f *Fixed) ArrangeRoot(r render.Rect)
- func (n *Fixed) AttachStylesheet(s *Stylesheet)
- func (n *Fixed) Attr(name string) (string, bool)
- func (n *Fixed) Bounds() render.Rect
- func (f *Fixed) Children() []Widget
- func (n *Fixed) Classes() []string
- func (n *Fixed) DebugName() string
- func (n *Fixed) DetachStylesheet(s *Stylesheet)
- func (n *Fixed) Element() string
- func (n *Fixed) Enabled() bool
- func (n *Fixed) HAlign() Align
- func (n *Fixed) HasClass(name string) bool
- func (n *Fixed) HasState(flags StateFlags) bool
- func (n *Fixed) HitLeaf(self Widget, p Point) Widget
- func (f *Fixed) HitTest(p Point) Widget
- func (n *Fixed) HoverWithin() bool
- func (n *Fixed) ID() string
- func (n *Fixed) InlineStyle() string
- func (n *Fixed) Invalidate()
- func (n *Fixed) InvalidateLayout()
- func (n *Fixed) InvalidateRect(r render.Rect)
- func (n *Fixed) LayoutMotion() LayoutMotion
- func (n *Fixed) Margin() render.Insets
- func (n *Fixed) MaximumSize() Size
- func (f *Fixed) Measure(axis Axis, forSize int) Sizes
- func (f *Fixed) Move(w Widget, x, y int) *Fixed
- func (f *Fixed) Paint(cv *render.Canvas)
- func (n *Fixed) Parent() Widget
- func (f *Fixed) Put(w Widget, x, y int) *Fixed
- func (f *Fixed) Remove(w Widget) bool
- func (n *Fixed) RemoveAttr(name string)
- func (n *Fixed) RemoveClass(names ...string)
- func (n *Fixed) SetAccessibleName(name string)
- func (n *Fixed) SetAttr(name, value string)
- func (n *Fixed) SetClass(name string, on bool)
- func (n *Fixed) SetClasses(names ...string)
- func (n *Fixed) SetCursorName(s string)
- func (n *Fixed) SetDebugName(name string)
- func (n *Fixed) SetElement(name string)
- func (f *Fixed) SetEnabled(enabled bool)
- func (n *Fixed) SetFocusOnClick(on bool)
- func (n *Fixed) SetHAlign(a Align)
- func (n *Fixed) SetHExpand(on bool)
- func (n *Fixed) SetID(id string)
- func (n *Fixed) SetInlineStyle(css string)
- func (n *Fixed) SetInlineStylePriority(css string, priority int)
- func (n *Fixed) SetLayoutMotion(m LayoutMotion)
- func (n *Fixed) SetMargin(m render.Insets)
- func (n *Fixed) SetMaximumSize(w, h int)
- func (n *Fixed) SetOnClickWithin(fn func())
- func (n *Fixed) SetOnFocusChanged(fn func(focused bool))
- func (n *Fixed) SetOnHoverWithin(fn func(on bool))
- func (n *Fixed) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Fixed) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Fixed) SetSharedElement(tag string)
- func (n *Fixed) SetSizeRequest(w, h int)
- func (n *Fixed) SetState(flags StateFlags, on bool)
- func (n *Fixed) SetTooltip(s string)
- func (n *Fixed) SetTooltipMarkup(markup string)
- func (n *Fixed) SetVAlign(a Align)
- func (n *Fixed) SetVExpand(on bool)
- func (n *Fixed) SetVisible(visible bool)
- func (n *Fixed) SharedElement() string
- func (n *Fixed) SizeRequest() Size
- func (n *Fixed) TooltipMarkup() (string, bool)
- func (n *Fixed) TooltipText() string
- func (n *Fixed) VAlign() Align
- func (n *Fixed) Visible() bool
- type FlatRow
- type FlatTree
- type FloatingPanel
- func (n *FloatingPanel) AccessibleName() string
- func (n *FloatingPanel) AddClass(names ...string)
- func (f *FloatingPanel) Arrange(r render.Rect)
- func (n *FloatingPanel) AttachStylesheet(s *Stylesheet)
- func (n *FloatingPanel) Attr(name string) (string, bool)
- func (n *FloatingPanel) Bounds() render.Rect
- func (f *FloatingPanel) Children() []Widget
- func (n *FloatingPanel) Classes() []string
- func (f *FloatingPanel) ClickAt(Point)
- func (n *FloatingPanel) DebugName() string
- func (n *FloatingPanel) DetachStylesheet(s *Stylesheet)
- func (n *FloatingPanel) Element() string
- func (n *FloatingPanel) Enabled() bool
- func (n *FloatingPanel) HAlign() Align
- func (n *FloatingPanel) HasClass(name string) bool
- func (n *FloatingPanel) HasState(flags StateFlags) bool
- func (n *FloatingPanel) HitLeaf(self Widget, p Point) Widget
- func (f *FloatingPanel) HitTest(p Point) Widget
- func (n *FloatingPanel) HoverWithin() bool
- func (n *FloatingPanel) ID() string
- func (n *FloatingPanel) InlineStyle() string
- func (f *FloatingPanel) InputRegion() []render.Rect
- func (n *FloatingPanel) Invalidate()
- func (n *FloatingPanel) InvalidateLayout()
- func (n *FloatingPanel) InvalidateRect(r render.Rect)
- func (n *FloatingPanel) LayoutMotion() LayoutMotion
- func (n *FloatingPanel) Margin() render.Insets
- func (n *FloatingPanel) MaximumSize() Size
- func (f *FloatingPanel) Measure(axis Axis, forSize int) Sizes
- func (f *FloatingPanel) Paint(cv *render.Canvas)
- func (f *FloatingPanel) PanelRect() render.Rect
- func (n *FloatingPanel) Parent() Widget
- func (f *FloatingPanel) Recenter()
- func (n *FloatingPanel) RemoveAttr(name string)
- func (n *FloatingPanel) RemoveClass(names ...string)
- func (n *FloatingPanel) SetAccessibleName(name string)
- func (n *FloatingPanel) SetAttr(name, value string)
- func (n *FloatingPanel) SetClass(name string, on bool)
- func (n *FloatingPanel) SetClasses(names ...string)
- func (n *FloatingPanel) SetCursorName(s string)
- func (n *FloatingPanel) SetDebugName(name string)
- func (n *FloatingPanel) SetElement(name string)
- func (n *FloatingPanel) SetEnabled(enabled bool)
- func (n *FloatingPanel) SetFocusOnClick(on bool)
- func (n *FloatingPanel) SetHAlign(a Align)
- func (n *FloatingPanel) SetHExpand(on bool)
- func (n *FloatingPanel) SetID(id string)
- func (n *FloatingPanel) SetInlineStyle(css string)
- func (n *FloatingPanel) SetInlineStylePriority(css string, priority int)
- func (n *FloatingPanel) SetLayoutMotion(m LayoutMotion)
- func (n *FloatingPanel) SetMargin(m render.Insets)
- func (n *FloatingPanel) SetMaximumSize(w, h int)
- func (n *FloatingPanel) SetOnClickWithin(fn func())
- func (n *FloatingPanel) SetOnFocusChanged(fn func(focused bool))
- func (n *FloatingPanel) SetOnHoverWithin(fn func(on bool))
- func (n *FloatingPanel) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *FloatingPanel) SetOnScroll(fn func(e ScrollEvent) bool)
- func (f *FloatingPanel) SetPanelSize(w, h int)
- func (f *FloatingPanel) SetPosition(p Point)
- func (n *FloatingPanel) SetSharedElement(tag string)
- func (f *FloatingPanel) SetSizeLimits(min, max Size)
- func (n *FloatingPanel) SetSizeRequest(w, h int)
- func (n *FloatingPanel) SetState(flags StateFlags, on bool)
- func (n *FloatingPanel) SetTooltip(s string)
- func (n *FloatingPanel) SetTooltipMarkup(markup string)
- func (n *FloatingPanel) SetVAlign(a Align)
- func (n *FloatingPanel) SetVExpand(on bool)
- func (n *FloatingPanel) SetVisible(visible bool)
- func (n *FloatingPanel) SharedElement() string
- func (n *FloatingPanel) SizeRequest() Size
- func (n *FloatingPanel) TooltipMarkup() (string, bool)
- func (n *FloatingPanel) TooltipText() string
- func (n *FloatingPanel) VAlign() Align
- func (n *FloatingPanel) Visible() bool
- type FlowBox
- func (n *FlowBox) AccessibleName() string
- func (n *FlowBox) AddClass(names ...string)
- func (f *FlowBox) Append(w Widget) *FlowBoxChild
- func (f *FlowBox) Arrange(r render.Rect)
- func (n *FlowBox) AttachStylesheet(s *Stylesheet)
- func (n *FlowBox) Attr(name string) (string, bool)
- func (n *FlowBox) Bounds() render.Rect
- func (f *FlowBox) ChildAt(i int) *FlowBoxChild
- func (f *FlowBox) Children() []Widget
- func (n *FlowBox) Classes() []string
- func (f *FlowBox) Clear()
- func (n *FlowBox) DebugName() string
- func (n *FlowBox) DetachStylesheet(s *Stylesheet)
- func (n *FlowBox) Element() string
- func (n *FlowBox) Enabled() bool
- func (n *FlowBox) HAlign() Align
- func (n *FlowBox) HasClass(name string) bool
- func (n *FlowBox) HasState(flags StateFlags) bool
- func (n *FlowBox) HitLeaf(self Widget, p Point) Widget
- func (f *FlowBox) HitTest(p Point) Widget
- func (n *FlowBox) HoverWithin() bool
- func (n *FlowBox) ID() string
- func (f *FlowBox) IndexAt(p Point) int
- func (n *FlowBox) InlineStyle() string
- func (f *FlowBox) Insert(i int, w Widget) *FlowBoxChild
- func (n *FlowBox) Invalidate()
- func (n *FlowBox) InvalidateLayout()
- func (n *FlowBox) InvalidateRect(r render.Rect)
- func (f *FlowBox) KeyAction(a KeyAction, mods Mods)
- func (n *FlowBox) LayoutMotion() LayoutMotion
- func (f *FlowBox) Len() int
- func (n *FlowBox) Margin() render.Insets
- func (n *FlowBox) MaximumSize() Size
- func (f *FlowBox) Measure(axis Axis, forSize int) Sizes
- func (f *FlowBox) Move(from, to int)
- func (f *FlowBox) Paint(cv *render.Canvas)
- func (n *FlowBox) Parent() Widget
- func (f *FlowBox) RemoveAt(i int)
- func (n *FlowBox) RemoveAttr(name string)
- func (n *FlowBox) RemoveClass(names ...string)
- func (s *FlowBox) Select(i int)
- func (s *FlowBox) SelectAll()
- func (s *FlowBox) SelectRows(rows ...int)
- func (s *FlowBox) Selected() int
- func (s *FlowBox) Selection() []int
- func (s *FlowBox) SelectionMode() SelectionMode
- func (n *FlowBox) SetAccessibleName(name string)
- func (n *FlowBox) SetAttr(name, value string)
- func (n *FlowBox) SetClass(name string, on bool)
- func (n *FlowBox) SetClasses(names ...string)
- func (n *FlowBox) SetCursorName(s string)
- func (n *FlowBox) SetDebugName(name string)
- func (n *FlowBox) SetElement(name string)
- func (n *FlowBox) SetEnabled(enabled bool)
- func (n *FlowBox) SetFocusOnClick(on bool)
- func (n *FlowBox) SetHAlign(a Align)
- func (n *FlowBox) SetHExpand(on bool)
- func (n *FlowBox) SetID(id string)
- func (n *FlowBox) SetInlineStyle(css string)
- func (n *FlowBox) SetInlineStylePriority(css string, priority int)
- func (f *FlowBox) SetJustify(j Justify)
- func (n *FlowBox) SetLayoutMotion(m LayoutMotion)
- func (n *FlowBox) SetMargin(m render.Insets)
- func (f *FlowBox) SetMaxChildrenPerLine(n int)
- func (n *FlowBox) SetMaximumSize(w, h int)
- func (n *FlowBox) SetOnClickWithin(fn func())
- func (n *FlowBox) SetOnFocusChanged(fn func(focused bool))
- func (n *FlowBox) SetOnHoverWithin(fn func(on bool))
- func (n *FlowBox) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *FlowBox) SetOnScroll(fn func(e ScrollEvent) bool)
- func (s *FlowBox) SetSelectionMode(mode SelectionMode)
- func (n *FlowBox) SetSharedElement(tag string)
- func (f *FlowBox) SetSingleClickActivate(on bool)
- func (n *FlowBox) SetSizeRequest(w, h int)
- func (n *FlowBox) SetState(flags StateFlags, on bool)
- func (n *FlowBox) SetTooltip(s string)
- func (n *FlowBox) SetTooltipMarkup(markup string)
- func (n *FlowBox) SetVAlign(a Align)
- func (n *FlowBox) SetVExpand(on bool)
- func (n *FlowBox) SetVisible(visible bool)
- func (n *FlowBox) SharedElement() string
- func (n *FlowBox) SizeRequest() Size
- func (n *FlowBox) TooltipMarkup() (string, bool)
- func (n *FlowBox) TooltipText() string
- func (n *FlowBox) VAlign() Align
- func (n *FlowBox) Visible() bool
- type FlowBoxChild
- func (n *FlowBoxChild) AccessibleName() string
- func (n *FlowBoxChild) AddClass(names ...string)
- func (c *FlowBoxChild) Arrange(r render.Rect)
- func (n *FlowBoxChild) AttachStylesheet(s *Stylesheet)
- func (n *FlowBoxChild) Attr(name string) (string, bool)
- func (n *FlowBoxChild) Bounds() render.Rect
- func (c *FlowBoxChild) Child() Widget
- func (c *FlowBoxChild) Children() []Widget
- func (n *FlowBoxChild) Classes() []string
- func (c *FlowBoxChild) ClickAt(Point)
- func (n *FlowBoxChild) DebugName() string
- func (n *FlowBoxChild) DetachStylesheet(s *Stylesheet)
- func (c *FlowBoxChild) DoubleClickAt(Point)
- func (c *FlowBoxChild) DragMove(p Point)
- func (n *FlowBoxChild) Element() string
- func (n *FlowBoxChild) Enabled() bool
- func (n *FlowBoxChild) HAlign() Align
- func (n *FlowBoxChild) HasClass(name string) bool
- func (n *FlowBoxChild) HasState(flags StateFlags) bool
- func (n *FlowBoxChild) HitLeaf(self Widget, p Point) Widget
- func (c *FlowBoxChild) HitTest(p Point) Widget
- func (n *FlowBoxChild) HoverWithin() bool
- func (n *FlowBoxChild) ID() string
- func (c *FlowBoxChild) Index() int
- func (n *FlowBoxChild) InlineStyle() string
- func (n *FlowBoxChild) Invalidate()
- func (n *FlowBoxChild) InvalidateLayout()
- func (n *FlowBoxChild) InvalidateRect(r render.Rect)
- func (c *FlowBoxChild) KeyAction(a KeyAction, mods Mods)
- func (n *FlowBoxChild) LayoutMotion() LayoutMotion
- func (n *FlowBoxChild) Margin() render.Insets
- func (n *FlowBoxChild) MaximumSize() Size
- func (c *FlowBoxChild) Measure(axis Axis, forSize int) Sizes
- func (c *FlowBoxChild) Paint(cv *render.Canvas)
- func (n *FlowBoxChild) Parent() Widget
- func (c *FlowBoxChild) PressEnd()
- func (n *FlowBoxChild) RemoveAttr(name string)
- func (n *FlowBoxChild) RemoveClass(names ...string)
- func (c *FlowBoxChild) SelectAll()
- func (n *FlowBoxChild) SetAccessibleName(name string)
- func (n *FlowBoxChild) SetAttr(name, value string)
- func (n *FlowBoxChild) SetClass(name string, on bool)
- func (n *FlowBoxChild) SetClasses(names ...string)
- func (n *FlowBoxChild) SetCursorName(s string)
- func (n *FlowBoxChild) SetDebugName(name string)
- func (n *FlowBoxChild) SetElement(name string)
- func (n *FlowBoxChild) SetEnabled(enabled bool)
- func (n *FlowBoxChild) SetFocusOnClick(on bool)
- func (n *FlowBoxChild) SetHAlign(a Align)
- func (n *FlowBoxChild) SetHExpand(on bool)
- func (n *FlowBoxChild) SetID(id string)
- func (n *FlowBoxChild) SetInlineStyle(css string)
- func (n *FlowBoxChild) SetInlineStylePriority(css string, priority int)
- func (n *FlowBoxChild) SetLayoutMotion(m LayoutMotion)
- func (n *FlowBoxChild) SetMargin(m render.Insets)
- func (n *FlowBoxChild) SetMaximumSize(w, h int)
- func (n *FlowBoxChild) SetOnClickWithin(fn func())
- func (n *FlowBoxChild) SetOnFocusChanged(fn func(focused bool))
- func (n *FlowBoxChild) SetOnHoverWithin(fn func(on bool))
- func (n *FlowBoxChild) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *FlowBoxChild) SetOnScroll(fn func(e ScrollEvent) bool)
- func (c *FlowBoxChild) SetPressed(on bool)
- func (n *FlowBoxChild) SetSharedElement(tag string)
- func (n *FlowBoxChild) SetSizeRequest(w, h int)
- func (n *FlowBoxChild) SetState(flags StateFlags, on bool)
- func (n *FlowBoxChild) SetTooltip(s string)
- func (n *FlowBoxChild) SetTooltipMarkup(markup string)
- func (n *FlowBoxChild) SetVAlign(a Align)
- func (n *FlowBoxChild) SetVExpand(on bool)
- func (n *FlowBoxChild) SetVisible(visible bool)
- func (n *FlowBoxChild) SharedElement() string
- func (n *FlowBoxChild) SizeRequest() Size
- func (n *FlowBoxChild) TooltipMarkup() (string, bool)
- func (n *FlowBoxChild) TooltipText() string
- func (n *FlowBoxChild) VAlign() Align
- func (n *FlowBoxChild) Visible() bool
- type FocusNavigator
- type FocusObserver
- type FocusTrapper
- type FontButton
- func (n *FontButton) AccessibleName() string
- func (n *FontButton) AddClass(names ...string)
- func (n *FontButton) AttachStylesheet(s *Stylesheet)
- func (n *FontButton) Attr(name string) (string, bool)
- func (b *FontButton) BindFont(binding *Binding[FontChoice]) (unbind func())
- func (n *FontButton) Bounds() render.Rect
- func (b *FontButton) Choose(f FontChoice)
- func (n *FontButton) Classes() []string
- func (n *FontButton) DebugName() string
- func (n *FontButton) DetachStylesheet(s *Stylesheet)
- func (n *FontButton) Element() string
- func (n *FontButton) Enabled() bool
- func (b *FontButton) Font() FontChoice
- func (n *FontButton) HAlign() Align
- func (n *FontButton) HasClass(name string) bool
- func (n *FontButton) HasState(flags StateFlags) bool
- func (n *FontButton) HitLeaf(self Widget, p Point) Widget
- func (n *FontButton) HoverWithin() bool
- func (n *FontButton) ID() string
- func (n *FontButton) InlineStyle() string
- func (n *FontButton) Invalidate()
- func (n *FontButton) InvalidateLayout()
- func (n *FontButton) InvalidateRect(r render.Rect)
- func (n *FontButton) LayoutMotion() LayoutMotion
- func (n *FontButton) Margin() render.Insets
- func (n *FontButton) MaximumSize() Size
- func (n *FontButton) Parent() Widget
- func (n *FontButton) RemoveAttr(name string)
- func (n *FontButton) RemoveClass(names ...string)
- func (n *FontButton) SetAccessibleName(name string)
- func (n *FontButton) SetAttr(name, value string)
- func (n *FontButton) SetClass(name string, on bool)
- func (n *FontButton) SetClasses(names ...string)
- func (n *FontButton) SetCursorName(s string)
- func (n *FontButton) SetDebugName(name string)
- func (n *FontButton) SetElement(name string)
- func (n *FontButton) SetEnabled(enabled bool)
- func (n *FontButton) SetFocusOnClick(on bool)
- func (b *FontButton) SetFont(f FontChoice)
- func (n *FontButton) SetHAlign(a Align)
- func (n *FontButton) SetHExpand(on bool)
- func (n *FontButton) SetID(id string)
- func (n *FontButton) SetInlineStyle(css string)
- func (n *FontButton) SetInlineStylePriority(css string, priority int)
- func (n *FontButton) SetLayoutMotion(m LayoutMotion)
- func (n *FontButton) SetMargin(m render.Insets)
- func (n *FontButton) SetMaximumSize(w, h int)
- func (n *FontButton) SetOnClickWithin(fn func())
- func (n *FontButton) SetOnFocusChanged(fn func(focused bool))
- func (n *FontButton) SetOnHoverWithin(fn func(on bool))
- func (n *FontButton) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *FontButton) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *FontButton) SetSharedElement(tag string)
- func (n *FontButton) SetSizeRequest(w, h int)
- func (n *FontButton) SetState(flags StateFlags, on bool)
- func (n *FontButton) SetTooltip(s string)
- func (n *FontButton) SetTooltipMarkup(markup string)
- func (n *FontButton) SetVAlign(a Align)
- func (n *FontButton) SetVExpand(on bool)
- func (n *FontButton) SetVisible(visible bool)
- func (n *FontButton) SharedElement() string
- func (n *FontButton) SizeRequest() Size
- func (n *FontButton) TooltipMarkup() (string, bool)
- func (n *FontButton) TooltipText() string
- func (n *FontButton) VAlign() Align
- func (n *FontButton) Visible() bool
- type FontChoice
- type Form
- func (f *Form) Add(field *Field, validate func() string)
- func (f *Form) Append(w Widget)
- func (c *Form) Arrange(r render.Rect)
- func (c *Form) Baseline() (int, bool)
- func (c *Form) Children() []Widget
- func (f *Form) FocusMoved(from, to Widget)
- func (c *Form) HitTest(p Point) Widget
- func (f *Form) InterceptKey(target Widget, a KeyAction, _ Mods) bool
- func (c *Form) Measure(axis Axis, forSize int) Sizes
- func (c *Form) Paint(cv *render.Canvas)
- func (f *Form) Submit()
- func (f *Form) Validate() bool
- type Frame
- func (c *Frame) Arrange(r render.Rect)
- func (c *Frame) Baseline() (int, bool)
- func (c *Frame) Children() []Widget
- func (c *Frame) HitTest(p Point) Widget
- func (f *Frame) Label() string
- func (c *Frame) Measure(axis Axis, forSize int) Sizes
- func (c *Frame) Paint(cv *render.Canvas)
- func (f *Frame) SetChild(w Widget)
- func (f *Frame) SetLabel(s string)
- type GPUArea
- func (n *GPUArea) AccessibleName() string
- func (n *GPUArea) AddClass(names ...string)
- func (a *GPUArea) Arrange(r render.Rect)
- func (n *GPUArea) AttachStylesheet(s *Stylesheet)
- func (n *GPUArea) Attr(name string) (string, bool)
- func (n *GPUArea) Bounds() render.Rect
- func (n *GPUArea) Classes() []string
- func (n *GPUArea) DebugName() string
- func (n *GPUArea) DetachStylesheet(s *Stylesheet)
- func (n *GPUArea) Element() string
- func (n *GPUArea) Enabled() bool
- func (a *GPUArea) Err() error
- func (n *GPUArea) HAlign() Align
- func (n *GPUArea) HasClass(name string) bool
- func (n *GPUArea) HasState(flags StateFlags) bool
- func (n *GPUArea) HitLeaf(self Widget, p Point) Widget
- func (a *GPUArea) HitTest(p Point) Widget
- func (n *GPUArea) HoverWithin() bool
- func (n *GPUArea) ID() string
- func (a *GPUArea) Import(b dmabuf.Buffer) (GPUBuffer, error)
- func (n *GPUArea) InlineStyle() string
- func (n *GPUArea) Invalidate()
- func (n *GPUArea) InvalidateLayout()
- func (n *GPUArea) InvalidateRect(r render.Rect)
- func (n *GPUArea) LayoutMotion() LayoutMotion
- func (n *GPUArea) Margin() render.Insets
- func (n *GPUArea) MaximumSize() Size
- func (a *GPUArea) Measure(axis Axis, forSize int) Sizes
- func (a *GPUArea) Paint(cv *render.Canvas)
- func (n *GPUArea) Parent() Widget
- func (a *GPUArea) Present(b GPUBuffer) error
- func (a *GPUArea) PresentImage(img *image.RGBA) error
- func (a *GPUArea) QueueFrame()
- func (n *GPUArea) RemoveAttr(name string)
- func (n *GPUArea) RemoveClass(names ...string)
- func (n *GPUArea) SetAccessibleName(name string)
- func (n *GPUArea) SetAttr(name, value string)
- func (n *GPUArea) SetClass(name string, on bool)
- func (n *GPUArea) SetClasses(names ...string)
- func (n *GPUArea) SetCursorName(s string)
- func (n *GPUArea) SetDebugName(name string)
- func (n *GPUArea) SetElement(name string)
- func (n *GPUArea) SetEnabled(enabled bool)
- func (n *GPUArea) SetFocusOnClick(on bool)
- func (n *GPUArea) SetHAlign(a Align)
- func (n *GPUArea) SetHExpand(on bool)
- func (n *GPUArea) SetID(id string)
- func (n *GPUArea) SetInlineStyle(css string)
- func (n *GPUArea) SetInlineStylePriority(css string, priority int)
- func (n *GPUArea) SetLayoutMotion(m LayoutMotion)
- func (n *GPUArea) SetMargin(m render.Insets)
- func (n *GPUArea) SetMaximumSize(w, h int)
- func (n *GPUArea) SetOnClickWithin(fn func())
- func (n *GPUArea) SetOnFocusChanged(fn func(focused bool))
- func (n *GPUArea) SetOnHoverWithin(fn func(on bool))
- func (n *GPUArea) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *GPUArea) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *GPUArea) SetSharedElement(tag string)
- func (n *GPUArea) SetSizeRequest(w, h int)
- func (n *GPUArea) SetState(flags StateFlags, on bool)
- func (n *GPUArea) SetTooltip(s string)
- func (n *GPUArea) SetTooltipMarkup(markup string)
- func (n *GPUArea) SetVAlign(a Align)
- func (n *GPUArea) SetVExpand(on bool)
- func (n *GPUArea) SetVisible(visible bool)
- func (n *GPUArea) SharedElement() string
- func (n *GPUArea) SizeRequest() Size
- func (n *GPUArea) TooltipMarkup() (string, bool)
- func (n *GPUArea) TooltipText() string
- func (n *GPUArea) VAlign() Align
- func (n *GPUArea) Visible() bool
- type GPUBuffer
- type GPUFrame
- type GPUSurface
- type Gesture
- type GestureHandler
- type GestureKind
- type GesturePhase
- type Grid
- func (n *Grid) AccessibleName() string
- func (n *Grid) AddClass(names ...string)
- func (g *Grid) Arrange(r render.Rect)
- func (g *Grid) ArrangeRoot(r render.Rect)
- func (g *Grid) Attach(w Widget, col, row, colSpan, rowSpan int) *Grid
- func (n *Grid) AttachStylesheet(s *Stylesheet)
- func (n *Grid) Attr(name string) (string, bool)
- func (n *Grid) Bounds() render.Rect
- func (g *Grid) Children() []Widget
- func (n *Grid) Classes() []string
- func (g *Grid) ColumnHomogeneous() bool
- func (g *Grid) ColumnSpacing() int
- func (n *Grid) DebugName() string
- func (n *Grid) DetachStylesheet(s *Stylesheet)
- func (n *Grid) Element() string
- func (n *Grid) Enabled() bool
- func (n *Grid) HAlign() Align
- func (n *Grid) HasClass(name string) bool
- func (n *Grid) HasState(flags StateFlags) bool
- func (n *Grid) HitLeaf(self Widget, p Point) Widget
- func (g *Grid) HitTest(p Point) Widget
- func (n *Grid) HoverWithin() bool
- func (n *Grid) ID() string
- func (n *Grid) InlineStyle() string
- func (n *Grid) Invalidate()
- func (n *Grid) InvalidateLayout()
- func (n *Grid) InvalidateRect(r render.Rect)
- func (n *Grid) LayoutMotion() LayoutMotion
- func (n *Grid) Margin() render.Insets
- func (n *Grid) MaximumSize() Size
- func (g *Grid) Measure(axis Axis, forSize int) Sizes
- func (g *Grid) Paint(cv *render.Canvas)
- func (n *Grid) Parent() Widget
- func (g *Grid) Place(w Widget, col, row, colSpan, rowSpan int) *Grid
- func (g *Grid) Remove(w Widget) bool
- func (n *Grid) RemoveAttr(name string)
- func (n *Grid) RemoveClass(names ...string)
- func (g *Grid) RowHomogeneous() bool
- func (g *Grid) RowSpacing() int
- func (n *Grid) SetAccessibleName(name string)
- func (g *Grid) SetAlign(w Widget, h, v Align) *Grid
- func (n *Grid) SetAttr(name, value string)
- func (n *Grid) SetClass(name string, on bool)
- func (n *Grid) SetClasses(names ...string)
- func (g *Grid) SetColumnHomogeneous(h bool) *Grid
- func (g *Grid) SetColumnSpacing(n int) *Grid
- func (n *Grid) SetCursorName(s string)
- func (n *Grid) SetDebugName(name string)
- func (n *Grid) SetElement(name string)
- func (g *Grid) SetEnabled(enabled bool)
- func (n *Grid) SetFocusOnClick(on bool)
- func (n *Grid) SetHAlign(a Align)
- func (n *Grid) SetHExpand(on bool)
- func (n *Grid) SetID(id string)
- func (n *Grid) SetInlineStyle(css string)
- func (n *Grid) SetInlineStylePriority(css string, priority int)
- func (n *Grid) SetLayoutMotion(m LayoutMotion)
- func (n *Grid) SetMargin(m render.Insets)
- func (n *Grid) SetMaximumSize(w, h int)
- func (n *Grid) SetOnClickWithin(fn func())
- func (n *Grid) SetOnFocusChanged(fn func(focused bool))
- func (n *Grid) SetOnHoverWithin(fn func(on bool))
- func (n *Grid) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Grid) SetOnScroll(fn func(e ScrollEvent) bool)
- func (g *Grid) SetRowHomogeneous(h bool) *Grid
- func (g *Grid) SetRowSpacing(n int) *Grid
- func (n *Grid) SetSharedElement(tag string)
- func (n *Grid) SetSizeRequest(w, h int)
- func (n *Grid) SetState(flags StateFlags, on bool)
- func (n *Grid) SetTooltip(s string)
- func (n *Grid) SetTooltipMarkup(markup string)
- func (n *Grid) SetVAlign(a Align)
- func (n *Grid) SetVExpand(on bool)
- func (n *Grid) SetVisible(visible bool)
- func (n *Grid) SharedElement() string
- func (n *Grid) SizeRequest() Size
- func (n *Grid) TooltipMarkup() (string, bool)
- func (n *Grid) TooltipText() string
- func (n *Grid) VAlign() Align
- func (n *Grid) Visible() bool
- type GridView
- func (n *GridView) AccessibleName() string
- func (n *GridView) AddClass(names ...string)
- func (n *GridView) AttachStylesheet(s *Stylesheet)
- func (n *GridView) Attr(name string) (string, bool)
- func (n *GridView) Bounds() render.Rect
- func (n *GridView) Classes() []string
- func (g *GridView) ColumnSpacing() int
- func (g *GridView) Columns() int
- func (n *GridView) DebugName() string
- func (n *GridView) DetachStylesheet(s *Stylesheet)
- func (n *GridView) Element() string
- func (n *GridView) Enabled() bool
- func (n *GridView) HAlign() Align
- func (n *GridView) HasClass(name string) bool
- func (n *GridView) HasState(flags StateFlags) bool
- func (n *GridView) HitLeaf(self Widget, p Point) Widget
- func (n *GridView) HoverWithin() bool
- func (n *GridView) ID() string
- func (n *GridView) InlineStyle() string
- func (n *GridView) Invalidate()
- func (n *GridView) InvalidateLayout()
- func (n *GridView) InvalidateRect(r render.Rect)
- func (n *GridView) LayoutMotion() LayoutMotion
- func (n *GridView) Margin() render.Insets
- func (g *GridView) MaxColumns() int
- func (n *GridView) MaximumSize() Size
- func (g *GridView) MinColumns() int
- func (n *GridView) Parent() Widget
- func (n *GridView) RemoveAttr(name string)
- func (n *GridView) RemoveClass(names ...string)
- func (g *GridView) RowSpacing() int
- func (s *GridView) Select(i int)
- func (s *GridView) SelectAll()
- func (s *GridView) SelectRows(rows ...int)
- func (s *GridView) Selected() int
- func (s *GridView) Selection() []int
- func (s *GridView) SelectionMode() SelectionMode
- func (n *GridView) SetAccessibleName(name string)
- func (n *GridView) SetAttr(name, value string)
- func (n *GridView) SetClass(name string, on bool)
- func (n *GridView) SetClasses(names ...string)
- func (g *GridView) SetColumnSpacing(n int)
- func (n *GridView) SetCursorName(s string)
- func (n *GridView) SetDebugName(name string)
- func (n *GridView) SetElement(name string)
- func (n *GridView) SetEnabled(enabled bool)
- func (n *GridView) SetFocusOnClick(on bool)
- func (n *GridView) SetHAlign(a Align)
- func (n *GridView) SetHExpand(on bool)
- func (n *GridView) SetID(id string)
- func (n *GridView) SetInlineStyle(css string)
- func (n *GridView) SetInlineStylePriority(css string, priority int)
- func (n *GridView) SetLayoutMotion(m LayoutMotion)
- func (n *GridView) SetMargin(m render.Insets)
- func (g *GridView) SetMaxColumns(n int)
- func (n *GridView) SetMaximumSize(w, h int)
- func (g *GridView) SetMinColumns(n int)
- func (n *GridView) SetOnClickWithin(fn func())
- func (n *GridView) SetOnFocusChanged(fn func(focused bool))
- func (n *GridView) SetOnHoverWithin(fn func(on bool))
- func (n *GridView) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *GridView) SetOnScroll(fn func(e ScrollEvent) bool)
- func (g *GridView) SetRowSpacing(n int)
- func (s *GridView) SetSelectionMode(mode SelectionMode)
- func (n *GridView) SetSharedElement(tag string)
- func (n *GridView) SetSizeRequest(w, h int)
- func (n *GridView) SetState(flags StateFlags, on bool)
- func (n *GridView) SetTooltip(s string)
- func (n *GridView) SetTooltipMarkup(markup string)
- func (n *GridView) SetVAlign(a Align)
- func (n *GridView) SetVExpand(on bool)
- func (n *GridView) SetVisible(visible bool)
- func (n *GridView) SharedElement() string
- func (n *GridView) SizeRequest() Size
- func (n *GridView) TooltipMarkup() (string, bool)
- func (n *GridView) TooltipText() string
- func (n *GridView) VAlign() Align
- func (n *GridView) Visible() bool
- type HeaderBar
- func (c *HeaderBar) Arrange(r render.Rect)
- func (c *HeaderBar) Baseline() (int, bool)
- func (c *HeaderBar) Children() []Widget
- func (h *HeaderBar) Controls() *WindowControls
- func (h *HeaderBar) HitTest(p Point) Widget
- func (c *HeaderBar) Measure(axis Axis, forSize int) Sizes
- func (p *HeaderBar) PackEnd(w Widget)
- func (p *HeaderBar) PackStart(w Widget)
- func (c *HeaderBar) Paint(cv *render.Canvas)
- func (h *HeaderBar) SetSubtitle(s string)
- func (h *HeaderBar) SetTitle(t string)
- func (h *HeaderBar) WindowDoubleClick()
- func (h *HeaderBar) WindowMoveGrab() bool
- type Highlighter
- type HoverCard
- func (c *HoverCard) Arrange(r render.Rect)
- func (c *HoverCard) Baseline() (int, bool)
- func (c *HoverCard) Children() []Widget
- func (h *HoverCard) FocusMoved(_, to Widget)
- func (c *HoverCard) HitTest(p Point) Widget
- func (c *HoverCard) Measure(axis Axis, forSize int) Sizes
- func (h *HoverCard) Open() bool
- func (c *HoverCard) Paint(cv *render.Canvas)
- type HoverMover
- type HoverSetter
- type IMEClient
- type IMERevision
- type IMETracker
- type Icon
- func (n *Icon) AccessibleName() string
- func (n *Icon) AddClass(names ...string)
- func (i *Icon) Arrange(r render.Rect)
- func (n *Icon) AttachStylesheet(s *Stylesheet)
- func (n *Icon) Attr(name string) (string, bool)
- func (n *Icon) Bounds() render.Rect
- func (n *Icon) Classes() []string
- func (n *Icon) DebugName() string
- func (n *Icon) DetachStylesheet(s *Stylesheet)
- func (n *Icon) Element() string
- func (n *Icon) Enabled() bool
- func (i *Icon) Err() error
- func (n *Icon) HAlign() Align
- func (n *Icon) HasClass(name string) bool
- func (n *Icon) HasState(flags StateFlags) bool
- func (n *Icon) HitLeaf(self Widget, p Point) Widget
- func (i *Icon) HitTest(p Point) Widget
- func (n *Icon) HoverWithin() bool
- func (n *Icon) ID() string
- func (n *Icon) InlineStyle() string
- func (n *Icon) Invalidate()
- func (n *Icon) InvalidateLayout()
- func (n *Icon) InvalidateRect(r render.Rect)
- func (n *Icon) LayoutMotion() LayoutMotion
- func (n *Icon) Margin() render.Insets
- func (n *Icon) MaximumSize() Size
- func (i *Icon) Measure(axis Axis, forSize int) Sizes
- func (i *Icon) Name() string
- func (i *Icon) Paint(cv *render.Canvas)
- func (n *Icon) Parent() Widget
- func (n *Icon) RemoveAttr(name string)
- func (n *Icon) RemoveClass(names ...string)
- func (n *Icon) SetAccessibleName(name string)
- func (n *Icon) SetAttr(name, value string)
- func (n *Icon) SetClass(name string, on bool)
- func (n *Icon) SetClasses(names ...string)
- func (n *Icon) SetCursorName(s string)
- func (n *Icon) SetDebugName(name string)
- func (n *Icon) SetElement(name string)
- func (n *Icon) SetEnabled(enabled bool)
- func (n *Icon) SetFocusOnClick(on bool)
- func (n *Icon) SetHAlign(a Align)
- func (n *Icon) SetHExpand(on bool)
- func (n *Icon) SetID(id string)
- func (n *Icon) SetInlineStyle(css string)
- func (n *Icon) SetInlineStylePriority(css string, priority int)
- func (n *Icon) SetLayoutMotion(m LayoutMotion)
- func (n *Icon) SetMargin(m render.Insets)
- func (n *Icon) SetMaximumSize(w, h int)
- func (n *Icon) SetOnClickWithin(fn func())
- func (n *Icon) SetOnFocusChanged(fn func(focused bool))
- func (n *Icon) SetOnHoverWithin(fn func(on bool))
- func (n *Icon) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Icon) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Icon) SetSharedElement(tag string)
- func (n *Icon) SetSizeRequest(w, h int)
- func (n *Icon) SetState(flags StateFlags, on bool)
- func (i *Icon) SetThemeName(name string)
- func (i *Icon) SetTint(tint Color)
- func (n *Icon) SetTooltip(s string)
- func (n *Icon) SetTooltipMarkup(markup string)
- func (n *Icon) SetVAlign(a Align)
- func (n *Icon) SetVExpand(on bool)
- func (n *Icon) SetVisible(visible bool)
- func (n *Icon) SharedElement() string
- func (n *Icon) SizeRequest() Size
- func (i *Icon) Tint() Color
- func (n *Icon) TooltipMarkup() (string, bool)
- func (n *Icon) TooltipText() string
- func (n *Icon) VAlign() Align
- func (n *Icon) Visible() bool
- type IconPosition
- type Image
- func (n *Image) AccessibleName() string
- func (n *Image) AddClass(names ...string)
- func (im *Image) Arrange(r render.Rect)
- func (n *Image) AttachStylesheet(s *Stylesheet)
- func (n *Image) Attr(name string) (string, bool)
- func (n *Image) Bounds() render.Rect
- func (n *Image) Classes() []string
- func (n *Image) DebugName() string
- func (n *Image) DetachStylesheet(s *Stylesheet)
- func (n *Image) Element() string
- func (n *Image) Enabled() bool
- func (im *Image) Err() error
- func (im *Image) Frame() int
- func (n *Image) HAlign() Align
- func (n *Image) HasClass(name string) bool
- func (n *Image) HasState(flags StateFlags) bool
- func (n *Image) HitLeaf(self Widget, p Point) Widget
- func (im *Image) HitTest(p Point) Widget
- func (n *Image) HoverWithin() bool
- func (n *Image) ID() string
- func (n *Image) InlineStyle() string
- func (n *Image) Invalidate()
- func (n *Image) InvalidateLayout()
- func (n *Image) InvalidateRect(r render.Rect)
- func (im *Image) KeyAction(KeyAction, Mods)
- func (n *Image) LayoutMotion() LayoutMotion
- func (im *Image) Loaded() bool
- func (n *Image) Margin() render.Insets
- func (n *Image) MaximumSize() Size
- func (im *Image) Measure(axis Axis, forSize int) Sizes
- func (im *Image) Paint(cv *render.Canvas)
- func (n *Image) Parent() Widget
- func (im *Image) PasteContent(mime string, data []byte)
- func (im *Image) PasteImage(data []byte, mime string)
- func (im *Image) PasteMimes() []string
- func (im *Image) PlaceholderColor() Color
- func (n *Image) RemoveAttr(name string)
- func (n *Image) RemoveClass(names ...string)
- func (im *Image) Scale() ImageScale
- func (n *Image) SetAccessibleName(name string)
- func (n *Image) SetAttr(name, value string)
- func (n *Image) SetClass(name string, on bool)
- func (n *Image) SetClasses(names ...string)
- func (n *Image) SetCursorName(s string)
- func (n *Image) SetDebugName(name string)
- func (n *Image) SetElement(name string)
- func (n *Image) SetEnabled(enabled bool)
- func (im *Image) SetFile(path string)
- func (n *Image) SetFocusOnClick(on bool)
- func (n *Image) SetHAlign(a Align)
- func (n *Image) SetHExpand(on bool)
- func (n *Image) SetID(id string)
- func (im *Image) SetImage(img image.Image)
- func (n *Image) SetInlineStyle(css string)
- func (n *Image) SetInlineStylePriority(css string, priority int)
- func (n *Image) SetLayoutMotion(m LayoutMotion)
- func (n *Image) SetMargin(m render.Insets)
- func (n *Image) SetMaximumSize(w, h int)
- func (n *Image) SetOnClickWithin(fn func())
- func (n *Image) SetOnFocusChanged(fn func(focused bool))
- func (n *Image) SetOnHoverWithin(fn func(on bool))
- func (n *Image) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Image) SetOnScroll(fn func(e ScrollEvent) bool)
- func (im *Image) SetPlaceholderColor(c Color)
- func (im *Image) SetScale(s ImageScale)
- func (n *Image) SetSharedElement(tag string)
- func (n *Image) SetSizeRequest(w, h int)
- func (n *Image) SetState(flags StateFlags, on bool)
- func (n *Image) SetTooltip(s string)
- func (n *Image) SetTooltipMarkup(markup string)
- func (im *Image) SetURL(url string)
- func (n *Image) SetVAlign(a Align)
- func (n *Image) SetVExpand(on bool)
- func (n *Image) SetVisible(visible bool)
- func (n *Image) SharedElement() string
- func (n *Image) SizeRequest() Size
- func (n *Image) TooltipMarkup() (string, bool)
- func (n *Image) TooltipText() string
- func (n *Image) VAlign() Align
- func (n *Image) Visible() bool
- type ImageScale
- type InputGroup
- func (g *InputGroup) Append(w Widget)
- func (c *InputGroup) Arrange(r render.Rect)
- func (c *InputGroup) Baseline() (int, bool)
- func (c *InputGroup) Children() []Widget
- func (g *InputGroup) Entry() *Entry
- func (c *InputGroup) HitTest(p Point) Widget
- func (c *InputGroup) Measure(axis Axis, forSize int) Sizes
- func (c *InputGroup) Paint(cv *render.Canvas)
- func (g *InputGroup) Prepend(w Widget)
- type InputOTP
- func (c *InputOTP) Arrange(r render.Rect)
- func (c *InputOTP) Baseline() (int, bool)
- func (c *InputOTP) Children() []Widget
- func (o *InputOTP) ClickAt(p Point)
- func (o *InputOTP) Code() string
- func (o *InputOTP) HitTest(p Point) Widget
- func (o *InputOTP) Insert(s string)
- func (o *InputOTP) InsertRune(r rune)
- func (o *InputOTP) KeyAction(a KeyAction, _ Mods)
- func (o *InputOTP) Len() int
- func (c *InputOTP) Measure(axis Axis, forSize int) Sizes
- func (o *InputOTP) Paint(cv *render.Canvas)
- func (o *InputOTP) Role() Role
- func (o *InputOTP) SetCode(s string)
- type InputRegioner
- type Inscription
- func (n *Inscription) AccessibleName() string
- func (n *Inscription) AddClass(names ...string)
- func (in *Inscription) Arrange(r render.Rect)
- func (n *Inscription) AttachStylesheet(s *Stylesheet)
- func (n *Inscription) Attr(name string) (string, bool)
- func (n *Inscription) Bounds() render.Rect
- func (n *Inscription) Classes() []string
- func (n *Inscription) DebugName() string
- func (n *Inscription) DetachStylesheet(s *Stylesheet)
- func (n *Inscription) Element() string
- func (n *Inscription) Enabled() bool
- func (n *Inscription) HAlign() Align
- func (n *Inscription) HasClass(name string) bool
- func (n *Inscription) HasState(flags StateFlags) bool
- func (n *Inscription) HitLeaf(self Widget, p Point) Widget
- func (in *Inscription) HitTest(p Point) Widget
- func (n *Inscription) HoverWithin() bool
- func (n *Inscription) ID() string
- func (n *Inscription) InlineStyle() string
- func (n *Inscription) Invalidate()
- func (n *Inscription) InvalidateLayout()
- func (n *Inscription) InvalidateRect(r render.Rect)
- func (n *Inscription) LayoutMotion() LayoutMotion
- func (n *Inscription) Margin() render.Insets
- func (n *Inscription) MaximumSize() Size
- func (in *Inscription) Measure(axis Axis, forSize int) Sizes
- func (in *Inscription) Paint(cv *render.Canvas)
- func (n *Inscription) Parent() Widget
- func (n *Inscription) RemoveAttr(name string)
- func (n *Inscription) RemoveClass(names ...string)
- func (in *Inscription) Role() Role
- func (n *Inscription) SetAccessibleName(name string)
- func (in *Inscription) SetAlignment(a render.Alignment)
- func (n *Inscription) SetAttr(name, value string)
- func (n *Inscription) SetClass(name string, on bool)
- func (n *Inscription) SetClasses(names ...string)
- func (in *Inscription) SetColor(c render.Color)
- func (n *Inscription) SetCursorName(s string)
- func (n *Inscription) SetDebugName(name string)
- func (n *Inscription) SetElement(name string)
- func (n *Inscription) SetEnabled(enabled bool)
- func (n *Inscription) SetFocusOnClick(on bool)
- func (n *Inscription) SetHAlign(a Align)
- func (n *Inscription) SetHExpand(on bool)
- func (n *Inscription) SetID(id string)
- func (n *Inscription) SetInlineStyle(css string)
- func (n *Inscription) SetInlineStylePriority(css string, priority int)
- func (n *Inscription) SetLayoutMotion(m LayoutMotion)
- func (n *Inscription) SetMargin(m render.Insets)
- func (n *Inscription) SetMaximumSize(w, h int)
- func (in *Inscription) SetMinChars(n int)
- func (in *Inscription) SetMinLines(n int)
- func (in *Inscription) SetNatChars(n int)
- func (in *Inscription) SetNatLines(n int)
- func (n *Inscription) SetOnClickWithin(fn func())
- func (n *Inscription) SetOnFocusChanged(fn func(focused bool))
- func (n *Inscription) SetOnHoverWithin(fn func(on bool))
- func (n *Inscription) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Inscription) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Inscription) SetSharedElement(tag string)
- func (n *Inscription) SetSizeRequest(w, h int)
- func (n *Inscription) SetState(flags StateFlags, on bool)
- func (in *Inscription) SetText(s string)
- func (n *Inscription) SetTooltip(s string)
- func (n *Inscription) SetTooltipMarkup(markup string)
- func (n *Inscription) SetVAlign(a Align)
- func (n *Inscription) SetVExpand(on bool)
- func (n *Inscription) SetVisible(visible bool)
- func (n *Inscription) SharedElement() string
- func (n *Inscription) SizeRequest() Size
- func (in *Inscription) Text() string
- func (n *Inscription) TooltipMarkup() (string, bool)
- func (n *Inscription) TooltipText() string
- func (n *Inscription) VAlign() Align
- func (n *Inscription) Visible() bool
- type Item
- func (it *Item) AddAction(w Widget)
- func (c *Item) Arrange(r render.Rect)
- func (c *Item) Baseline() (int, bool)
- func (c *Item) Children() []Widget
- func (it *Item) ClickAt(Point)
- func (it *Item) HitTest(p Point) Widget
- func (it *Item) KeyAction(a KeyAction, _ Mods)
- func (c *Item) Measure(axis Axis, forSize int) Sizes
- func (c *Item) Paint(cv *render.Canvas)
- func (it *Item) SetDescription(description string)
- func (it *Item) SetEllipsize(on bool)
- func (it *Item) SetMedia(w Widget, bare bool)
- func (it *Item) SetOnActivate(fn func())
- func (it *Item) SetSmall(on bool)
- func (it *Item) SetTitle(title string)
- func (it *Item) SetVariant(v ItemVariant)
- type ItemGroup
- func (g *ItemGroup) Append(w Widget)
- func (c *ItemGroup) Arrange(r render.Rect)
- func (c *ItemGroup) Baseline() (int, bool)
- func (c *ItemGroup) Children() []Widget
- func (g *ItemGroup) Clear()
- func (c *ItemGroup) HitTest(p Point) Widget
- func (g *ItemGroup) Measure(axis Axis, forSize int) Sizes
- func (c *ItemGroup) Paint(cv *render.Canvas)
- func (g *ItemGroup) Remove(w Widget) bool
- type ItemKind
- type ItemVariant
- type Justify
- type KeyAction
- type KeyActionHandler
- type KeyInterceptor
- type Label
- func (n *Label) AccessibleName() string
- func (n *Label) AddClass(names ...string)
- func (l *Label) Alignment() render.Alignment
- func (l *Label) Arrange(r render.Rect)
- func (n *Label) AttachStylesheet(s *Stylesheet)
- func (n *Label) Attr(name string) (string, bool)
- func (l *Label) Baseline() (int, bool)
- func (l *Label) BindText(b *Binding[string]) (unbind func())
- func (n *Label) Bounds() render.Rect
- func (l *Label) CharsWithin(px int) int
- func (n *Label) Classes() []string
- func (l *Label) Color() render.Color
- func (n *Label) DebugName() string
- func (n *Label) DetachStylesheet(s *Stylesheet)
- func (l *Label) Direction() Direction
- func (n *Label) Element() string
- func (l *Label) Ellipsize() EllipsizeMode
- func (n *Label) Enabled() bool
- func (n *Label) HAlign() Align
- func (n *Label) HasClass(name string) bool
- func (n *Label) HasState(flags StateFlags) bool
- func (n *Label) HitLeaf(self Widget, p Point) Widget
- func (l *Label) HitTest(p Point) Widget
- func (n *Label) HoverWithin() bool
- func (n *Label) ID() string
- func (n *Label) InlineStyle() string
- func (n *Label) Invalidate()
- func (n *Label) InvalidateLayout()
- func (n *Label) InvalidateRect(r render.Rect)
- func (n *Label) LayoutMotion() LayoutMotion
- func (n *Label) Margin() render.Insets
- func (l *Label) MaxLines() int
- func (l *Label) MaxWidthChars() int
- func (n *Label) MaximumSize() Size
- func (l *Label) Measure(axis Axis, forSize int) Sizes
- func (l *Label) Paint(cv *render.Canvas)
- func (n *Label) Parent() Widget
- func (n *Label) RemoveAttr(name string)
- func (n *Label) RemoveClass(names ...string)
- func (l *Label) Role() Role
- func (n *Label) SetAccessibleName(name string)
- func (l *Label) SetAlignment(a render.Alignment)
- func (n *Label) SetAttr(name, value string)
- func (n *Label) SetClass(name string, on bool)
- func (n *Label) SetClasses(names ...string)
- func (l *Label) SetColor(c render.Color)
- func (n *Label) SetCursorName(s string)
- func (n *Label) SetDebugName(name string)
- func (l *Label) SetDirection(d Direction)
- func (n *Label) SetElement(name string)
- func (l *Label) SetEllipsize(mode EllipsizeMode)
- func (n *Label) SetEnabled(enabled bool)
- func (l *Label) SetFace(face render.Font)
- func (n *Label) SetFocusOnClick(on bool)
- func (n *Label) SetHAlign(a Align)
- func (n *Label) SetHExpand(on bool)
- func (n *Label) SetID(id string)
- func (n *Label) SetInlineStyle(css string)
- func (n *Label) SetInlineStylePriority(css string, priority int)
- func (n *Label) SetLayoutMotion(m LayoutMotion)
- func (n *Label) SetMargin(m render.Insets)
- func (l *Label) SetMaxLines(n int)
- func (l *Label) SetMaxWidthChars(n int)
- func (n *Label) SetMaximumSize(w, h int)
- func (n *Label) SetOnClickWithin(fn func())
- func (n *Label) SetOnFocusChanged(fn func(focused bool))
- func (n *Label) SetOnHoverWithin(fn func(on bool))
- func (n *Label) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Label) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Label) SetSharedElement(tag string)
- func (l *Label) SetSizePx(px float64)
- func (n *Label) SetSizeRequest(w, h int)
- func (n *Label) SetState(flags StateFlags, on bool)
- func (l *Label) SetText(text string)
- func (n *Label) SetTooltip(s string)
- func (n *Label) SetTooltipMarkup(markup string)
- func (n *Label) SetVAlign(a Align)
- func (n *Label) SetVExpand(on bool)
- func (n *Label) SetVisible(visible bool)
- func (l *Label) SetWidthChars(n int)
- func (l *Label) SetWrap(on bool)
- func (n *Label) SharedElement() string
- func (l *Label) SizePx() float64
- func (n *Label) SizeRequest() Size
- func (l *Label) Text() string
- func (n *Label) TooltipMarkup() (string, bool)
- func (n *Label) TooltipText() string
- func (n *Label) VAlign() Align
- func (n *Label) Visible() bool
- func (l *Label) WidthChars() int
- func (l *Label) Wrap() bool
- type LayoutMotion
- type LevelBar
- func (b *LevelBar) AddOffset(name string, value float64)
- func (m *LevelBar) Arrange(r render.Rect)
- func (b *LevelBar) Block() Widget
- func (b *LevelBar) HitTest(p Point) Widget
- func (b *LevelBar) Measure(axis Axis, forSize int) Sizes
- func (b *LevelBar) Offset() string
- func (b *LevelBar) Offsets() []LevelOffset
- func (b *LevelBar) Paint(cv *render.Canvas)
- func (b *LevelBar) RemoveOffset(name string)
- func (b *LevelBar) Role() Role
- func (b *LevelBar) SetValue(v float64)
- func (b *LevelBar) Trough() Widget
- func (m *LevelBar) Value() float64
- type LevelOffset
- type List
- func (n *List) AccessibleName() string
- func (n *List) AddClass(names ...string)
- func (l *List) Arrange(r render.Rect)
- func (n *List) AttachStylesheet(s *Stylesheet)
- func (n *List) Attr(name string) (string, bool)
- func (n *List) Bounds() render.Rect
- func (l *List) Changed()
- func (l *List) Children() []Widget
- func (n *List) Classes() []string
- func (l *List) ClickAt(p Point)
- func (n *List) DebugName() string
- func (n *List) DetachStylesheet(s *Stylesheet)
- func (l *List) DragMove(p Point)
- func (n *List) Element() string
- func (n *List) Enabled() bool
- func (n *List) HAlign() Align
- func (n *List) HasClass(name string) bool
- func (n *List) HasState(flags StateFlags) bool
- func (n *List) HitLeaf(self Widget, p Point) Widget
- func (l *List) HitTest(p Point) Widget
- func (l *List) HoverMove(p Point)
- func (n *List) HoverWithin() bool
- func (n *List) ID() string
- func (n *List) InlineStyle() string
- func (n *List) Invalidate()
- func (n *List) InvalidateLayout()
- func (n *List) InvalidateRect(r render.Rect)
- func (l *List) KeyAction(a KeyAction, mods Mods)
- func (n *List) LayoutMotion() LayoutMotion
- func (n *List) Margin() render.Insets
- func (n *List) MaximumSize() Size
- func (l *List) Measure(axis Axis, forSize int) Sizes
- func (l *List) Paint(cv *render.Canvas)
- func (n *List) Parent() Widget
- func (l *List) PressEnd()
- func (l *List) Refresh()
- func (n *List) RemoveAttr(name string)
- func (n *List) RemoveClass(names ...string)
- func (l *List) Reset()
- func (l *List) Role() Role
- func (l *List) ScrollBy(dx, dy int)
- func (l *List) ScrollEnd()
- func (l *List) ScrollPixels(_, dy float64)
- func (s *List) Select(i int)
- func (s *List) SelectAll()
- func (s *List) SelectRows(rows ...int)
- func (s *List) Selected() int
- func (s *List) Selection() []int
- func (s *List) SelectionMode() SelectionMode
- func (n *List) SetAccessibleName(name string)
- func (n *List) SetAttr(name, value string)
- func (l *List) SetCellWidth(w int)
- func (n *List) SetClass(name string, on bool)
- func (n *List) SetClasses(names ...string)
- func (n *List) SetCursorName(s string)
- func (n *List) SetDebugName(name string)
- func (n *List) SetElement(name string)
- func (n *List) SetEnabled(enabled bool)
- func (n *List) SetFocusOnClick(on bool)
- func (n *List) SetHAlign(a Align)
- func (n *List) SetHExpand(on bool)
- func (n *List) SetID(id string)
- func (n *List) SetInlineStyle(css string)
- func (n *List) SetInlineStylePriority(css string, priority int)
- func (n *List) SetLayoutMotion(m LayoutMotion)
- func (n *List) SetMargin(m render.Insets)
- func (l *List) SetMaxHeight(h int)
- func (n *List) SetMaximumSize(w, h int)
- func (n *List) SetOnClickWithin(fn func())
- func (n *List) SetOnFocusChanged(fn func(focused bool))
- func (n *List) SetOnHoverWithin(fn func(on bool))
- func (n *List) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *List) SetOnScroll(fn func(e ScrollEvent) bool)
- func (l *List) SetPressed(on bool)
- func (s *List) SetSelectionMode(mode SelectionMode)
- func (n *List) SetSharedElement(tag string)
- func (l *List) SetSingleClickActivate(on bool)
- func (n *List) SetSizeRequest(w, h int)
- func (n *List) SetState(flags StateFlags, on bool)
- func (n *List) SetTooltip(s string)
- func (n *List) SetTooltipMarkup(markup string)
- func (n *List) SetVAlign(a Align)
- func (n *List) SetVExpand(on bool)
- func (n *List) SetVisible(visible bool)
- func (n *List) SharedElement() string
- func (n *List) SizeRequest() Size
- func (n *List) TooltipMarkup() (string, bool)
- func (n *List) TooltipText() string
- func (n *List) VAlign() Align
- func (n *List) Visible() bool
- type ListBox
- func (n *ListBox) AccessibleName() string
- func (n *ListBox) AddClass(names ...string)
- func (l *ListBox) Append(w Widget) *ListBoxRow
- func (l *ListBox) Arrange(r render.Rect)
- func (n *ListBox) AttachStylesheet(s *Stylesheet)
- func (n *ListBox) Attr(name string) (string, bool)
- func (n *ListBox) Bounds() render.Rect
- func (l *ListBox) Children() []Widget
- func (n *ListBox) Classes() []string
- func (n *ListBox) DebugName() string
- func (n *ListBox) DetachStylesheet(s *Stylesheet)
- func (n *ListBox) Element() string
- func (n *ListBox) Enabled() bool
- func (n *ListBox) HAlign() Align
- func (n *ListBox) HasClass(name string) bool
- func (n *ListBox) HasState(flags StateFlags) bool
- func (n *ListBox) HitLeaf(self Widget, p Point) Widget
- func (l *ListBox) HitTest(p Point) Widget
- func (n *ListBox) HoverWithin() bool
- func (n *ListBox) ID() string
- func (n *ListBox) InlineStyle() string
- func (l *ListBox) Insert(i int, w Widget) *ListBoxRow
- func (n *ListBox) Invalidate()
- func (l *ListBox) InvalidateFilter()
- func (l *ListBox) InvalidateHeaders()
- func (n *ListBox) InvalidateLayout()
- func (n *ListBox) InvalidateRect(r render.Rect)
- func (l *ListBox) InvalidateSort()
- func (l *ListBox) KeyAction(a KeyAction, mods Mods)
- func (n *ListBox) LayoutMotion() LayoutMotion
- func (l *ListBox) Len() int
- func (n *ListBox) Margin() render.Insets
- func (n *ListBox) MaximumSize() Size
- func (l *ListBox) Measure(axis Axis, forSize int) Sizes
- func (l *ListBox) Move(from, to int)
- func (l *ListBox) Paint(cv *render.Canvas)
- func (n *ListBox) Parent() Widget
- func (l *ListBox) RemoveAt(i int)
- func (n *ListBox) RemoveAttr(name string)
- func (n *ListBox) RemoveClass(names ...string)
- func (l *ListBox) RowAt(i int) *ListBoxRow
- func (l *ListBox) Rows() []Widget
- func (s *ListBox) Select(i int)
- func (s *ListBox) SelectAll()
- func (s *ListBox) SelectRows(rows ...int)
- func (s *ListBox) Selected() int
- func (s *ListBox) Selection() []int
- func (s *ListBox) SelectionMode() SelectionMode
- func (n *ListBox) SetAccessibleName(name string)
- func (n *ListBox) SetAttr(name, value string)
- func (n *ListBox) SetClass(name string, on bool)
- func (n *ListBox) SetClasses(names ...string)
- func (n *ListBox) SetCursorName(s string)
- func (n *ListBox) SetDebugName(name string)
- func (n *ListBox) SetElement(name string)
- func (n *ListBox) SetEnabled(enabled bool)
- func (l *ListBox) SetFilterFunc(keep func(*ListBoxRow) bool)
- func (n *ListBox) SetFocusOnClick(on bool)
- func (n *ListBox) SetHAlign(a Align)
- func (n *ListBox) SetHExpand(on bool)
- func (l *ListBox) SetHeaderFunc(fn func(*ListBoxRow) Widget)
- func (n *ListBox) SetID(id string)
- func (n *ListBox) SetInlineStyle(css string)
- func (n *ListBox) SetInlineStylePriority(css string, priority int)
- func (n *ListBox) SetLayoutMotion(m LayoutMotion)
- func (n *ListBox) SetMargin(m render.Insets)
- func (n *ListBox) SetMaximumSize(w, h int)
- func (l *ListBox) SetMinHeight(h int)
- func (n *ListBox) SetOnClickWithin(fn func())
- func (n *ListBox) SetOnFocusChanged(fn func(focused bool))
- func (n *ListBox) SetOnHoverWithin(fn func(on bool))
- func (n *ListBox) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *ListBox) SetOnScroll(fn func(e ScrollEvent) bool)
- func (l *ListBox) SetPlaceholder(w Widget)
- func (s *ListBox) SetSelectionMode(mode SelectionMode)
- func (n *ListBox) SetSharedElement(tag string)
- func (l *ListBox) SetSingleClickActivate(on bool)
- func (n *ListBox) SetSizeRequest(w, h int)
- func (l *ListBox) SetSortFunc(cmp func(a, b *ListBoxRow) int)
- func (n *ListBox) SetState(flags StateFlags, on bool)
- func (n *ListBox) SetTooltip(s string)
- func (n *ListBox) SetTooltipMarkup(markup string)
- func (n *ListBox) SetVAlign(a Align)
- func (n *ListBox) SetVExpand(on bool)
- func (n *ListBox) SetVisible(visible bool)
- func (n *ListBox) SharedElement() string
- func (n *ListBox) SizeRequest() Size
- func (n *ListBox) TooltipMarkup() (string, bool)
- func (n *ListBox) TooltipText() string
- func (n *ListBox) VAlign() Align
- func (n *ListBox) Visible() bool
- type ListBoxRow
- func (n *ListBoxRow) AccessibleName() string
- func (r *ListBoxRow) Activatable() bool
- func (n *ListBoxRow) AddClass(names ...string)
- func (r *ListBoxRow) Arrange(rct render.Rect)
- func (n *ListBoxRow) AttachStylesheet(s *Stylesheet)
- func (n *ListBoxRow) Attr(name string) (string, bool)
- func (n *ListBoxRow) Bounds() render.Rect
- func (r *ListBoxRow) Child() Widget
- func (r *ListBoxRow) ChildVisible() bool
- func (r *ListBoxRow) Children() []Widget
- func (n *ListBoxRow) Classes() []string
- func (r *ListBoxRow) ClickAt(Point)
- func (n *ListBoxRow) DebugName() string
- func (n *ListBoxRow) DetachStylesheet(s *Stylesheet)
- func (r *ListBoxRow) DoubleClickAt(Point)
- func (r *ListBoxRow) DragMove(p Point)
- func (n *ListBoxRow) Element() string
- func (n *ListBoxRow) Enabled() bool
- func (n *ListBoxRow) HAlign() Align
- func (n *ListBoxRow) HasClass(name string) bool
- func (n *ListBoxRow) HasState(flags StateFlags) bool
- func (r *ListBoxRow) Header() Widget
- func (n *ListBoxRow) HitLeaf(self Widget, p Point) Widget
- func (r *ListBoxRow) HitTest(p Point) Widget
- func (n *ListBoxRow) HoverWithin() bool
- func (n *ListBoxRow) ID() string
- func (r *ListBoxRow) Index() int
- func (n *ListBoxRow) InlineStyle() string
- func (n *ListBoxRow) Invalidate()
- func (n *ListBoxRow) InvalidateLayout()
- func (n *ListBoxRow) InvalidateRect(r render.Rect)
- func (r *ListBoxRow) KeyAction(a KeyAction, mods Mods)
- func (n *ListBoxRow) LayoutMotion() LayoutMotion
- func (n *ListBoxRow) Margin() render.Insets
- func (n *ListBoxRow) MaximumSize() Size
- func (r *ListBoxRow) Measure(axis Axis, forSize int) Sizes
- func (r *ListBoxRow) Paint(cv *render.Canvas)
- func (n *ListBoxRow) Parent() Widget
- func (r *ListBoxRow) PressEnd()
- func (n *ListBoxRow) RemoveAttr(name string)
- func (n *ListBoxRow) RemoveClass(names ...string)
- func (r *ListBoxRow) SelectAll()
- func (r *ListBoxRow) Selectable() bool
- func (n *ListBoxRow) SetAccessibleName(name string)
- func (r *ListBoxRow) SetActivatable(on bool)
- func (n *ListBoxRow) SetAttr(name, value string)
- func (n *ListBoxRow) SetClass(name string, on bool)
- func (n *ListBoxRow) SetClasses(names ...string)
- func (n *ListBoxRow) SetCursorName(s string)
- func (n *ListBoxRow) SetDebugName(name string)
- func (n *ListBoxRow) SetElement(name string)
- func (n *ListBoxRow) SetEnabled(enabled bool)
- func (n *ListBoxRow) SetFocusOnClick(on bool)
- func (n *ListBoxRow) SetHAlign(a Align)
- func (n *ListBoxRow) SetHExpand(on bool)
- func (n *ListBoxRow) SetID(id string)
- func (n *ListBoxRow) SetInlineStyle(css string)
- func (n *ListBoxRow) SetInlineStylePriority(css string, priority int)
- func (n *ListBoxRow) SetLayoutMotion(m LayoutMotion)
- func (n *ListBoxRow) SetMargin(m render.Insets)
- func (n *ListBoxRow) SetMaximumSize(w, h int)
- func (n *ListBoxRow) SetOnClickWithin(fn func())
- func (n *ListBoxRow) SetOnFocusChanged(fn func(focused bool))
- func (n *ListBoxRow) SetOnHoverWithin(fn func(on bool))
- func (n *ListBoxRow) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *ListBoxRow) SetOnScroll(fn func(e ScrollEvent) bool)
- func (r *ListBoxRow) SetPressed(on bool)
- func (r *ListBoxRow) SetSelectable(on bool)
- func (n *ListBoxRow) SetSharedElement(tag string)
- func (n *ListBoxRow) SetSizeRequest(w, h int)
- func (n *ListBoxRow) SetState(flags StateFlags, on bool)
- func (n *ListBoxRow) SetTooltip(s string)
- func (n *ListBoxRow) SetTooltipMarkup(markup string)
- func (n *ListBoxRow) SetVAlign(a Align)
- func (n *ListBoxRow) SetVExpand(on bool)
- func (n *ListBoxRow) SetVisible(visible bool)
- func (n *ListBoxRow) SharedElement() string
- func (n *ListBoxRow) SizeRequest() Size
- func (n *ListBoxRow) TooltipMarkup() (string, bool)
- func (n *ListBoxRow) TooltipText() string
- func (n *ListBoxRow) VAlign() Align
- func (n *ListBoxRow) Visible() bool
- type ListModel
- type MarkupRun
- type MediaControls
- func (c *MediaControls) Arrange(r render.Rect)
- func (c *MediaControls) Baseline() (int, bool)
- func (c *MediaControls) Children() []Widget
- func (c *MediaControls) HitTest(p Point) Widget
- func (c *MediaControls) Measure(axis Axis, forSize int) Sizes
- func (c *MediaControls) Paint(cv *render.Canvas)
- func (m *MediaControls) SetStream(stream *media.Stream)
- func (m *MediaControls) Stream() *media.Stream
- type Menu
- func (n *Menu) AccessibleName() string
- func (m *Menu) ActivateMnemonic(sym xkb.Keysym) bool
- func (n *Menu) AddClass(names ...string)
- func (n *Menu) Arrange(r render.Rect)
- func (n *Menu) AttachStylesheet(s *Stylesheet)
- func (n *Menu) Attr(name string) (string, bool)
- func (n *Menu) Bounds() render.Rect
- func (n *Menu) Classes() []string
- func (m *Menu) ClickAt(p Point)
- func (n *Menu) DebugName() string
- func (n *Menu) DetachStylesheet(s *Stylesheet)
- func (m *Menu) Direction() Direction
- func (m *Menu) DragMove(p Point)
- func (n *Menu) Element() string
- func (n *Menu) Enabled() bool
- func (n *Menu) HAlign() Align
- func (n *Menu) HasClass(name string) bool
- func (n *Menu) HasState(flags StateFlags) bool
- func (n *Menu) HitLeaf(self Widget, p Point) Widget
- func (m *Menu) HitTest(p Point) Widget
- func (m *Menu) HoverMove(p Point)
- func (n *Menu) HoverWithin() bool
- func (n *Menu) ID() string
- func (n *Menu) InlineStyle() string
- func (n *Menu) Invalidate()
- func (n *Menu) InvalidateLayout()
- func (n *Menu) InvalidateRect(r render.Rect)
- func (m *Menu) Items() []MenuItem
- func (m *Menu) KeyAction(a KeyAction, mods Mods)
- func (n *Menu) LayoutMotion() LayoutMotion
- func (n *Menu) Margin() render.Insets
- func (n *Menu) MaximumSize() Size
- func (m *Menu) Measure(axis Axis, forSize int) Sizes
- func (m *Menu) Paint(cv *render.Canvas)
- func (n *Menu) Parent() Widget
- func (m *Menu) RawKey(code uint32, mods Mods, sym xkb.Keysym) bool
- func (n *Menu) RemoveAttr(name string)
- func (n *Menu) RemoveClass(names ...string)
- func (m *Menu) Role() Role
- func (m *Menu) RowBounds(i int) render.Rect
- func (n *Menu) SetAccessibleName(name string)
- func (n *Menu) SetAttr(name, value string)
- func (n *Menu) SetClass(name string, on bool)
- func (n *Menu) SetClasses(names ...string)
- func (n *Menu) SetCursorName(s string)
- func (n *Menu) SetDebugName(name string)
- func (m *Menu) SetDirection(d Direction)
- func (n *Menu) SetElement(name string)
- func (n *Menu) SetEnabled(enabled bool)
- func (n *Menu) SetFocusOnClick(on bool)
- func (n *Menu) SetHAlign(a Align)
- func (n *Menu) SetHExpand(on bool)
- func (m *Menu) SetHovered(on bool)
- func (n *Menu) SetID(id string)
- func (n *Menu) SetInlineStyle(css string)
- func (n *Menu) SetInlineStylePriority(css string, priority int)
- func (m *Menu) SetItems(items ...MenuItem)
- func (n *Menu) SetLayoutMotion(m LayoutMotion)
- func (n *Menu) SetMargin(m render.Insets)
- func (n *Menu) SetMaximumSize(w, h int)
- func (m *Menu) SetMnemonicsVisible(on bool)
- func (n *Menu) SetOnClickWithin(fn func())
- func (n *Menu) SetOnFocusChanged(fn func(focused bool))
- func (n *Menu) SetOnHoverWithin(fn func(on bool))
- func (n *Menu) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Menu) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Menu) SetSharedElement(tag string)
- func (n *Menu) SetSizeRequest(w, h int)
- func (n *Menu) SetState(flags StateFlags, on bool)
- func (n *Menu) SetTooltip(s string)
- func (n *Menu) SetTooltipMarkup(markup string)
- func (n *Menu) SetVAlign(a Align)
- func (n *Menu) SetVExpand(on bool)
- func (n *Menu) SetVisible(visible bool)
- func (n *Menu) SharedElement() string
- func (n *Menu) SizeRequest() Size
- func (n *Menu) TooltipMarkup() (string, bool)
- func (n *Menu) TooltipText() string
- func (n *Menu) VAlign() Align
- func (n *Menu) Visible() bool
- type MenuBar
- func (c *MenuBar) Arrange(r render.Rect)
- func (c *MenuBar) Baseline() (int, bool)
- func (c *MenuBar) Children() []Widget
- func (c *MenuBar) HitTest(p Point) Widget
- func (m *MenuBar) KeyAction(a KeyAction, mods Mods)
- func (c *MenuBar) Measure(axis Axis, forSize int) Sizes
- func (c *MenuBar) Paint(cv *render.Canvas)
- func (m *MenuBar) Root(i int) Boundser
- func (m *MenuBar) Roots() int
- func (m *MenuBar) SetFocused(on bool)
- type MenuBarMenu
- type MenuItem
- type MenuOptions
- type MenuStack
- func (n *MenuStack) AccessibleName() string
- func (s *MenuStack) ActivateMnemonic(sym xkb.Keysym) bool
- func (n *MenuStack) AddClass(names ...string)
- func (s *MenuStack) Arrange(r render.Rect)
- func (n *MenuStack) AttachStylesheet(s *Stylesheet)
- func (n *MenuStack) Attr(name string) (string, bool)
- func (n *MenuStack) Bounds() render.Rect
- func (s *MenuStack) Children() []Widget
- func (n *MenuStack) Classes() []string
- func (s *MenuStack) ClickAt(p Point)
- func (n *MenuStack) DebugName() string
- func (s *MenuStack) Depth() int
- func (n *MenuStack) DetachStylesheet(s *Stylesheet)
- func (s *MenuStack) DragMove(p Point)
- func (n *MenuStack) Element() string
- func (n *MenuStack) Enabled() bool
- func (n *MenuStack) HAlign() Align
- func (n *MenuStack) HasClass(name string) bool
- func (n *MenuStack) HasState(flags StateFlags) bool
- func (n *MenuStack) HitLeaf(self Widget, p Point) Widget
- func (s *MenuStack) HitTest(p Point) Widget
- func (s *MenuStack) HoverMove(p Point)
- func (n *MenuStack) HoverWithin() bool
- func (n *MenuStack) ID() string
- func (n *MenuStack) InlineStyle() string
- func (n *MenuStack) Invalidate()
- func (n *MenuStack) InvalidateLayout()
- func (n *MenuStack) InvalidateRect(r render.Rect)
- func (s *MenuStack) KeyAction(a KeyAction, mods Mods)
- func (n *MenuStack) LayoutMotion() LayoutMotion
- func (n *MenuStack) Margin() render.Insets
- func (n *MenuStack) MaximumSize() Size
- func (s *MenuStack) Measure(axis Axis, forSize int) Sizes
- func (s *MenuStack) Paint(cv *render.Canvas)
- func (n *MenuStack) Parent() Widget
- func (s *MenuStack) RawKey(code uint32, mods Mods, sym xkb.Keysym) bool
- func (n *MenuStack) RemoveAttr(name string)
- func (n *MenuStack) RemoveClass(names ...string)
- func (s *MenuStack) Role() Role
- func (n *MenuStack) SetAccessibleName(name string)
- func (n *MenuStack) SetAttr(name, value string)
- func (n *MenuStack) SetClass(name string, on bool)
- func (n *MenuStack) SetClasses(names ...string)
- func (n *MenuStack) SetCursorName(s string)
- func (n *MenuStack) SetDebugName(name string)
- func (n *MenuStack) SetElement(name string)
- func (n *MenuStack) SetEnabled(enabled bool)
- func (n *MenuStack) SetFocusOnClick(on bool)
- func (n *MenuStack) SetHAlign(a Align)
- func (n *MenuStack) SetHExpand(on bool)
- func (s *MenuStack) SetHovered(on bool)
- func (n *MenuStack) SetID(id string)
- func (n *MenuStack) SetInlineStyle(css string)
- func (n *MenuStack) SetInlineStylePriority(css string, priority int)
- func (s *MenuStack) SetItems(items ...MenuItem)
- func (n *MenuStack) SetLayoutMotion(m LayoutMotion)
- func (n *MenuStack) SetMargin(m render.Insets)
- func (n *MenuStack) SetMaximumSize(w, h int)
- func (n *MenuStack) SetOnClickWithin(fn func())
- func (n *MenuStack) SetOnFocusChanged(fn func(focused bool))
- func (n *MenuStack) SetOnHoverWithin(fn func(on bool))
- func (n *MenuStack) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *MenuStack) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *MenuStack) SetSharedElement(tag string)
- func (n *MenuStack) SetSizeRequest(w, h int)
- func (n *MenuStack) SetState(flags StateFlags, on bool)
- func (n *MenuStack) SetTooltip(s string)
- func (n *MenuStack) SetTooltipMarkup(markup string)
- func (n *MenuStack) SetVAlign(a Align)
- func (n *MenuStack) SetVExpand(on bool)
- func (n *MenuStack) SetVisible(visible bool)
- func (n *MenuStack) SharedElement() string
- func (n *MenuStack) SizeRequest() Size
- func (n *MenuStack) TooltipMarkup() (string, bool)
- func (n *MenuStack) TooltipText() string
- func (s *MenuStack) Top() *Menu
- func (n *MenuStack) VAlign() Align
- func (n *MenuStack) Visible() bool
- type MnemonicActivator
- type Mods
- type Morph
- func (n *Morph) AccessibleName() string
- func (n *Morph) AddClass(names ...string)
- func (m *Morph) Arrange(r render.Rect)
- func (m *Morph) ArrangeRoot(r render.Rect)
- func (n *Morph) AttachStylesheet(s *Stylesheet)
- func (n *Morph) Attr(name string) (string, bool)
- func (m *Morph) BackdropRegion() []render.Rect
- func (n *Morph) Bounds() render.Rect
- func (m *Morph) Child() Widget
- func (m *Morph) Children() []Widget
- func (n *Morph) Classes() []string
- func (n *Morph) DebugName() string
- func (n *Morph) DetachStylesheet(s *Stylesheet)
- func (n *Morph) Element() string
- func (n *Morph) Enabled() bool
- func (m *Morph) Fade() float64
- func (n *Morph) HAlign() Align
- func (n *Morph) HasClass(name string) bool
- func (n *Morph) HasState(flags StateFlags) bool
- func (n *Morph) HitLeaf(self Widget, p Point) Widget
- func (m *Morph) HitTest(p Point) Widget
- func (n *Morph) HoverWithin() bool
- func (n *Morph) ID() string
- func (n *Morph) InlineStyle() string
- func (n *Morph) Invalidate()
- func (n *Morph) InvalidateLayout()
- func (n *Morph) InvalidateRect(r render.Rect)
- func (n *Morph) LayoutMotion() LayoutMotion
- func (n *Morph) Margin() render.Insets
- func (n *Morph) MaximumSize() Size
- func (m *Morph) Measure(axis Axis, forSize int) Sizes
- func (m *Morph) Paint(cv *render.Canvas)
- func (n *Morph) Parent() Widget
- func (n *Morph) RemoveAttr(name string)
- func (n *Morph) RemoveClass(names ...string)
- func (m *Morph) Reveal() float64
- func (n *Morph) SetAccessibleName(name string)
- func (n *Morph) SetAttr(name, value string)
- func (n *Morph) SetClass(name string, on bool)
- func (n *Morph) SetClasses(names ...string)
- func (m *Morph) SetCompositorFade(on bool)
- func (n *Morph) SetCursorName(s string)
- func (n *Morph) SetDebugName(name string)
- func (n *Morph) SetElement(name string)
- func (n *Morph) SetEnabled(enabled bool)
- func (n *Morph) SetFocusOnClick(on bool)
- func (n *Morph) SetHAlign(a Align)
- func (n *Morph) SetHExpand(on bool)
- func (n *Morph) SetID(id string)
- func (n *Morph) SetInlineStyle(css string)
- func (n *Morph) SetInlineStylePriority(css string, priority int)
- func (n *Morph) SetLayoutMotion(m LayoutMotion)
- func (n *Morph) SetMargin(m render.Insets)
- func (n *Morph) SetMaximumSize(w, h int)
- func (n *Morph) SetOnClickWithin(fn func())
- func (n *Morph) SetOnFocusChanged(fn func(focused bool))
- func (n *Morph) SetOnHoverWithin(fn func(on bool))
- func (n *Morph) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Morph) SetOnScroll(fn func(e ScrollEvent) bool)
- func (m *Morph) SetOrigin(fx, fy float64)
- func (m *Morph) SetPlate(inset int, plate func(cv *render.Canvas, content render.Rect))
- func (m *Morph) SetRadius(r int)
- func (m *Morph) SetReveal(reveal float64, morph bool)
- func (n *Morph) SetSharedElement(tag string)
- func (n *Morph) SetSizeRequest(w, h int)
- func (n *Morph) SetState(flags StateFlags, on bool)
- func (n *Morph) SetTooltip(s string)
- func (n *Morph) SetTooltipMarkup(markup string)
- func (n *Morph) SetVAlign(a Align)
- func (n *Morph) SetVExpand(on bool)
- func (n *Morph) SetVisible(visible bool)
- func (n *Morph) SharedElement() string
- func (n *Morph) SizeRequest() Size
- func (n *Morph) TooltipMarkup() (string, bool)
- func (n *Morph) TooltipText() string
- func (n *Morph) VAlign() Align
- func (n *Morph) Visible() bool
- type NavigationLink
- type NavigationMenu
- func (m *NavigationMenu) Active() int
- func (c *NavigationMenu) Arrange(r render.Rect)
- func (c *NavigationMenu) Baseline() (int, bool)
- func (c *NavigationMenu) Children() []Widget
- func (c *NavigationMenu) HitTest(p Point) Widget
- func (m *NavigationMenu) InterceptKey(target Widget, a KeyAction, _ Mods) bool
- func (c *NavigationMenu) Measure(axis Axis, forSize int) Sizes
- func (m *NavigationMenu) NavigateFocus(target Widget, a KeyAction) Widget
- func (m *NavigationMenu) Paint(cv *render.Canvas)
- type NavigationMenuItem
- type NavigationPage
- type NavigationSplitView
- type NavigationView
- func (c *NavigationView) Arrange(r render.Rect)
- func (c *NavigationView) Baseline() (int, bool)
- func (c *NavigationView) Children() []Widget
- func (v *NavigationView) Depth() int
- func (c *NavigationView) HitTest(p Point) Widget
- func (v *NavigationView) KeyAction(a KeyAction, mods Mods)
- func (c *NavigationView) Measure(axis Axis, forSize int) Sizes
- func (v *NavigationView) Page() *NavigationPage
- func (v *NavigationView) Paint(cv *render.Canvas)
- func (v *NavigationView) Pop() bool
- func (v *NavigationView) PopToRoot()
- func (v *NavigationView) Push(p *NavigationPage)
- type NodeInfo
- type Notebook
- func (n *Notebook) AccessibleName() string
- func (n *Notebook) AddClass(names ...string)
- func (n *Notebook) AppendTab(name string, w Widget)
- func (n *Notebook) Arrange(r render.Rect)
- func (n *Notebook) AttachStylesheet(s *Stylesheet)
- func (n *Notebook) Attr(name string) (string, bool)
- func (n *Notebook) Bounds() render.Rect
- func (n *Notebook) Children() []Widget
- func (n *Notebook) Classes() []string
- func (n *Notebook) ClickAt(p Point)
- func (n *Notebook) CloseTab(name string) bool
- func (n *Notebook) CloseTabAt(i int)
- func (n *Notebook) CursorName() string
- func (n *Notebook) DebugName() string
- func (n *Notebook) DetachStylesheet(s *Stylesheet)
- func (n *Notebook) DragMove(p Point)
- func (n *Notebook) Element() string
- func (n *Notebook) Enabled() bool
- func (n *Notebook) HAlign() Align
- func (n *Notebook) HasClass(name string) bool
- func (n *Notebook) HasState(flags StateFlags) bool
- func (n *Notebook) HitLeaf(self Widget, p Point) Widget
- func (n *Notebook) HitTest(p Point) Widget
- func (n *Notebook) HoverMove(p Point)
- func (n *Notebook) HoverWithin() bool
- func (n *Notebook) ID() string
- func (n *Notebook) InlineStyle() string
- func (n *Notebook) InsertTab(i int, name string, w Widget)
- func (n *Notebook) Invalidate()
- func (n *Notebook) InvalidateLayout()
- func (n *Notebook) InvalidateRect(r render.Rect)
- func (n *Notebook) KeyAction(a KeyAction, mods Mods)
- func (n *Notebook) LayoutMotion() LayoutMotion
- func (n *Notebook) Margin() render.Insets
- func (n *Notebook) MaximumSize() Size
- func (n *Notebook) Measure(axis Axis, forSize int) Sizes
- func (n *Notebook) MoveTab(from, to int)
- func (n *Notebook) Paint(cv *render.Canvas)
- func (n *Notebook) Parent() Widget
- func (n *Notebook) PressAt(p Point)
- func (n *Notebook) PressEnd()
- func (n *Notebook) RemoveAttr(name string)
- func (n *Notebook) RemoveClass(names ...string)
- func (n *Notebook) Role() Role
- func (n *Notebook) SelectTab(name string)
- func (n *Notebook) SelectedTab() string
- func (n *Notebook) SetAccessibleName(name string)
- func (n *Notebook) SetAttr(name, value string)
- func (n *Notebook) SetClass(name string, on bool)
- func (n *Notebook) SetClasses(names ...string)
- func (n *Notebook) SetCursorName(s string)
- func (n *Notebook) SetDebugName(name string)
- func (n *Notebook) SetElement(name string)
- func (n *Notebook) SetEnabled(enabled bool)
- func (n *Notebook) SetFocusOnClick(on bool)
- func (n *Notebook) SetHAlign(a Align)
- func (n *Notebook) SetHExpand(on bool)
- func (n *Notebook) SetHovered(on bool)
- func (n *Notebook) SetID(id string)
- func (n *Notebook) SetInlineStyle(css string)
- func (n *Notebook) SetInlineStylePriority(css string, priority int)
- func (n *Notebook) SetLayoutMotion(m LayoutMotion)
- func (n *Notebook) SetMargin(m render.Insets)
- func (n *Notebook) SetMaximumSize(w, h int)
- func (n *Notebook) SetOnClickWithin(fn func())
- func (n *Notebook) SetOnFocusChanged(fn func(focused bool))
- func (n *Notebook) SetOnHoverWithin(fn func(on bool))
- func (n *Notebook) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Notebook) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Notebook) SetSharedElement(tag string)
- func (n *Notebook) SetSizeRequest(w, h int)
- func (n *Notebook) SetState(flags StateFlags, on bool)
- func (n *Notebook) SetTabExpand(name string, on bool)
- func (n *Notebook) SetTabLabel(name string, w Widget)
- func (n *Notebook) SetTooltip(s string)
- func (n *Notebook) SetTooltipMarkup(markup string)
- func (n *Notebook) SetVAlign(a Align)
- func (n *Notebook) SetVExpand(on bool)
- func (n *Notebook) SetVisible(visible bool)
- func (n *Notebook) SharedElement() string
- func (n *Notebook) SizeRequest() Size
- func (n *Notebook) TabLabel(name string) Widget
- func (n *Notebook) TooltipMarkup() (string, bool)
- func (n *Notebook) TooltipText() string
- func (n *Notebook) VAlign() Align
- func (n *Notebook) Visible() bool
- type OTPCharset
- type Opacity
- type Orientation
- type Overlay
- func (n *Overlay) AccessibleName() string
- func (n *Overlay) AddClass(names ...string)
- func (o *Overlay) Append(w Widget) *Overlay
- func (o *Overlay) AppendAligned(w Widget, h, v Align) *Overlay
- func (o *Overlay) Arrange(r render.Rect)
- func (o *Overlay) ArrangeRoot(r render.Rect)
- func (n *Overlay) AttachStylesheet(s *Stylesheet)
- func (n *Overlay) Attr(name string) (string, bool)
- func (n *Overlay) Bounds() render.Rect
- func (o *Overlay) Children() []Widget
- func (n *Overlay) Classes() []string
- func (n *Overlay) DebugName() string
- func (n *Overlay) DetachStylesheet(s *Stylesheet)
- func (n *Overlay) Element() string
- func (n *Overlay) Enabled() bool
- func (n *Overlay) HAlign() Align
- func (n *Overlay) HasClass(name string) bool
- func (n *Overlay) HasState(flags StateFlags) bool
- func (n *Overlay) HitLeaf(self Widget, p Point) Widget
- func (o *Overlay) HitTest(p Point) Widget
- func (n *Overlay) HoverWithin() bool
- func (n *Overlay) ID() string
- func (n *Overlay) InlineStyle() string
- func (n *Overlay) Invalidate()
- func (n *Overlay) InvalidateLayout()
- func (n *Overlay) InvalidateRect(r render.Rect)
- func (n *Overlay) LayoutMotion() LayoutMotion
- func (n *Overlay) Margin() render.Insets
- func (n *Overlay) MaximumSize() Size
- func (o *Overlay) Measure(axis Axis, forSize int) Sizes
- func (o *Overlay) Paint(cv *render.Canvas)
- func (n *Overlay) Parent() Widget
- func (n *Overlay) RemoveAttr(name string)
- func (n *Overlay) RemoveClass(names ...string)
- func (n *Overlay) SetAccessibleName(name string)
- func (n *Overlay) SetAttr(name, value string)
- func (n *Overlay) SetClass(name string, on bool)
- func (n *Overlay) SetClasses(names ...string)
- func (n *Overlay) SetCursorName(s string)
- func (n *Overlay) SetDebugName(name string)
- func (n *Overlay) SetElement(name string)
- func (o *Overlay) SetEnabled(enabled bool)
- func (n *Overlay) SetFocusOnClick(on bool)
- func (n *Overlay) SetHAlign(a Align)
- func (n *Overlay) SetHExpand(on bool)
- func (n *Overlay) SetID(id string)
- func (n *Overlay) SetInlineStyle(css string)
- func (n *Overlay) SetInlineStylePriority(css string, priority int)
- func (n *Overlay) SetLayoutMotion(m LayoutMotion)
- func (n *Overlay) SetMargin(m render.Insets)
- func (n *Overlay) SetMaximumSize(w, h int)
- func (n *Overlay) SetOnClickWithin(fn func())
- func (n *Overlay) SetOnFocusChanged(fn func(focused bool))
- func (n *Overlay) SetOnHoverWithin(fn func(on bool))
- func (n *Overlay) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Overlay) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Overlay) SetSharedElement(tag string)
- func (n *Overlay) SetSizeRequest(w, h int)
- func (n *Overlay) SetState(flags StateFlags, on bool)
- func (n *Overlay) SetTooltip(s string)
- func (n *Overlay) SetTooltipMarkup(markup string)
- func (n *Overlay) SetVAlign(a Align)
- func (n *Overlay) SetVExpand(on bool)
- func (n *Overlay) SetVisible(visible bool)
- func (n *Overlay) SharedElement() string
- func (n *Overlay) SizeRequest() Size
- func (n *Overlay) TooltipMarkup() (string, bool)
- func (n *Overlay) TooltipText() string
- func (n *Overlay) VAlign() Align
- func (n *Overlay) Visible() bool
- type OverlaySplitView
- type Pagination
- func (c *Pagination) Arrange(r render.Rect)
- func (c *Pagination) Baseline() (int, bool)
- func (c *Pagination) Children() []Widget
- func (p *Pagination) Count() int
- func (c *Pagination) HitTest(p Point) Widget
- func (c *Pagination) Measure(axis Axis, forSize int) Sizes
- func (p *Pagination) Page() int
- func (c *Pagination) Paint(cv *render.Canvas)
- func (p *Pagination) SetCount(count, page int)
- func (p *Pagination) SetPage(page int)
- func (p *Pagination) SetSiblings(n int)
- type Paned
- func (n *Paned) AccessibleName() string
- func (n *Paned) AddClass(names ...string)
- func (p *Paned) Arrange(r render.Rect)
- func (n *Paned) AttachStylesheet(s *Stylesheet)
- func (n *Paned) Attr(name string) (string, bool)
- func (n *Paned) Bounds() render.Rect
- func (p *Paned) Children() []Widget
- func (n *Paned) Classes() []string
- func (p *Paned) CursorName() string
- func (n *Paned) DebugName() string
- func (n *Paned) DetachStylesheet(s *Stylesheet)
- func (p *Paned) DragMove(pt Point)
- func (n *Paned) Element() string
- func (n *Paned) Enabled() bool
- func (n *Paned) HAlign() Align
- func (n *Paned) HasClass(name string) bool
- func (n *Paned) HasState(flags StateFlags) bool
- func (n *Paned) HitLeaf(self Widget, p Point) Widget
- func (p *Paned) HitTest(pt Point) Widget
- func (n *Paned) HoverWithin() bool
- func (n *Paned) ID() string
- func (n *Paned) InlineStyle() string
- func (n *Paned) Invalidate()
- func (n *Paned) InvalidateLayout()
- func (n *Paned) InvalidateRect(r render.Rect)
- func (p *Paned) KeyAction(a KeyAction, mods Mods)
- func (n *Paned) LayoutMotion() LayoutMotion
- func (n *Paned) Margin() render.Insets
- func (n *Paned) MaximumSize() Size
- func (p *Paned) Measure(axis Axis, forSize int) Sizes
- func (p *Paned) Paint(cv *render.Canvas)
- func (n *Paned) Parent() Widget
- func (p *Paned) Position() int
- func (n *Paned) RemoveAttr(name string)
- func (n *Paned) RemoveClass(names ...string)
- func (p *Paned) Role() Role
- func (n *Paned) SetAccessibleName(name string)
- func (n *Paned) SetAttr(name, value string)
- func (n *Paned) SetClass(name string, on bool)
- func (n *Paned) SetClasses(names ...string)
- func (n *Paned) SetCursorName(s string)
- func (n *Paned) SetDebugName(name string)
- func (n *Paned) SetElement(name string)
- func (n *Paned) SetEnabled(enabled bool)
- func (n *Paned) SetFocusOnClick(on bool)
- func (n *Paned) SetHAlign(a Align)
- func (n *Paned) SetHExpand(on bool)
- func (p *Paned) SetHovered(on bool)
- func (n *Paned) SetID(id string)
- func (n *Paned) SetInlineStyle(css string)
- func (n *Paned) SetInlineStylePriority(css string, priority int)
- func (n *Paned) SetLayoutMotion(m LayoutMotion)
- func (n *Paned) SetMargin(m render.Insets)
- func (p *Paned) SetMaxPosition(pos int)
- func (n *Paned) SetMaximumSize(w, h int)
- func (n *Paned) SetOnClickWithin(fn func())
- func (n *Paned) SetOnFocusChanged(fn func(focused bool))
- func (n *Paned) SetOnHoverWithin(fn func(on bool))
- func (n *Paned) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Paned) SetOnScroll(fn func(e ScrollEvent) bool)
- func (p *Paned) SetPosition(pos int)
- func (p *Paned) SetPressed(on bool)
- func (n *Paned) SetSharedElement(tag string)
- func (n *Paned) SetSizeRequest(w, h int)
- func (n *Paned) SetState(flags StateFlags, on bool)
- func (n *Paned) SetTooltip(s string)
- func (n *Paned) SetTooltipMarkup(markup string)
- func (n *Paned) SetVAlign(a Align)
- func (n *Paned) SetVExpand(on bool)
- func (n *Paned) SetVisible(visible bool)
- func (n *Paned) SharedElement() string
- func (n *Paned) SizeRequest() Size
- func (n *Paned) TooltipMarkup() (string, bool)
- func (n *Paned) TooltipText() string
- func (n *Paned) VAlign() Align
- func (n *Paned) Visible() bool
- type ParamAction
- type ParsedStylesheet
- type Pile
- func (n *Pile) AccessibleName() string
- func (n *Pile) AddClass(names ...string)
- func (p *Pile) Append(w Widget)
- func (p *Pile) Arrange(r render.Rect)
- func (n *Pile) AttachStylesheet(s *Stylesheet)
- func (n *Pile) Attr(name string) (string, bool)
- func (n *Pile) Bounds() render.Rect
- func (p *Pile) Children() []Widget
- func (n *Pile) Classes() []string
- func (n *Pile) DebugName() string
- func (n *Pile) DetachStylesheet(s *Stylesheet)
- func (n *Pile) Element() string
- func (n *Pile) Enabled() bool
- func (p *Pile) Expanded() bool
- func (n *Pile) HAlign() Align
- func (n *Pile) HasClass(name string) bool
- func (n *Pile) HasState(flags StateFlags) bool
- func (n *Pile) HitLeaf(self Widget, p Point) Widget
- func (p *Pile) HitTest(pt Point) Widget
- func (n *Pile) HoverWithin() bool
- func (n *Pile) ID() string
- func (n *Pile) InlineStyle() string
- func (p *Pile) Insert(i int, w Widget)
- func (n *Pile) Invalidate()
- func (n *Pile) InvalidateLayout()
- func (n *Pile) InvalidateRect(r render.Rect)
- func (n *Pile) LayoutMotion() LayoutMotion
- func (n *Pile) Margin() render.Insets
- func (n *Pile) MaximumSize() Size
- func (p *Pile) Measure(axis Axis, forSize int) Sizes
- func (p *Pile) Paint(cv *render.Canvas)
- func (n *Pile) Parent() Widget
- func (p *Pile) Remove(w Widget)
- func (n *Pile) RemoveAttr(name string)
- func (n *Pile) RemoveClass(names ...string)
- func (n *Pile) SetAccessibleName(name string)
- func (n *Pile) SetAttr(name, value string)
- func (n *Pile) SetClass(name string, on bool)
- func (n *Pile) SetClasses(names ...string)
- func (n *Pile) SetCursorName(s string)
- func (n *Pile) SetDebugName(name string)
- func (n *Pile) SetElement(name string)
- func (n *Pile) SetEnabled(enabled bool)
- func (p *Pile) SetExpanded(on bool)
- func (n *Pile) SetFocusOnClick(on bool)
- func (n *Pile) SetHAlign(a Align)
- func (n *Pile) SetHExpand(on bool)
- func (n *Pile) SetID(id string)
- func (n *Pile) SetInlineStyle(css string)
- func (n *Pile) SetInlineStylePriority(css string, priority int)
- func (n *Pile) SetLayoutMotion(m LayoutMotion)
- func (n *Pile) SetMargin(m render.Insets)
- func (n *Pile) SetMaximumSize(w, h int)
- func (n *Pile) SetOnClickWithin(fn func())
- func (n *Pile) SetOnFocusChanged(fn func(focused bool))
- func (n *Pile) SetOnHoverWithin(fn func(on bool))
- func (n *Pile) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Pile) SetOnScroll(fn func(e ScrollEvent) bool)
- func (p *Pile) SetPeek(n int)
- func (p *Pile) SetPeekEdge(e Edge)
- func (p *Pile) SetPeekOffset(px int)
- func (p *Pile) SetPeekOpacity(f float32)
- func (p *Pile) SetPeekScale(f float32)
- func (n *Pile) SetSharedElement(tag string)
- func (n *Pile) SetSizeRequest(w, h int)
- func (p *Pile) SetSpacing(px int)
- func (n *Pile) SetState(flags StateFlags, on bool)
- func (n *Pile) SetTooltip(s string)
- func (n *Pile) SetTooltipMarkup(markup string)
- func (n *Pile) SetVAlign(a Align)
- func (n *Pile) SetVExpand(on bool)
- func (n *Pile) SetVisible(visible bool)
- func (n *Pile) SharedElement() string
- func (n *Pile) SizeRequest() Size
- func (n *Pile) TooltipMarkup() (string, bool)
- func (n *Pile) TooltipText() string
- func (n *Pile) VAlign() Align
- func (n *Pile) Visible() bool
- type PixelClaimer
- type PixelScroller
- type Point
- type PointerEvent
- type PopoverOptions
- type PopoverSide
- type PreferencesGroup
- func (g *PreferencesGroup) Add(w Widget)
- func (c *PreferencesGroup) Arrange(r render.Rect)
- func (c *PreferencesGroup) Baseline() (int, bool)
- func (c *PreferencesGroup) Children() []Widget
- func (c *PreferencesGroup) HitTest(p Point) Widget
- func (c *PreferencesGroup) Measure(axis Axis, forSize int) Sizes
- func (g *PreferencesGroup) Paint(cv *render.Canvas)
- func (g *PreferencesGroup) SetSuffix(s string)
- func (g *PreferencesGroup) SetTitle(t string)
- type PreferencesPage
- func (p *PreferencesPage) Add(w Widget)
- func (p *PreferencesPage) Arrange(r render.Rect)
- func (c *PreferencesPage) Baseline() (int, bool)
- func (c *PreferencesPage) Children() []Widget
- func (c *PreferencesPage) HitTest(p Point) Widget
- func (c *PreferencesPage) Measure(axis Axis, forSize int) Sizes
- func (c *PreferencesPage) Paint(cv *render.Canvas)
- func (p *PreferencesPage) Reveal(w Widget)
- func (p *PreferencesPage) ScrollBy(dx, dy int)
- func (p *PreferencesPage) SetIconName(name string)
- func (p *PreferencesPage) SetTitle(t string)
- func (p *PreferencesPage) Title() string
- type PreferencesView
- func (v *PreferencesView) Add(p *PreferencesPage)
- func (c *PreferencesView) Arrange(r render.Rect)
- func (c *PreferencesView) Baseline() (int, bool)
- func (c *PreferencesView) Children() []Widget
- func (c *PreferencesView) HitTest(p Point) Widget
- func (c *PreferencesView) Measure(axis Axis, forSize int) Sizes
- func (v *PreferencesView) Pages() []*PreferencesPage
- func (c *PreferencesView) Paint(cv *render.Canvas)
- func (v *PreferencesView) PopSubpage() bool
- func (v *PreferencesView) PushSubpage(title string, content Widget)
- func (v *PreferencesView) Search(text string)
- func (v *PreferencesView) ShowPage(p *PreferencesPage)
- func (v *PreferencesView) VisiblePage() *PreferencesPage
- type PressAter
- type PressEnder
- type PressSetter
- type ProgressBar
- func (p *ProgressBar) Activity() bool
- func (p *ProgressBar) Arrange(r render.Rect)
- func (p *ProgressBar) HitTest(pt Point) Widget
- func (p *ProgressBar) Measure(axis Axis, forSize int) Sizes
- func (p *ProgressBar) Paint(cv *render.Canvas)
- func (p *ProgressBar) Pulse()
- func (p *ProgressBar) Pulsing() bool
- func (p *ProgressBar) Role() Role
- func (p *ProgressBar) SetPulsing(on bool)
- func (p *ProgressBar) SetValue(v float64)
- func (m *ProgressBar) Value() float64
- type ProgressRing
- func (n *ProgressRing) AccessibleName() string
- func (n *ProgressRing) AddClass(names ...string)
- func (r *ProgressRing) Arrange(rect render.Rect)
- func (n *ProgressRing) AttachStylesheet(s *Stylesheet)
- func (n *ProgressRing) Attr(name string) (string, bool)
- func (n *ProgressRing) Bounds() render.Rect
- func (r *ProgressRing) Child() Widget
- func (r *ProgressRing) Children() []Widget
- func (n *ProgressRing) Classes() []string
- func (n *ProgressRing) DebugName() string
- func (n *ProgressRing) DetachStylesheet(s *Stylesheet)
- func (n *ProgressRing) Element() string
- func (n *ProgressRing) Enabled() bool
- func (n *ProgressRing) HAlign() Align
- func (n *ProgressRing) HasClass(name string) bool
- func (n *ProgressRing) HasState(flags StateFlags) bool
- func (n *ProgressRing) HitLeaf(self Widget, p Point) Widget
- func (r *ProgressRing) HitTest(p Point) Widget
- func (n *ProgressRing) HoverWithin() bool
- func (n *ProgressRing) ID() string
- func (n *ProgressRing) InlineStyle() string
- func (n *ProgressRing) Invalidate()
- func (n *ProgressRing) InvalidateLayout()
- func (n *ProgressRing) InvalidateRect(r render.Rect)
- func (n *ProgressRing) LayoutMotion() LayoutMotion
- func (n *ProgressRing) Margin() render.Insets
- func (n *ProgressRing) MaximumSize() Size
- func (r *ProgressRing) Measure(axis Axis, forSize int) Sizes
- func (r *ProgressRing) Paint(cv *render.Canvas)
- func (n *ProgressRing) Parent() Widget
- func (n *ProgressRing) RemoveAttr(name string)
- func (n *ProgressRing) RemoveClass(names ...string)
- func (r *ProgressRing) Role() Role
- func (n *ProgressRing) SetAccessibleName(name string)
- func (n *ProgressRing) SetAttr(name, value string)
- func (r *ProgressRing) SetChild(w Widget)
- func (n *ProgressRing) SetClass(name string, on bool)
- func (n *ProgressRing) SetClasses(names ...string)
- func (n *ProgressRing) SetCursorName(s string)
- func (n *ProgressRing) SetDebugName(name string)
- func (n *ProgressRing) SetElement(name string)
- func (n *ProgressRing) SetEnabled(enabled bool)
- func (n *ProgressRing) SetFocusOnClick(on bool)
- func (n *ProgressRing) SetHAlign(a Align)
- func (n *ProgressRing) SetHExpand(on bool)
- func (n *ProgressRing) SetID(id string)
- func (n *ProgressRing) SetInlineStyle(css string)
- func (n *ProgressRing) SetInlineStylePriority(css string, priority int)
- func (n *ProgressRing) SetLayoutMotion(m LayoutMotion)
- func (n *ProgressRing) SetMargin(m render.Insets)
- func (n *ProgressRing) SetMaximumSize(w, h int)
- func (n *ProgressRing) SetOnClickWithin(fn func())
- func (n *ProgressRing) SetOnFocusChanged(fn func(focused bool))
- func (n *ProgressRing) SetOnHoverWithin(fn func(on bool))
- func (n *ProgressRing) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *ProgressRing) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *ProgressRing) SetSharedElement(tag string)
- func (n *ProgressRing) SetSizeRequest(w, h int)
- func (n *ProgressRing) SetState(flags StateFlags, on bool)
- func (n *ProgressRing) SetTooltip(s string)
- func (n *ProgressRing) SetTooltipMarkup(markup string)
- func (n *ProgressRing) SetVAlign(a Align)
- func (n *ProgressRing) SetVExpand(on bool)
- func (r *ProgressRing) SetValue(v float64)
- func (n *ProgressRing) SetVisible(visible bool)
- func (n *ProgressRing) SharedElement() string
- func (n *ProgressRing) SizeRequest() Size
- func (n *ProgressRing) TooltipMarkup() (string, bool)
- func (n *ProgressRing) TooltipText() string
- func (n *ProgressRing) VAlign() Align
- func (r *ProgressRing) Value() float64
- func (n *ProgressRing) Visible() bool
- type RawKeyHandler
- type RevealTransition
- type Revealer
- func (n *Revealer) AccessibleName() string
- func (n *Revealer) AddClass(names ...string)
- func (r *Revealer) Arrange(rect render.Rect)
- func (n *Revealer) AttachStylesheet(s *Stylesheet)
- func (n *Revealer) Attr(name string) (string, bool)
- func (n *Revealer) Bounds() render.Rect
- func (r *Revealer) Child() Widget
- func (r *Revealer) Children() []Widget
- func (n *Revealer) Classes() []string
- func (r *Revealer) Collapse() bool
- func (n *Revealer) DebugName() string
- func (n *Revealer) DetachStylesheet(s *Stylesheet)
- func (n *Revealer) Element() string
- func (n *Revealer) Enabled() bool
- func (r *Revealer) Finish()
- func (n *Revealer) HAlign() Align
- func (n *Revealer) HasClass(name string) bool
- func (n *Revealer) HasState(flags StateFlags) bool
- func (n *Revealer) HitLeaf(self Widget, p Point) Widget
- func (r *Revealer) HitTest(p Point) Widget
- func (n *Revealer) HoverWithin() bool
- func (n *Revealer) ID() string
- func (n *Revealer) InlineStyle() string
- func (n *Revealer) Invalidate()
- func (n *Revealer) InvalidateLayout()
- func (n *Revealer) InvalidateRect(r render.Rect)
- func (n *Revealer) LayoutMotion() LayoutMotion
- func (n *Revealer) Margin() render.Insets
- func (n *Revealer) MaximumSize() Size
- func (r *Revealer) Measure(axis Axis, forSize int) Sizes
- func (r *Revealer) Paint(cv *render.Canvas)
- func (n *Revealer) Parent() Widget
- func (r *Revealer) Progress() float64
- func (n *Revealer) RemoveAttr(name string)
- func (n *Revealer) RemoveClass(names ...string)
- func (r *Revealer) Revealed() bool
- func (n *Revealer) SetAccessibleName(name string)
- func (n *Revealer) SetAttr(name, value string)
- func (n *Revealer) SetClass(name string, on bool)
- func (n *Revealer) SetClasses(names ...string)
- func (r *Revealer) SetCollapse(collapse bool)
- func (n *Revealer) SetCursorName(s string)
- func (n *Revealer) SetDebugName(name string)
- func (r *Revealer) SetDuration(d time.Duration)
- func (n *Revealer) SetElement(name string)
- func (n *Revealer) SetEnabled(enabled bool)
- func (n *Revealer) SetFocusOnClick(on bool)
- func (r *Revealer) SetGenieEdge(e Edge)
- func (n *Revealer) SetHAlign(a Align)
- func (n *Revealer) SetHExpand(on bool)
- func (n *Revealer) SetID(id string)
- func (n *Revealer) SetInlineStyle(css string)
- func (n *Revealer) SetInlineStylePriority(css string, priority int)
- func (n *Revealer) SetLayoutMotion(m LayoutMotion)
- func (n *Revealer) SetMargin(m render.Insets)
- func (n *Revealer) SetMaximumSize(w, h int)
- func (n *Revealer) SetOnClickWithin(fn func())
- func (n *Revealer) SetOnFocusChanged(fn func(focused bool))
- func (n *Revealer) SetOnHoverWithin(fn func(on bool))
- func (n *Revealer) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Revealer) SetOnScroll(fn func(e ScrollEvent) bool)
- func (r *Revealer) SetOnTransitionDone(fn func(revealed bool))
- func (r *Revealer) SetRevealed(reveal bool)
- func (n *Revealer) SetSharedElement(tag string)
- func (n *Revealer) SetSizeRequest(w, h int)
- func (n *Revealer) SetState(flags StateFlags, on bool)
- func (n *Revealer) SetTooltip(s string)
- func (n *Revealer) SetTooltipMarkup(markup string)
- func (r *Revealer) SetTransition(t RevealTransition)
- func (n *Revealer) SetVAlign(a Align)
- func (n *Revealer) SetVExpand(on bool)
- func (n *Revealer) SetVisible(visible bool)
- func (n *Revealer) SharedElement() string
- func (n *Revealer) SizeRequest() Size
- func (n *Revealer) TooltipMarkup() (string, bool)
- func (n *Revealer) TooltipText() string
- func (r *Revealer) Transition() RevealTransition
- func (n *Revealer) VAlign() Align
- func (n *Revealer) Visible() bool
- type RichLabel
- func (n *RichLabel) AccessibleName() string
- func (n *RichLabel) AddClass(names ...string)
- func (l *RichLabel) Alignment() render.Alignment
- func (l *RichLabel) Arrange(r render.Rect)
- func (n *RichLabel) AttachStylesheet(s *Stylesheet)
- func (n *RichLabel) Attr(name string) (string, bool)
- func (n *RichLabel) Bounds() render.Rect
- func (l *RichLabel) CharsWithin(px int) int
- func (n *RichLabel) Classes() []string
- func (l *RichLabel) ClearSelection()
- func (l *RichLabel) ClickAt(p Point)
- func (l *RichLabel) CursorName() string
- func (n *RichLabel) DebugName() string
- func (n *RichLabel) DetachStylesheet(s *Stylesheet)
- func (l *RichLabel) Direction() Direction
- func (l *RichLabel) DragMove(p Point)
- func (n *RichLabel) Element() string
- func (l *RichLabel) Ellipsize() EllipsizeMode
- func (n *RichLabel) Enabled() bool
- func (n *RichLabel) HAlign() Align
- func (n *RichLabel) HasClass(name string) bool
- func (n *RichLabel) HasState(flags StateFlags) bool
- func (n *RichLabel) HitLeaf(self Widget, p Point) Widget
- func (l *RichLabel) HitTest(p Point) Widget
- func (l *RichLabel) HoverMove(p Point)
- func (n *RichLabel) HoverWithin() bool
- func (n *RichLabel) ID() string
- func (n *RichLabel) InlineStyle() string
- func (n *RichLabel) Invalidate()
- func (n *RichLabel) InvalidateLayout()
- func (n *RichLabel) InvalidateRect(r render.Rect)
- func (n *RichLabel) LayoutMotion() LayoutMotion
- func (n *RichLabel) Margin() render.Insets
- func (l *RichLabel) Markup() string
- func (l *RichLabel) MaxLines() int
- func (l *RichLabel) MaxWidthChars() int
- func (n *RichLabel) MaximumSize() Size
- func (l *RichLabel) Measure(axis Axis, forSize int) Sizes
- func (l *RichLabel) Paint(cv *render.Canvas)
- func (n *RichLabel) Parent() Widget
- func (l *RichLabel) PressAt(p Point)
- func (n *RichLabel) RemoveAttr(name string)
- func (n *RichLabel) RemoveClass(names ...string)
- func (l *RichLabel) Role() Role
- func (l *RichLabel) Selectable() bool
- func (l *RichLabel) SelectedText() (string, bool)
- func (l *RichLabel) SelectionBands(start, end int) []render.Rect
- func (n *RichLabel) SetAccessibleName(name string)
- func (l *RichLabel) SetAlignment(a render.Alignment)
- func (n *RichLabel) SetAttr(name, value string)
- func (n *RichLabel) SetClass(name string, on bool)
- func (n *RichLabel) SetClasses(names ...string)
- func (n *RichLabel) SetCursorName(s string)
- func (n *RichLabel) SetDebugName(name string)
- func (l *RichLabel) SetDirection(d Direction)
- func (n *RichLabel) SetElement(name string)
- func (l *RichLabel) SetEllipsize(mode EllipsizeMode)
- func (n *RichLabel) SetEnabled(enabled bool)
- func (n *RichLabel) SetFocusOnClick(on bool)
- func (n *RichLabel) SetHAlign(a Align)
- func (n *RichLabel) SetHExpand(on bool)
- func (l *RichLabel) SetHovered(on bool)
- func (n *RichLabel) SetID(id string)
- func (n *RichLabel) SetInlineStyle(css string)
- func (n *RichLabel) SetInlineStylePriority(css string, priority int)
- func (n *RichLabel) SetLayoutMotion(m LayoutMotion)
- func (n *RichLabel) SetMargin(m render.Insets)
- func (l *RichLabel) SetMarkup(markup string)
- func (l *RichLabel) SetMaxLines(n int)
- func (l *RichLabel) SetMaxWidthChars(n int)
- func (n *RichLabel) SetMaximumSize(w, h int)
- func (n *RichLabel) SetOnClickWithin(fn func())
- func (n *RichLabel) SetOnFocusChanged(fn func(focused bool))
- func (n *RichLabel) SetOnHoverWithin(fn func(on bool))
- func (n *RichLabel) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *RichLabel) SetOnScroll(fn func(e ScrollEvent) bool)
- func (l *RichLabel) SetSelectable(on bool)
- func (l *RichLabel) SetSelection(start, end int)
- func (n *RichLabel) SetSharedElement(tag string)
- func (n *RichLabel) SetSizeRequest(w, h int)
- func (n *RichLabel) SetState(flags StateFlags, on bool)
- func (n *RichLabel) SetTooltip(s string)
- func (n *RichLabel) SetTooltipMarkup(markup string)
- func (n *RichLabel) SetVAlign(a Align)
- func (n *RichLabel) SetVExpand(on bool)
- func (l *RichLabel) SetVariants(v VariantFunc)
- func (n *RichLabel) SetVisible(visible bool)
- func (l *RichLabel) SetWrap(on bool)
- func (n *RichLabel) SharedElement() string
- func (n *RichLabel) SizeRequest() Size
- func (l *RichLabel) Text() string
- func (n *RichLabel) TooltipMarkup() (string, bool)
- func (n *RichLabel) TooltipText() string
- func (n *RichLabel) VAlign() Align
- func (n *RichLabel) Visible() bool
- func (l *RichLabel) Wrap() bool
- type Role
- type Roleer
- type Router
- func (r *Router) Axis(dx, dy float64, mods Mods)
- func (r *Router) AxisEnd()
- func (r *Router) AxisPixels(dx, dy float64, mods Mods)
- func (r *Router) BeginDrop() func(mime string, data []byte, p Point)
- func (r *Router) CancelPress()
- func (r *Router) DragAction(offered transfer.Action) transfer.Action
- func (r *Router) DragEnter(mimes []string, p Point) string
- func (r *Router) DragHover(p Point) string
- func (r *Router) DragLeave()
- func (r *Router) DragMime() string
- func (r *Router) Drop(mime string, data []byte, p Point)
- func (r *Router) FocusNext()
- func (r *Router) FocusPrev()
- func (r *Router) Focused() Widget
- func (r *Router) Forget(w Widget)
- func (r *Router) Gesture(g Gesture) bool
- func (r *Router) Hovered() Widget
- func (r *Router) KeyAction(a KeyAction, mods Mods)
- func (r *Router) Leave()
- func (r *Router) Move(p Point)
- func (r *Router) PointerLost()
- func (r *Router) Press(button uint32, p Point, mods Mods)
- func (r *Router) Pressed() Widget
- func (r *Router) Rehover() bool
- func (r *Router) Release(button uint32, p Point)
- func (r *Router) SelectAll()
- func (r *Router) SetFocus(w Widget) error
- func (r *Router) Stylus(s Stylus)
- func (r *Router) Type(ch rune)
- type RouterPointer
- type RuneHandler
- type SchemeStyle
- type ScreenPick
- func (n *ScreenPick) AccessibleName() string
- func (n *ScreenPick) AddClass(names ...string)
- func (s *ScreenPick) Arrange(r render.Rect)
- func (n *ScreenPick) AttachStylesheet(s *Stylesheet)
- func (n *ScreenPick) Attr(name string) (string, bool)
- func (n *ScreenPick) Bounds() render.Rect
- func (n *ScreenPick) Classes() []string
- func (s *ScreenPick) ClickAt(p Point)
- func (n *ScreenPick) DebugName() string
- func (n *ScreenPick) DetachStylesheet(s *Stylesheet)
- func (n *ScreenPick) Element() string
- func (n *ScreenPick) Enabled() bool
- func (n *ScreenPick) HAlign() Align
- func (n *ScreenPick) HasClass(name string) bool
- func (n *ScreenPick) HasState(flags StateFlags) bool
- func (n *ScreenPick) HitLeaf(self Widget, p Point) Widget
- func (s *ScreenPick) HitTest(p Point) Widget
- func (n *ScreenPick) HoverWithin() bool
- func (n *ScreenPick) ID() string
- func (n *ScreenPick) InlineStyle() string
- func (n *ScreenPick) Invalidate()
- func (n *ScreenPick) InvalidateLayout()
- func (n *ScreenPick) InvalidateRect(r render.Rect)
- func (n *ScreenPick) LayoutMotion() LayoutMotion
- func (n *ScreenPick) Margin() render.Insets
- func (n *ScreenPick) MaximumSize() Size
- func (s *ScreenPick) Measure(axis Axis, forSize int) Sizes
- func (s *ScreenPick) Paint(cv *render.Canvas)
- func (n *ScreenPick) Parent() Widget
- func (n *ScreenPick) RemoveAttr(name string)
- func (n *ScreenPick) RemoveClass(names ...string)
- func (n *ScreenPick) SetAccessibleName(name string)
- func (n *ScreenPick) SetAttr(name, value string)
- func (n *ScreenPick) SetClass(name string, on bool)
- func (n *ScreenPick) SetClasses(names ...string)
- func (n *ScreenPick) SetCursorName(s string)
- func (n *ScreenPick) SetDebugName(name string)
- func (n *ScreenPick) SetElement(name string)
- func (n *ScreenPick) SetEnabled(enabled bool)
- func (n *ScreenPick) SetFocusOnClick(on bool)
- func (n *ScreenPick) SetHAlign(a Align)
- func (n *ScreenPick) SetHExpand(on bool)
- func (n *ScreenPick) SetID(id string)
- func (n *ScreenPick) SetInlineStyle(css string)
- func (n *ScreenPick) SetInlineStylePriority(css string, priority int)
- func (n *ScreenPick) SetLayoutMotion(m LayoutMotion)
- func (n *ScreenPick) SetMargin(m render.Insets)
- func (n *ScreenPick) SetMaximumSize(w, h int)
- func (n *ScreenPick) SetOnClickWithin(fn func())
- func (n *ScreenPick) SetOnFocusChanged(fn func(focused bool))
- func (n *ScreenPick) SetOnHoverWithin(fn func(on bool))
- func (n *ScreenPick) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *ScreenPick) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *ScreenPick) SetSharedElement(tag string)
- func (n *ScreenPick) SetSizeRequest(w, h int)
- func (n *ScreenPick) SetState(flags StateFlags, on bool)
- func (n *ScreenPick) SetTooltip(s string)
- func (n *ScreenPick) SetTooltipMarkup(markup string)
- func (n *ScreenPick) SetVAlign(a Align)
- func (n *ScreenPick) SetVExpand(on bool)
- func (n *ScreenPick) SetVisible(visible bool)
- func (n *ScreenPick) SharedElement() string
- func (n *ScreenPick) SizeRequest() Size
- func (n *ScreenPick) TooltipMarkup() (string, bool)
- func (n *ScreenPick) TooltipText() string
- func (n *ScreenPick) VAlign() Align
- func (n *ScreenPick) Visible() bool
- type Scroll
- func (n *Scroll) AccessibleName() string
- func (n *Scroll) AddClass(names ...string)
- func (s *Scroll) Arrange(r render.Rect)
- func (s *Scroll) ArrangeRoot(r render.Rect)
- func (n *Scroll) AttachStylesheet(s *Stylesheet)
- func (n *Scroll) Attr(name string) (string, bool)
- func (s *Scroll) AxisRange(axis Axis) ScrollRange
- func (n *Scroll) Bounds() render.Rect
- func (s *Scroll) Children() []Widget
- func (n *Scroll) Classes() []string
- func (s *Scroll) ClickAt(p Point)
- func (n *Scroll) DebugName() string
- func (n *Scroll) DetachStylesheet(s *Stylesheet)
- func (s *Scroll) DragMove(p Point)
- func (n *Scroll) Element() string
- func (n *Scroll) Enabled() bool
- func (n *Scroll) HAlign() Align
- func (n *Scroll) HasClass(name string) bool
- func (n *Scroll) HasState(flags StateFlags) bool
- func (n *Scroll) HitLeaf(self Widget, p Point) Widget
- func (s *Scroll) HitTest(p Point) Widget
- func (n *Scroll) HoverWithin() bool
- func (n *Scroll) ID() string
- func (n *Scroll) InlineStyle() string
- func (n *Scroll) Invalidate()
- func (n *Scroll) InvalidateLayout()
- func (n *Scroll) InvalidateRect(r render.Rect)
- func (n *Scroll) LayoutMotion() LayoutMotion
- func (n *Scroll) Margin() render.Insets
- func (s *Scroll) MaxContentHeight() int
- func (n *Scroll) MaximumSize() Size
- func (s *Scroll) Measure(axis Axis, forSize int) Sizes
- func (s *Scroll) Offset() (int, int)
- func (s *Scroll) Paint(cv *render.Canvas)
- func (n *Scroll) Parent() Widget
- func (n *Scroll) RemoveAttr(name string)
- func (n *Scroll) RemoveClass(names ...string)
- func (s *Scroll) Role() Role
- func (s *Scroll) ScrollBy(dx, dy int)
- func (s *Scroll) ScrollEnd()
- func (s *Scroll) ScrollPixels(dx, dy float64)
- func (n *Scroll) SetAccessibleName(name string)
- func (n *Scroll) SetAttr(name, value string)
- func (s *Scroll) SetAxisOffset(axis Axis, offset int)
- func (s *Scroll) SetChild(child Widget)
- func (n *Scroll) SetClass(name string, on bool)
- func (n *Scroll) SetClasses(names ...string)
- func (n *Scroll) SetCursorName(s string)
- func (n *Scroll) SetDebugName(name string)
- func (n *Scroll) SetElement(name string)
- func (s *Scroll) SetEnabled(enabled bool)
- func (n *Scroll) SetFocusOnClick(on bool)
- func (n *Scroll) SetHAlign(a Align)
- func (n *Scroll) SetHExpand(on bool)
- func (s *Scroll) SetHovered(on bool)
- func (n *Scroll) SetID(id string)
- func (n *Scroll) SetInlineStyle(css string)
- func (n *Scroll) SetInlineStylePriority(css string, priority int)
- func (n *Scroll) SetLayoutMotion(m LayoutMotion)
- func (n *Scroll) SetMargin(m render.Insets)
- func (s *Scroll) SetMaxContentHeight(h int)
- func (n *Scroll) SetMaximumSize(w, h int)
- func (s *Scroll) SetOffset(x, y int)
- func (n *Scroll) SetOnClickWithin(fn func())
- func (n *Scroll) SetOnFocusChanged(fn func(focused bool))
- func (n *Scroll) SetOnHoverWithin(fn func(on bool))
- func (n *Scroll) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Scroll) SetOnScroll(fn func(e ScrollEvent) bool)
- func (s *Scroll) SetPressed(on bool)
- func (n *Scroll) SetSharedElement(tag string)
- func (n *Scroll) SetSizeRequest(w, h int)
- func (n *Scroll) SetState(flags StateFlags, on bool)
- func (n *Scroll) SetTooltip(s string)
- func (n *Scroll) SetTooltipMarkup(markup string)
- func (n *Scroll) SetVAlign(a Align)
- func (n *Scroll) SetVExpand(on bool)
- func (n *Scroll) SetVisible(visible bool)
- func (n *Scroll) SharedElement() string
- func (n *Scroll) SizeRequest() Size
- func (n *Scroll) TooltipMarkup() (string, bool)
- func (n *Scroll) TooltipText() string
- func (n *Scroll) VAlign() Align
- func (n *Scroll) Visible() bool
- func (s *Scroll) WatchRange(fn func())
- type ScrollEnder
- type ScrollEvent
- type ScrollHandler
- type ScrollMove
- type ScrollRange
- type Scrollbar
- func (n *Scrollbar) AccessibleName() string
- func (n *Scrollbar) AddClass(names ...string)
- func (n *Scrollbar) Arrange(r render.Rect)
- func (n *Scrollbar) AttachStylesheet(s *Stylesheet)
- func (n *Scrollbar) Attr(name string) (string, bool)
- func (b *Scrollbar) Axis() Axis
- func (n *Scrollbar) Bounds() render.Rect
- func (n *Scrollbar) Classes() []string
- func (b *Scrollbar) ClickAt(p Point)
- func (n *Scrollbar) DebugName() string
- func (n *Scrollbar) DetachStylesheet(s *Stylesheet)
- func (b *Scrollbar) DragMove(p Point)
- func (n *Scrollbar) Element() string
- func (n *Scrollbar) Enabled() bool
- func (n *Scrollbar) HAlign() Align
- func (n *Scrollbar) HasClass(name string) bool
- func (n *Scrollbar) HasState(flags StateFlags) bool
- func (n *Scrollbar) HitLeaf(self Widget, p Point) Widget
- func (b *Scrollbar) HitTest(p Point) Widget
- func (n *Scrollbar) HoverWithin() bool
- func (n *Scrollbar) ID() string
- func (n *Scrollbar) InlineStyle() string
- func (n *Scrollbar) Invalidate()
- func (n *Scrollbar) InvalidateLayout()
- func (n *Scrollbar) InvalidateRect(r render.Rect)
- func (n *Scrollbar) LayoutMotion() LayoutMotion
- func (n *Scrollbar) Margin() render.Insets
- func (n *Scrollbar) MaximumSize() Size
- func (b *Scrollbar) Measure(axis Axis, forSize int) Sizes
- func (b *Scrollbar) Paint(cv *render.Canvas)
- func (n *Scrollbar) Parent() Widget
- func (b *Scrollbar) PressAt(p Point)
- func (b *Scrollbar) PressEnd()
- func (n *Scrollbar) RemoveAttr(name string)
- func (n *Scrollbar) RemoveClass(names ...string)
- func (b *Scrollbar) Role() Role
- func (n *Scrollbar) SetAccessibleName(name string)
- func (n *Scrollbar) SetAttr(name, value string)
- func (n *Scrollbar) SetClass(name string, on bool)
- func (n *Scrollbar) SetClasses(names ...string)
- func (n *Scrollbar) SetCursorName(s string)
- func (n *Scrollbar) SetDebugName(name string)
- func (n *Scrollbar) SetElement(name string)
- func (n *Scrollbar) SetEnabled(enabled bool)
- func (n *Scrollbar) SetFocusOnClick(on bool)
- func (n *Scrollbar) SetHAlign(a Align)
- func (n *Scrollbar) SetHExpand(on bool)
- func (n *Scrollbar) SetID(id string)
- func (n *Scrollbar) SetInlineStyle(css string)
- func (n *Scrollbar) SetInlineStylePriority(css string, priority int)
- func (n *Scrollbar) SetLayoutMotion(m LayoutMotion)
- func (n *Scrollbar) SetMargin(m render.Insets)
- func (n *Scrollbar) SetMaximumSize(w, h int)
- func (n *Scrollbar) SetOnClickWithin(fn func())
- func (n *Scrollbar) SetOnFocusChanged(fn func(focused bool))
- func (n *Scrollbar) SetOnHoverWithin(fn func(on bool))
- func (n *Scrollbar) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Scrollbar) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Scrollbar) SetSharedElement(tag string)
- func (n *Scrollbar) SetSizeRequest(w, h int)
- func (n *Scrollbar) SetState(flags StateFlags, on bool)
- func (n *Scrollbar) SetTooltip(s string)
- func (n *Scrollbar) SetTooltipMarkup(markup string)
- func (n *Scrollbar) SetVAlign(a Align)
- func (n *Scrollbar) SetVExpand(on bool)
- func (n *Scrollbar) SetVisible(visible bool)
- func (n *Scrollbar) SharedElement() string
- func (n *Scrollbar) SizeRequest() Size
- func (n *Scrollbar) TooltipMarkup() (string, bool)
- func (n *Scrollbar) TooltipText() string
- func (n *Scrollbar) VAlign() Align
- func (n *Scrollbar) Visible() bool
- type SearchBar
- func (c *SearchBar) Arrange(r render.Rect)
- func (c *SearchBar) Baseline() (int, bool)
- func (c *SearchBar) Children() []Widget
- func (b *SearchBar) Entry() *SearchEntry
- func (c *SearchBar) HitTest(p Point) Widget
- func (c *SearchBar) Measure(axis Axis, forSize int) Sizes
- func (c *SearchBar) Paint(cv *render.Canvas)
- func (b *SearchBar) SearchMode() bool
- func (b *SearchBar) SetSearchMode(on bool)
- type SearchEntry
- func (n SearchEntry) AccessibleName() string
- func (n SearchEntry) AddClass(names ...string)
- func (n SearchEntry) AttachStylesheet(s *Stylesheet)
- func (n SearchEntry) Attr(name string) (string, bool)
- func (n SearchEntry) Bounds() render.Rect
- func (n SearchEntry) Classes() []string
- func (n SearchEntry) DebugName() string
- func (n SearchEntry) DetachStylesheet(s *Stylesheet)
- func (n SearchEntry) Element() string
- func (n SearchEntry) Enabled() bool
- func (n SearchEntry) HAlign() Align
- func (n SearchEntry) HasClass(name string) bool
- func (n SearchEntry) HasState(flags StateFlags) bool
- func (n SearchEntry) HitLeaf(self Widget, p Point) Widget
- func (n SearchEntry) HoverWithin() bool
- func (n SearchEntry) ID() string
- func (n SearchEntry) InlineStyle() string
- func (n SearchEntry) Invalidate()
- func (n SearchEntry) InvalidateLayout()
- func (n SearchEntry) InvalidateRect(r render.Rect)
- func (n SearchEntry) LayoutMotion() LayoutMotion
- func (n SearchEntry) Margin() render.Insets
- func (n SearchEntry) MaximumSize() Size
- func (n SearchEntry) Parent() Widget
- func (n SearchEntry) RemoveAttr(name string)
- func (n SearchEntry) RemoveClass(names ...string)
- func (n SearchEntry) SetAccessibleName(name string)
- func (n SearchEntry) SetAttr(name, value string)
- func (n SearchEntry) SetClass(name string, on bool)
- func (n SearchEntry) SetClasses(names ...string)
- func (n SearchEntry) SetCursorName(s string)
- func (n SearchEntry) SetDebugName(name string)
- func (s *SearchEntry) SetDelay(d time.Duration)
- func (n SearchEntry) SetElement(name string)
- func (n SearchEntry) SetEnabled(enabled bool)
- func (n SearchEntry) SetFocusOnClick(on bool)
- func (n SearchEntry) SetHAlign(a Align)
- func (n SearchEntry) SetHExpand(on bool)
- func (n SearchEntry) SetID(id string)
- func (n SearchEntry) SetInlineStyle(css string)
- func (n SearchEntry) SetInlineStylePriority(css string, priority int)
- func (n SearchEntry) SetLayoutMotion(m LayoutMotion)
- func (n SearchEntry) SetMargin(m render.Insets)
- func (n SearchEntry) SetMaximumSize(w, h int)
- func (n SearchEntry) SetOnClickWithin(fn func())
- func (n SearchEntry) SetOnFocusChanged(fn func(focused bool))
- func (n SearchEntry) SetOnHoverWithin(fn func(on bool))
- func (n SearchEntry) SetOnPointer(fn func(e PointerEvent) bool)
- func (n SearchEntry) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n SearchEntry) SetSharedElement(tag string)
- func (n SearchEntry) SetSizeRequest(w, h int)
- func (n SearchEntry) SetState(flags StateFlags, on bool)
- func (n SearchEntry) SetTooltip(s string)
- func (n SearchEntry) SetTooltipMarkup(markup string)
- func (n SearchEntry) SetVAlign(a Align)
- func (n SearchEntry) SetVExpand(on bool)
- func (n SearchEntry) SetVisible(visible bool)
- func (n SearchEntry) SharedElement() string
- func (n SearchEntry) SizeRequest() Size
- func (n SearchEntry) TooltipMarkup() (string, bool)
- func (n SearchEntry) TooltipText() string
- func (n SearchEntry) VAlign() Align
- func (n SearchEntry) Visible() bool
- type SegmentDrop
- type SegmentIndicator
- func (s *SegmentIndicator) Active() int
- func (s *SegmentIndicator) Arrange(r render.Rect)
- func (c *SegmentIndicator) Baseline() (int, bool)
- func (c *SegmentIndicator) Children() []Widget
- func (s *SegmentIndicator) Count() int
- func (s *SegmentIndicator) EnableDrop() *SegmentDrop
- func (c *SegmentIndicator) HitTest(p Point) Widget
- func (s *SegmentIndicator) Measure(axis Axis, forSize int) Sizes
- func (s *SegmentIndicator) Paint(cv *render.Canvas)
- func (s *SegmentIndicator) Segment(i int) *Button
- func (s *SegmentIndicator) SetActive(i int)
- func (s *SegmentIndicator) SetCount(n int)
- func (s *SegmentIndicator) SetSegmentContent(i int, w Widget)
- func (s *SegmentIndicator) SetSegmentState(i int, st SegmentState)
- func (s *SegmentIndicator) SetSegmentUrgent(i int, urgent bool)
- func (s *SegmentIndicator) ShiftActive(i int)
- type SegmentState
- type SelectAller
- type SelectedTexter
- type SelectionMode
- type Separator
- func (n *Separator) AccessibleName() string
- func (n *Separator) AddClass(names ...string)
- func (n *Separator) Arrange(r render.Rect)
- func (n *Separator) AttachStylesheet(s *Stylesheet)
- func (n *Separator) Attr(name string) (string, bool)
- func (n *Separator) Bounds() render.Rect
- func (n *Separator) Classes() []string
- func (n *Separator) DebugName() string
- func (n *Separator) DetachStylesheet(s *Stylesheet)
- func (n *Separator) Element() string
- func (n *Separator) Enabled() bool
- func (n *Separator) HAlign() Align
- func (n *Separator) HasClass(name string) bool
- func (n *Separator) HasState(flags StateFlags) bool
- func (n *Separator) HitLeaf(self Widget, p Point) Widget
- func (s *Separator) HitTest(p Point) Widget
- func (n *Separator) HoverWithin() bool
- func (n *Separator) ID() string
- func (n *Separator) InlineStyle() string
- func (n *Separator) Invalidate()
- func (n *Separator) InvalidateLayout()
- func (n *Separator) InvalidateRect(r render.Rect)
- func (n *Separator) LayoutMotion() LayoutMotion
- func (n *Separator) Margin() render.Insets
- func (n *Separator) MaximumSize() Size
- func (s *Separator) Measure(axis Axis, forSize int) Sizes
- func (s *Separator) Orientation() Orientation
- func (s *Separator) Paint(cv *render.Canvas)
- func (n *Separator) Parent() Widget
- func (n *Separator) RemoveAttr(name string)
- func (n *Separator) RemoveClass(names ...string)
- func (n *Separator) SetAccessibleName(name string)
- func (n *Separator) SetAttr(name, value string)
- func (n *Separator) SetClass(name string, on bool)
- func (n *Separator) SetClasses(names ...string)
- func (n *Separator) SetCursorName(s string)
- func (n *Separator) SetDebugName(name string)
- func (n *Separator) SetElement(name string)
- func (n *Separator) SetEnabled(enabled bool)
- func (n *Separator) SetFocusOnClick(on bool)
- func (n *Separator) SetHAlign(a Align)
- func (n *Separator) SetHExpand(on bool)
- func (n *Separator) SetID(id string)
- func (n *Separator) SetInlineStyle(css string)
- func (n *Separator) SetInlineStylePriority(css string, priority int)
- func (n *Separator) SetLayoutMotion(m LayoutMotion)
- func (n *Separator) SetMargin(m render.Insets)
- func (n *Separator) SetMaximumSize(w, h int)
- func (n *Separator) SetOnClickWithin(fn func())
- func (n *Separator) SetOnFocusChanged(fn func(focused bool))
- func (n *Separator) SetOnHoverWithin(fn func(on bool))
- func (n *Separator) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Separator) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Separator) SetSharedElement(tag string)
- func (n *Separator) SetSizeRequest(w, h int)
- func (n *Separator) SetState(flags StateFlags, on bool)
- func (n *Separator) SetTooltip(s string)
- func (n *Separator) SetTooltipMarkup(markup string)
- func (n *Separator) SetVAlign(a Align)
- func (n *Separator) SetVExpand(on bool)
- func (n *Separator) SetVisible(visible bool)
- func (n *Separator) SharedElement() string
- func (n *Separator) SizeRequest() Size
- func (n *Separator) TooltipMarkup() (string, bool)
- func (n *Separator) TooltipText() string
- func (n *Separator) VAlign() Align
- func (n *Separator) Visible() bool
- type Sheet
- func (s *Sheet) Arrange(r render.Rect)
- func (c *Sheet) Baseline() (int, bool)
- func (s *Sheet) Children() []Widget
- func (s *Sheet) ClickAt(p Point)
- func (s *Sheet) Content() Widget
- func (s *Sheet) DragMove(p Point)
- func (s *Sheet) FocusTrap() Widget
- func (s *Sheet) HitTest(p Point) Widget
- func (s *Sheet) InterceptKey(_ Widget, a KeyAction, _ Mods) bool
- func (s *Sheet) KeyAction(a KeyAction, _ Mods)
- func (c *Sheet) Measure(axis Axis, forSize int) Sizes
- func (s *Sheet) Open() bool
- func (s *Sheet) Paint(cv *render.Canvas)
- func (s *Sheet) PressAt(p Point)
- func (s *Sheet) PressEnd()
- func (s *Sheet) SetFooter(w Widget)
- func (s *Sheet) SetHeader(face render.Font, title, description string)
- func (s *Sheet) SetOpen(on bool)
- func (s *Sheet) SetWidth(w int)
- func (s *Sheet) Side() SheetSide
- type SheetSide
- type ShortcutItem
- type ShortcutSection
- type ShortcutsView
- type Sidebar
- func (s *Sidebar) AddCollapsibleGroup(label string, open bool, items ...SidebarItem)
- func (s *Sidebar) AddGroup(label string, items ...SidebarItem)
- func (s *Sidebar) Arrange(r render.Rect)
- func (c *Sidebar) Baseline() (int, bool)
- func (c *Sidebar) Children() []Widget
- func (s *Sidebar) CursorName() string
- func (s *Sidebar) DragMove(p Point)
- func (s *Sidebar) Expanded() bool
- func (s *Sidebar) HitTest(p Point) Widget
- func (c *Sidebar) Measure(axis Axis, forSize int) Sizes
- func (s *Sidebar) Narrow() bool
- func (c *Sidebar) Paint(cv *render.Canvas)
- func (s *Sidebar) PressAt(p Point)
- func (s *Sidebar) PressEnd()
- func (s *Sidebar) SetActive(id string) bool
- func (s *Sidebar) SetCollapse(c SidebarCollapse)
- func (s *Sidebar) SetExpanded(on bool)
- func (s *Sidebar) SetFooter(w Widget)
- func (s *Sidebar) SetHeader(w Widget)
- func (s *Sidebar) SetNarrowWidth(w int)
- func (s *Sidebar) SetResizable(min, max int)
- func (s *Sidebar) SetWidth(px int)
- func (s *Sidebar) Toggle()
- func (s *Sidebar) ToggleAction() Activatable
- func (s *Sidebar) Trigger() *Button
- func (s *Sidebar) Width() int
- type SidebarCollapse
- type SidebarItem
- type Size
- type SizeGroup
- type SizeGroupMode
- type Sizes
- type SliceModel
- type Slider
- func (n *Slider) AccessibleName() string
- func (n *Slider) AddClass(names ...string)
- func (n *Slider) Arrange(r render.Rect)
- func (n *Slider) AttachStylesheet(s *Stylesheet)
- func (n *Slider) Attr(name string) (string, bool)
- func (s *Slider) Axis() Axis
- func (s *Slider) BindValue(b *Binding[float64]) (unbind func())
- func (n *Slider) Bounds() render.Rect
- func (n *Slider) Classes() []string
- func (n *Slider) DebugName() string
- func (n *Slider) DetachStylesheet(s *Stylesheet)
- func (s *Slider) DragMove(p Point)
- func (n *Slider) Element() string
- func (n *Slider) Enabled() bool
- func (n *Slider) HAlign() Align
- func (n *Slider) HasClass(name string) bool
- func (n *Slider) HasState(flags StateFlags) bool
- func (n *Slider) HitLeaf(self Widget, p Point) Widget
- func (s *Slider) HitTest(p Point) Widget
- func (n *Slider) HoverWithin() bool
- func (n *Slider) ID() string
- func (n *Slider) InlineStyle() string
- func (n *Slider) Invalidate()
- func (n *Slider) InvalidateLayout()
- func (n *Slider) InvalidateRect(r render.Rect)
- func (s *Slider) Inverted() bool
- func (s *Slider) KeyAction(a KeyAction, mods Mods)
- func (n *Slider) LayoutMotion() LayoutMotion
- func (n *Slider) Margin() render.Insets
- func (n *Slider) MaximumSize() Size
- func (s *Slider) Measure(axis Axis, forSize int) Sizes
- func (s *Slider) Paint(cv *render.Canvas)
- func (n *Slider) Parent() Widget
- func (s *Slider) PressAt(p Point)
- func (n *Slider) RemoveAttr(name string)
- func (n *Slider) RemoveClass(names ...string)
- func (s *Slider) Role() Role
- func (n *Slider) SetAccessibleName(name string)
- func (n *Slider) SetAttr(name, value string)
- func (s *Slider) SetAxis(axis Axis)
- func (n *Slider) SetClass(name string, on bool)
- func (n *Slider) SetClasses(names ...string)
- func (n *Slider) SetCursorName(s string)
- func (n *Slider) SetDebugName(name string)
- func (n *Slider) SetElement(name string)
- func (n *Slider) SetEnabled(enabled bool)
- func (n *Slider) SetFocusOnClick(on bool)
- func (n *Slider) SetHAlign(a Align)
- func (n *Slider) SetHExpand(on bool)
- func (s *Slider) SetHovered(on bool)
- func (n *Slider) SetID(id string)
- func (n *Slider) SetInlineStyle(css string)
- func (n *Slider) SetInlineStylePriority(css string, priority int)
- func (s *Slider) SetInverted(on bool)
- func (n *Slider) SetLayoutMotion(m LayoutMotion)
- func (n *Slider) SetMargin(m render.Insets)
- func (n *Slider) SetMaximumSize(w, h int)
- func (n *Slider) SetOnClickWithin(fn func())
- func (n *Slider) SetOnFocusChanged(fn func(focused bool))
- func (n *Slider) SetOnHoverWithin(fn func(on bool))
- func (n *Slider) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Slider) SetOnScroll(fn func(e ScrollEvent) bool)
- func (s *Slider) SetPressed(on bool)
- func (n *Slider) SetSharedElement(tag string)
- func (n *Slider) SetSizeRequest(w, h int)
- func (n *Slider) SetState(flags StateFlags, on bool)
- func (n *Slider) SetTooltip(s string)
- func (n *Slider) SetTooltipMarkup(markup string)
- func (n *Slider) SetVAlign(a Align)
- func (n *Slider) SetVExpand(on bool)
- func (s *Slider) SetValue(v float64)
- func (n *Slider) SetVisible(visible bool)
- func (n *Slider) SharedElement() string
- func (n *Slider) SizeRequest() Size
- func (n *Slider) TooltipMarkup() (string, bool)
- func (n *Slider) TooltipText() string
- func (n *Slider) VAlign() Align
- func (s *Slider) Value() float64
- func (s *Slider) ValueAt(p Point) float64
- func (n *Slider) Visible() bool
- type Spacer
- func (n *Spacer) AccessibleName() string
- func (n *Spacer) AddClass(names ...string)
- func (n *Spacer) Arrange(r render.Rect)
- func (n *Spacer) AttachStylesheet(s *Stylesheet)
- func (n *Spacer) Attr(name string) (string, bool)
- func (n *Spacer) Bounds() render.Rect
- func (n *Spacer) Classes() []string
- func (n *Spacer) DebugName() string
- func (n *Spacer) DetachStylesheet(s *Stylesheet)
- func (n *Spacer) Element() string
- func (n *Spacer) Enabled() bool
- func (n *Spacer) HAlign() Align
- func (n *Spacer) HasClass(name string) bool
- func (n *Spacer) HasState(flags StateFlags) bool
- func (n *Spacer) HitLeaf(self Widget, p Point) Widget
- func (s *Spacer) HitTest(Point) Widget
- func (n *Spacer) HoverWithin() bool
- func (n *Spacer) ID() string
- func (n *Spacer) InlineStyle() string
- func (n *Spacer) Invalidate()
- func (n *Spacer) InvalidateLayout()
- func (n *Spacer) InvalidateRect(r render.Rect)
- func (n *Spacer) LayoutMotion() LayoutMotion
- func (n *Spacer) Margin() render.Insets
- func (n *Spacer) MaximumSize() Size
- func (s *Spacer) Measure(axis Axis, forSize int) Sizes
- func (s *Spacer) Paint(*render.Canvas)
- func (n *Spacer) Parent() Widget
- func (n *Spacer) RemoveAttr(name string)
- func (n *Spacer) RemoveClass(names ...string)
- func (n *Spacer) SetAccessibleName(name string)
- func (n *Spacer) SetAttr(name, value string)
- func (n *Spacer) SetClass(name string, on bool)
- func (n *Spacer) SetClasses(names ...string)
- func (n *Spacer) SetCursorName(s string)
- func (n *Spacer) SetDebugName(name string)
- func (n *Spacer) SetElement(name string)
- func (n *Spacer) SetEnabled(enabled bool)
- func (n *Spacer) SetFocusOnClick(on bool)
- func (n *Spacer) SetHAlign(a Align)
- func (n *Spacer) SetHExpand(on bool)
- func (n *Spacer) SetID(id string)
- func (n *Spacer) SetInlineStyle(css string)
- func (n *Spacer) SetInlineStylePriority(css string, priority int)
- func (n *Spacer) SetLayoutMotion(m LayoutMotion)
- func (n *Spacer) SetMargin(m render.Insets)
- func (n *Spacer) SetMaximumSize(w, h int)
- func (n *Spacer) SetOnClickWithin(fn func())
- func (n *Spacer) SetOnFocusChanged(fn func(focused bool))
- func (n *Spacer) SetOnHoverWithin(fn func(on bool))
- func (n *Spacer) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Spacer) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Spacer) SetSharedElement(tag string)
- func (n *Spacer) SetSizeRequest(w, h int)
- func (n *Spacer) SetState(flags StateFlags, on bool)
- func (n *Spacer) SetTooltip(s string)
- func (n *Spacer) SetTooltipMarkup(markup string)
- func (n *Spacer) SetVAlign(a Align)
- func (n *Spacer) SetVExpand(on bool)
- func (n *Spacer) SetVisible(visible bool)
- func (n *Spacer) SharedElement() string
- func (n *Spacer) SizeRequest() Size
- func (n *Spacer) TooltipMarkup() (string, bool)
- func (n *Spacer) TooltipText() string
- func (n *Spacer) VAlign() Align
- func (n *Spacer) Visible() bool
- type SpinButton
- func (n SpinButton) AccessibleName() string
- func (n SpinButton) AddClass(names ...string)
- func (n SpinButton) AttachStylesheet(s *Stylesheet)
- func (n SpinButton) Attr(name string) (string, bool)
- func (s *SpinButton) BindValue(b *Binding[float64]) (unbind func())
- func (n SpinButton) Bounds() render.Rect
- func (n SpinButton) Classes() []string
- func (n SpinButton) DebugName() string
- func (n SpinButton) DetachStylesheet(s *Stylesheet)
- func (n SpinButton) Element() string
- func (n SpinButton) Enabled() bool
- func (n SpinButton) HAlign() Align
- func (n SpinButton) HasClass(name string) bool
- func (n SpinButton) HasState(flags StateFlags) bool
- func (n SpinButton) HitLeaf(self Widget, p Point) Widget
- func (n SpinButton) HoverWithin() bool
- func (n SpinButton) ID() string
- func (n SpinButton) InlineStyle() string
- func (n SpinButton) Invalidate()
- func (n SpinButton) InvalidateLayout()
- func (n SpinButton) InvalidateRect(r render.Rect)
- func (s *SpinButton) KeyAction(a KeyAction, mods Mods)
- func (n SpinButton) LayoutMotion() LayoutMotion
- func (n SpinButton) Margin() render.Insets
- func (n SpinButton) MaximumSize() Size
- func (n SpinButton) Parent() Widget
- func (s *SpinButton) Range() (min, max float64)
- func (n SpinButton) RemoveAttr(name string)
- func (n SpinButton) RemoveClass(names ...string)
- func (n SpinButton) SetAccessibleName(name string)
- func (n SpinButton) SetAttr(name, value string)
- func (n SpinButton) SetClass(name string, on bool)
- func (n SpinButton) SetClasses(names ...string)
- func (n SpinButton) SetCursorName(s string)
- func (n SpinButton) SetDebugName(name string)
- func (s *SpinButton) SetDigits(digits int)
- func (n SpinButton) SetElement(name string)
- func (n SpinButton) SetEnabled(enabled bool)
- func (n SpinButton) SetFocusOnClick(on bool)
- func (n SpinButton) SetHAlign(a Align)
- func (n SpinButton) SetHExpand(on bool)
- func (n SpinButton) SetID(id string)
- func (n SpinButton) SetInlineStyle(css string)
- func (n SpinButton) SetInlineStylePriority(css string, priority int)
- func (n SpinButton) SetLayoutMotion(m LayoutMotion)
- func (n SpinButton) SetMargin(m render.Insets)
- func (n SpinButton) SetMaximumSize(w, h int)
- func (n SpinButton) SetOnClickWithin(fn func())
- func (n SpinButton) SetOnFocusChanged(fn func(focused bool))
- func (n SpinButton) SetOnHoverWithin(fn func(on bool))
- func (n SpinButton) SetOnPointer(fn func(e PointerEvent) bool)
- func (n SpinButton) SetOnScroll(fn func(e ScrollEvent) bool)
- func (s *SpinButton) SetRange(min, max float64)
- func (n SpinButton) SetSharedElement(tag string)
- func (n SpinButton) SetSizeRequest(w, h int)
- func (n SpinButton) SetState(flags StateFlags, on bool)
- func (s *SpinButton) SetStep(step float64)
- func (n SpinButton) SetTooltip(s string)
- func (n SpinButton) SetTooltipMarkup(markup string)
- func (n SpinButton) SetVAlign(a Align)
- func (n SpinButton) SetVExpand(on bool)
- func (s *SpinButton) SetValue(v float64)
- func (n SpinButton) SetVisible(visible bool)
- func (n SpinButton) SharedElement() string
- func (n SpinButton) SizeRequest() Size
- func (n SpinButton) TooltipMarkup() (string, bool)
- func (n SpinButton) TooltipText() string
- func (n SpinButton) VAlign() Align
- func (s *SpinButton) Value() float64
- func (n SpinButton) Visible() bool
- type SpinRow
- func (c SpinRow) Arrange(r render.Rect)
- func (c SpinRow) Baseline() (int, bool)
- func (c SpinRow) Children() []Widget
- func (c SpinRow) HitTest(p Point) Widget
- func (c SpinRow) Measure(axis Axis, forSize int) Sizes
- func (p SpinRow) PackEnd(w Widget)
- func (p SpinRow) PackStart(w Widget)
- func (r *SpinRow) SetValue(v float64)
- func (r *SpinRow) SpinButton() *SpinButton
- func (r *SpinRow) Value() float64
- type Spinner
- func (n *Spinner) AccessibleName() string
- func (n *Spinner) AddClass(names ...string)
- func (s *Spinner) Arrange(r render.Rect)
- func (n *Spinner) AttachStylesheet(s *Stylesheet)
- func (n *Spinner) Attr(name string) (string, bool)
- func (n *Spinner) Bounds() render.Rect
- func (n *Spinner) Classes() []string
- func (n *Spinner) DebugName() string
- func (n *Spinner) DetachStylesheet(s *Stylesheet)
- func (n *Spinner) Element() string
- func (n *Spinner) Enabled() bool
- func (n *Spinner) HAlign() Align
- func (n *Spinner) HasClass(name string) bool
- func (n *Spinner) HasState(flags StateFlags) bool
- func (n *Spinner) HitLeaf(self Widget, p Point) Widget
- func (s *Spinner) HitTest(p Point) Widget
- func (n *Spinner) HoverWithin() bool
- func (n *Spinner) ID() string
- func (n *Spinner) InlineStyle() string
- func (n *Spinner) Invalidate()
- func (n *Spinner) InvalidateLayout()
- func (n *Spinner) InvalidateRect(r render.Rect)
- func (n *Spinner) LayoutMotion() LayoutMotion
- func (n *Spinner) Margin() render.Insets
- func (n *Spinner) MaximumSize() Size
- func (s *Spinner) Measure(axis Axis, forSize int) Sizes
- func (s *Spinner) Paint(cv *render.Canvas)
- func (n *Spinner) Parent() Widget
- func (n *Spinner) RemoveAttr(name string)
- func (n *Spinner) RemoveClass(names ...string)
- func (n *Spinner) SetAccessibleName(name string)
- func (n *Spinner) SetAttr(name, value string)
- func (n *Spinner) SetClass(name string, on bool)
- func (n *Spinner) SetClasses(names ...string)
- func (n *Spinner) SetCursorName(s string)
- func (n *Spinner) SetDebugName(name string)
- func (n *Spinner) SetElement(name string)
- func (n *Spinner) SetEnabled(enabled bool)
- func (n *Spinner) SetFocusOnClick(on bool)
- func (n *Spinner) SetHAlign(a Align)
- func (n *Spinner) SetHExpand(on bool)
- func (n *Spinner) SetID(id string)
- func (n *Spinner) SetInlineStyle(css string)
- func (n *Spinner) SetInlineStylePriority(css string, priority int)
- func (n *Spinner) SetLayoutMotion(m LayoutMotion)
- func (n *Spinner) SetMargin(m render.Insets)
- func (n *Spinner) SetMaximumSize(w, h int)
- func (n *Spinner) SetOnClickWithin(fn func())
- func (n *Spinner) SetOnFocusChanged(fn func(focused bool))
- func (n *Spinner) SetOnHoverWithin(fn func(on bool))
- func (n *Spinner) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Spinner) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Spinner) SetSharedElement(tag string)
- func (n *Spinner) SetSizeRequest(w, h int)
- func (s *Spinner) SetSpinning(on bool)
- func (n *Spinner) SetState(flags StateFlags, on bool)
- func (n *Spinner) SetTooltip(s string)
- func (n *Spinner) SetTooltipMarkup(markup string)
- func (n *Spinner) SetVAlign(a Align)
- func (n *Spinner) SetVExpand(on bool)
- func (n *Spinner) SetVisible(visible bool)
- func (n *Spinner) SharedElement() string
- func (n *Spinner) SizeRequest() Size
- func (s *Spinner) Spinning() bool
- func (n *Spinner) TooltipMarkup() (string, bool)
- func (n *Spinner) TooltipText() string
- func (n *Spinner) VAlign() Align
- func (n *Spinner) Visible() bool
- type SplitButton
- func (c *SplitButton) Arrange(r render.Rect)
- func (s *SplitButton) Arrow() Boundser
- func (c *SplitButton) Baseline() (int, bool)
- func (c *SplitButton) Children() []Widget
- func (c *SplitButton) HitTest(p Point) Widget
- func (c *SplitButton) Measure(axis Axis, forSize int) Sizes
- func (c *SplitButton) Paint(cv *render.Canvas)
- type Stack
- func (n *Stack) AccessibleName() string
- func (s *Stack) Add(name string, w Widget) *Stack
- func (n *Stack) AddClass(names ...string)
- func (s *Stack) Arrange(r render.Rect)
- func (s *Stack) ArrangeRoot(r render.Rect)
- func (n *Stack) AttachStylesheet(s *Stylesheet)
- func (n *Stack) Attr(name string) (string, bool)
- func (n *Stack) Bounds() render.Rect
- func (s *Stack) Children() []Widget
- func (n *Stack) Classes() []string
- func (n *Stack) DebugName() string
- func (n *Stack) DetachStylesheet(s *Stylesheet)
- func (n *Stack) Element() string
- func (n *Stack) Enabled() bool
- func (n *Stack) HAlign() Align
- func (n *Stack) HasClass(name string) bool
- func (n *Stack) HasState(flags StateFlags) bool
- func (n *Stack) HitLeaf(self Widget, p Point) Widget
- func (s *Stack) HitTest(p Point) Widget
- func (s *Stack) Homogeneous() bool
- func (n *Stack) HoverWithin() bool
- func (n *Stack) ID() string
- func (n *Stack) InlineStyle() string
- func (s *Stack) Insert(i int, name string, w Widget) *Stack
- func (s *Stack) InterpolateSize() bool
- func (n *Stack) Invalidate()
- func (n *Stack) InvalidateLayout()
- func (n *Stack) InvalidateRect(r render.Rect)
- func (n *Stack) LayoutMotion() LayoutMotion
- func (n *Stack) Margin() render.Insets
- func (n *Stack) MaximumSize() Size
- func (s *Stack) Measure(axis Axis, forSize int) Sizes
- func (s *Stack) Move(name string, i int)
- func (s *Stack) Order() []string
- func (s *Stack) Page(name string) Widget
- func (s *Stack) Paint(cv *render.Canvas)
- func (n *Stack) Parent() Widget
- func (s *Stack) Remove(name string) bool
- func (n *Stack) RemoveAttr(name string)
- func (n *Stack) RemoveClass(names ...string)
- func (n *Stack) SetAccessibleName(name string)
- func (n *Stack) SetAttr(name, value string)
- func (n *Stack) SetClass(name string, on bool)
- func (n *Stack) SetClasses(names ...string)
- func (n *Stack) SetCursorName(s string)
- func (n *Stack) SetDebugName(name string)
- func (n *Stack) SetElement(name string)
- func (s *Stack) SetEnabled(enabled bool)
- func (n *Stack) SetFocusOnClick(on bool)
- func (n *Stack) SetHAlign(a Align)
- func (n *Stack) SetHExpand(on bool)
- func (s *Stack) SetHomogeneous(h bool)
- func (n *Stack) SetID(id string)
- func (n *Stack) SetInlineStyle(css string)
- func (n *Stack) SetInlineStylePriority(css string, priority int)
- func (s *Stack) SetInterpolateSize(on bool)
- func (n *Stack) SetLayoutMotion(m LayoutMotion)
- func (n *Stack) SetMargin(m render.Insets)
- func (n *Stack) SetMaximumSize(w, h int)
- func (n *Stack) SetOnClickWithin(fn func())
- func (n *Stack) SetOnFocusChanged(fn func(focused bool))
- func (n *Stack) SetOnHoverWithin(fn func(on bool))
- func (n *Stack) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Stack) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Stack) SetSharedElement(tag string)
- func (n *Stack) SetSizeRequest(w, h int)
- func (n *Stack) SetState(flags StateFlags, on bool)
- func (n *Stack) SetTooltip(s string)
- func (n *Stack) SetTooltipMarkup(markup string)
- func (s *Stack) SetTransition(t StackTransition, d time.Duration)
- func (n *Stack) SetVAlign(a Align)
- func (n *Stack) SetVExpand(on bool)
- func (n *Stack) SetVisible(visible bool)
- func (n *Stack) SharedElement() string
- func (s *Stack) Show(name string)
- func (n *Stack) SizeRequest() Size
- func (s *Stack) Switching() bool
- func (n *Stack) TooltipMarkup() (string, bool)
- func (n *Stack) TooltipText() string
- func (n *Stack) VAlign() Align
- func (s *Stack) Visible() string
- type StackSwitcher
- type StackSwitcherPolicy
- type StackTransition
- type StateAction
- type StateFlags
- type StatusPage
- func (c *StatusPage) Arrange(r render.Rect)
- func (c *StatusPage) Baseline() (int, bool)
- func (c *StatusPage) Children() []Widget
- func (c *StatusPage) HitTest(p Point) Widget
- func (p *StatusPage) Measure(axis Axis, forSize int) Sizes
- func (c *StatusPage) Paint(cv *render.Canvas)
- func (p *StatusPage) SetChild(w Widget)
- func (p *StatusPage) SetIcon(w Widget)
- type Stylesheet
- type StylesheetWatcher
- type Stylus
- type StylusHandler
- type StylusTool
- type SurfaceHost
- type SwatchPicker
- func (c *SwatchPicker) Arrange(r render.Rect)
- func (c *SwatchPicker) Baseline() (int, bool)
- func (c *SwatchPicker) Children() []Widget
- func (p *SwatchPicker) Color() render.Color
- func (p *SwatchPicker) Expanded() bool
- func (c *SwatchPicker) HitTest(p Point) Widget
- func (c *SwatchPicker) Measure(axis Axis, forSize int) Sizes
- func (c *SwatchPicker) Paint(cv *render.Canvas)
- func (p *SwatchPicker) SetColor(c render.Color)
- func (p *SwatchPicker) SetCustom(colors []render.Color)
- type SwipeDismiss
- func (n *SwipeDismiss) AccessibleName() string
- func (n *SwipeDismiss) AddClass(names ...string)
- func (s *SwipeDismiss) Arrange(r render.Rect)
- func (n *SwipeDismiss) AttachStylesheet(s *Stylesheet)
- func (n *SwipeDismiss) Attr(name string) (string, bool)
- func (n *SwipeDismiss) Bounds() render.Rect
- func (s *SwipeDismiss) Child() Widget
- func (s *SwipeDismiss) Children() []Widget
- func (s *SwipeDismiss) ClaimPixels(dx, dy float64) bool
- func (n *SwipeDismiss) Classes() []string
- func (n *SwipeDismiss) DebugName() string
- func (n *SwipeDismiss) DetachStylesheet(s *Stylesheet)
- func (s *SwipeDismiss) DragMove(p Point)
- func (n *SwipeDismiss) Element() string
- func (n *SwipeDismiss) Enabled() bool
- func (n *SwipeDismiss) HAlign() Align
- func (n *SwipeDismiss) HasClass(name string) bool
- func (n *SwipeDismiss) HasState(flags StateFlags) bool
- func (n *SwipeDismiss) HitLeaf(self Widget, p Point) Widget
- func (s *SwipeDismiss) HitTest(p Point) Widget
- func (n *SwipeDismiss) HoverWithin() bool
- func (n *SwipeDismiss) ID() string
- func (n *SwipeDismiss) InlineStyle() string
- func (s *SwipeDismiss) InterceptDrag(from, at Point) bool
- func (n *SwipeDismiss) Invalidate()
- func (n *SwipeDismiss) InvalidateLayout()
- func (n *SwipeDismiss) InvalidateRect(r render.Rect)
- func (n *SwipeDismiss) LayoutMotion() LayoutMotion
- func (n *SwipeDismiss) Margin() render.Insets
- func (n *SwipeDismiss) MaximumSize() Size
- func (s *SwipeDismiss) Measure(axis Axis, forSize int) Sizes
- func (s *SwipeDismiss) Offset() float64
- func (s *SwipeDismiss) Paint(cv *render.Canvas)
- func (n *SwipeDismiss) Parent() Widget
- func (s *SwipeDismiss) PressEnd()
- func (n *SwipeDismiss) RemoveAttr(name string)
- func (n *SwipeDismiss) RemoveClass(names ...string)
- func (s *SwipeDismiss) ScrollEnd()
- func (n *SwipeDismiss) SetAccessibleName(name string)
- func (n *SwipeDismiss) SetAttr(name, value string)
- func (n *SwipeDismiss) SetClass(name string, on bool)
- func (n *SwipeDismiss) SetClasses(names ...string)
- func (n *SwipeDismiss) SetCursorName(s string)
- func (n *SwipeDismiss) SetDebugName(name string)
- func (n *SwipeDismiss) SetElement(name string)
- func (n *SwipeDismiss) SetEnabled(enabled bool)
- func (n *SwipeDismiss) SetFocusOnClick(on bool)
- func (n *SwipeDismiss) SetHAlign(a Align)
- func (n *SwipeDismiss) SetHExpand(on bool)
- func (n *SwipeDismiss) SetID(id string)
- func (n *SwipeDismiss) SetInlineStyle(css string)
- func (n *SwipeDismiss) SetInlineStylePriority(css string, priority int)
- func (n *SwipeDismiss) SetLayoutMotion(m LayoutMotion)
- func (n *SwipeDismiss) SetMargin(m render.Insets)
- func (n *SwipeDismiss) SetMaximumSize(w, h int)
- func (n *SwipeDismiss) SetOnClickWithin(fn func())
- func (n *SwipeDismiss) SetOnFocusChanged(fn func(focused bool))
- func (n *SwipeDismiss) SetOnHoverWithin(fn func(on bool))
- func (n *SwipeDismiss) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *SwipeDismiss) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *SwipeDismiss) SetSharedElement(tag string)
- func (n *SwipeDismiss) SetSizeRequest(w, h int)
- func (n *SwipeDismiss) SetState(flags StateFlags, on bool)
- func (n *SwipeDismiss) SetTooltip(s string)
- func (n *SwipeDismiss) SetTooltipMarkup(markup string)
- func (n *SwipeDismiss) SetVAlign(a Align)
- func (n *SwipeDismiss) SetVExpand(on bool)
- func (n *SwipeDismiss) SetVisible(visible bool)
- func (n *SwipeDismiss) SharedElement() string
- func (n *SwipeDismiss) SizeRequest() Size
- func (n *SwipeDismiss) TooltipMarkup() (string, bool)
- func (n *SwipeDismiss) TooltipText() string
- func (n *SwipeDismiss) VAlign() Align
- func (n *SwipeDismiss) Visible() bool
- type Switch
- func (n *Switch) AccessibleName() string
- func (n *Switch) AddClass(names ...string)
- func (s *Switch) Arrange(r render.Rect)
- func (n *Switch) AttachStylesheet(s *Stylesheet)
- func (n *Switch) Attr(name string) (string, bool)
- func (s *Switch) BindAction(c Checkable) (unbind func())
- func (s *Switch) BindOn(b *Binding[bool]) (unbind func())
- func (n *Switch) Bounds() render.Rect
- func (n *Switch) Classes() []string
- func (s *Switch) ClickAt(Point)
- func (n *Switch) DebugName() string
- func (n *Switch) DetachStylesheet(s *Stylesheet)
- func (n *Switch) Element() string
- func (n *Switch) Enabled() bool
- func (n *Switch) HAlign() Align
- func (n *Switch) HasClass(name string) bool
- func (n *Switch) HasState(flags StateFlags) bool
- func (n *Switch) HitLeaf(self Widget, p Point) Widget
- func (s *Switch) HitTest(p Point) Widget
- func (n *Switch) HoverWithin() bool
- func (n *Switch) ID() string
- func (n *Switch) InlineStyle() string
- func (s *Switch) InsertRune(r rune)
- func (n *Switch) Invalidate()
- func (n *Switch) InvalidateLayout()
- func (n *Switch) InvalidateRect(r render.Rect)
- func (s *Switch) KeyAction(a KeyAction, _ Mods)
- func (n *Switch) LayoutMotion() LayoutMotion
- func (n *Switch) Margin() render.Insets
- func (n *Switch) MaximumSize() Size
- func (s *Switch) Measure(axis Axis, forSize int) Sizes
- func (s *Switch) On() bool
- func (s *Switch) Paint(cv *render.Canvas)
- func (n *Switch) Parent() Widget
- func (n *Switch) RemoveAttr(name string)
- func (n *Switch) RemoveClass(names ...string)
- func (s *Switch) Role() Role
- func (n *Switch) SetAccessibleName(name string)
- func (n *Switch) SetAttr(name, value string)
- func (n *Switch) SetClass(name string, on bool)
- func (n *Switch) SetClasses(names ...string)
- func (n *Switch) SetCursorName(s string)
- func (n *Switch) SetDebugName(name string)
- func (n *Switch) SetElement(name string)
- func (n *Switch) SetEnabled(enabled bool)
- func (n *Switch) SetFocusOnClick(on bool)
- func (n *Switch) SetHAlign(a Align)
- func (n *Switch) SetHExpand(on bool)
- func (n *Switch) SetID(id string)
- func (n *Switch) SetInlineStyle(css string)
- func (n *Switch) SetInlineStylePriority(css string, priority int)
- func (n *Switch) SetLayoutMotion(m LayoutMotion)
- func (n *Switch) SetMargin(m render.Insets)
- func (n *Switch) SetMaximumSize(w, h int)
- func (s *Switch) SetOn(on bool)
- func (n *Switch) SetOnClickWithin(fn func())
- func (n *Switch) SetOnFocusChanged(fn func(focused bool))
- func (n *Switch) SetOnHoverWithin(fn func(on bool))
- func (n *Switch) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Switch) SetOnScroll(fn func(e ScrollEvent) bool)
- func (s *Switch) SetPressed(bool)
- func (n *Switch) SetSharedElement(tag string)
- func (n *Switch) SetSizeRequest(w, h int)
- func (n *Switch) SetState(flags StateFlags, on bool)
- func (n *Switch) SetTooltip(s string)
- func (n *Switch) SetTooltipMarkup(markup string)
- func (n *Switch) SetVAlign(a Align)
- func (n *Switch) SetVExpand(on bool)
- func (n *Switch) SetVisible(visible bool)
- func (n *Switch) SharedElement() string
- func (n *Switch) SizeRequest() Size
- func (s *Switch) Toggle()
- func (n *Switch) TooltipMarkup() (string, bool)
- func (n *Switch) TooltipText() string
- func (n *Switch) VAlign() Align
- func (n *Switch) Visible() bool
- type SwitchRow
- func (c SwitchRow) Arrange(r render.Rect)
- func (c SwitchRow) Baseline() (int, bool)
- func (c SwitchRow) Children() []Widget
- func (c SwitchRow) HitTest(p Point) Widget
- func (c SwitchRow) Measure(axis Axis, forSize int) Sizes
- func (r *SwitchRow) On() bool
- func (p SwitchRow) PackEnd(w Widget)
- func (p SwitchRow) PackStart(w Widget)
- func (r *SwitchRow) Set(on bool)
- func (r *SwitchRow) Switch() *Switch
- type Symbol
- func (n *Symbol) AccessibleName() string
- func (n *Symbol) AddClass(names ...string)
- func (s *Symbol) Arrange(r render.Rect)
- func (n *Symbol) AttachStylesheet(s *Stylesheet)
- func (n *Symbol) Attr(name string) (string, bool)
- func (n *Symbol) Bounds() render.Rect
- func (n *Symbol) Classes() []string
- func (n *Symbol) DebugName() string
- func (n *Symbol) DetachStylesheet(s *Stylesheet)
- func (n *Symbol) Element() string
- func (n *Symbol) Enabled() bool
- func (n *Symbol) HAlign() Align
- func (n *Symbol) HasClass(name string) bool
- func (n *Symbol) HasState(flags StateFlags) bool
- func (n *Symbol) HitLeaf(self Widget, p Point) Widget
- func (s *Symbol) HitTest(p Point) Widget
- func (n *Symbol) HoverWithin() bool
- func (n *Symbol) ID() string
- func (n *Symbol) InlineStyle() string
- func (n *Symbol) Invalidate()
- func (n *Symbol) InvalidateLayout()
- func (n *Symbol) InvalidateRect(r render.Rect)
- func (s *Symbol) Kind() SymbolKind
- func (n *Symbol) LayoutMotion() LayoutMotion
- func (n *Symbol) Margin() render.Insets
- func (n *Symbol) MaximumSize() Size
- func (s *Symbol) Measure(axis Axis, forSize int) Sizes
- func (s *Symbol) Paint(cv *render.Canvas)
- func (n *Symbol) Parent() Widget
- func (n *Symbol) RemoveAttr(name string)
- func (n *Symbol) RemoveClass(names ...string)
- func (n *Symbol) SetAccessibleName(name string)
- func (n *Symbol) SetAttr(name, value string)
- func (n *Symbol) SetClass(name string, on bool)
- func (n *Symbol) SetClasses(names ...string)
- func (n *Symbol) SetCursorName(s string)
- func (n *Symbol) SetDebugName(name string)
- func (n *Symbol) SetElement(name string)
- func (n *Symbol) SetEnabled(enabled bool)
- func (n *Symbol) SetFocusOnClick(on bool)
- func (n *Symbol) SetHAlign(a Align)
- func (n *Symbol) SetHExpand(on bool)
- func (n *Symbol) SetID(id string)
- func (n *Symbol) SetInlineStyle(css string)
- func (n *Symbol) SetInlineStylePriority(css string, priority int)
- func (s *Symbol) SetKind(kind SymbolKind)
- func (n *Symbol) SetLayoutMotion(m LayoutMotion)
- func (n *Symbol) SetMargin(m render.Insets)
- func (n *Symbol) SetMaximumSize(w, h int)
- func (n *Symbol) SetOnClickWithin(fn func())
- func (n *Symbol) SetOnFocusChanged(fn func(focused bool))
- func (n *Symbol) SetOnHoverWithin(fn func(on bool))
- func (n *Symbol) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Symbol) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Symbol) SetSharedElement(tag string)
- func (n *Symbol) SetSizeRequest(w, h int)
- func (n *Symbol) SetState(flags StateFlags, on bool)
- func (n *Symbol) SetTooltip(s string)
- func (n *Symbol) SetTooltipMarkup(markup string)
- func (n *Symbol) SetVAlign(a Align)
- func (n *Symbol) SetVExpand(on bool)
- func (n *Symbol) SetVisible(visible bool)
- func (n *Symbol) SharedElement() string
- func (n *Symbol) SizeRequest() Size
- func (n *Symbol) TooltipMarkup() (string, bool)
- func (n *Symbol) TooltipText() string
- func (n *Symbol) VAlign() Align
- func (n *Symbol) Visible() bool
- type SymbolKind
- type TabBar
- func (c *TabBar) Arrange(r render.Rect)
- func (c *TabBar) Baseline() (int, bool)
- func (c *TabBar) Children() []Widget
- func (b *TabBar) Detach()
- func (b *TabBar) DragEnter(mimes []string, _ Point) string
- func (b *TabBar) Drop(mime string, data []byte, p Point)
- func (b *TabBar) DropAction(transfer.Action) transfer.Action
- func (c *TabBar) HitTest(p Point) Widget
- func (c *TabBar) Measure(axis Axis, forSize int) Sizes
- func (c *TabBar) Paint(cv *render.Canvas)
- func (b *TabBar) Tabs() []Widget
- func (b *TabBar) View() *TabView
- type TabOverview
- func (c *TabOverview) Arrange(r render.Rect)
- func (c *TabOverview) Baseline() (int, bool)
- func (c *TabOverview) Children() []Widget
- func (c *TabOverview) HitTest(p Point) Widget
- func (c *TabOverview) Measure(axis Axis, forSize int) Sizes
- func (o *TabOverview) Open() bool
- func (c *TabOverview) Paint(cv *render.Canvas)
- func (o *TabOverview) SetOpen(on bool)
- type TabPage
- func (p *TabPage) Child() Widget
- func (p *TabPage) Loading() bool
- func (p *TabPage) NeedsAttention() bool
- func (p *TabPage) Pinned() bool
- func (p *TabPage) SetIcon(name string)
- func (p *TabPage) SetIndicator(name string)
- func (p *TabPage) SetLoading(on bool)
- func (p *TabPage) SetNeedsAttention(on bool)
- func (p *TabPage) SetTitle(s string)
- func (p *TabPage) SetTooltip(s string)
- func (p *TabPage) Title() string
- func (p *TabPage) View() *TabView
- type TabTrapper
- type TabView
- func (n *TabView) AccessibleName() string
- func (n *TabView) AddClass(names ...string)
- func (v *TabView) Append(child Widget, title string) *TabPage
- func (v *TabView) Arrange(r render.Rect)
- func (n *TabView) AttachStylesheet(s *Stylesheet)
- func (n *TabView) Attr(name string) (string, bool)
- func (n *TabView) Bounds() render.Rect
- func (v *TabView) Children() []Widget
- func (n *TabView) Classes() []string
- func (v *TabView) ClosePage(p *TabPage) bool
- func (n *TabView) DebugName() string
- func (n *TabView) DetachStylesheet(s *Stylesheet)
- func (n *TabView) Element() string
- func (n *TabView) Enabled() bool
- func (n *TabView) HAlign() Align
- func (n *TabView) HasClass(name string) bool
- func (n *TabView) HasState(flags StateFlags) bool
- func (n *TabView) HitLeaf(self Widget, p Point) Widget
- func (v *TabView) HitTest(p Point) Widget
- func (n *TabView) HoverWithin() bool
- func (n *TabView) ID() string
- func (v *TabView) Index(p *TabPage) int
- func (n *TabView) InlineStyle() string
- func (v *TabView) Insert(i int, child Widget, title string) *TabPage
- func (n *TabView) Invalidate()
- func (n *TabView) InvalidateLayout()
- func (n *TabView) InvalidateRect(r render.Rect)
- func (n *TabView) LayoutMotion() LayoutMotion
- func (n *TabView) Margin() render.Insets
- func (n *TabView) MaximumSize() Size
- func (v *TabView) Measure(axis Axis, forSize int) Sizes
- func (v *TabView) NPages() int
- func (v *TabView) NPinned() int
- func (v *TabView) Pages() []*TabPage
- func (v *TabView) Paint(cv *render.Canvas)
- func (n *TabView) Parent() Widget
- func (v *TabView) Prepend(child Widget, title string) *TabPage
- func (n *TabView) RemoveAttr(name string)
- func (n *TabView) RemoveClass(names ...string)
- func (v *TabView) Reorder(p *TabPage, i int)
- func (v *TabView) Select(p *TabPage)
- func (v *TabView) SelectIndex(i int)
- func (v *TabView) SelectNext()
- func (v *TabView) SelectPrevious()
- func (v *TabView) Selected() *TabPage
- func (n *TabView) SetAccessibleName(name string)
- func (n *TabView) SetAttr(name, value string)
- func (n *TabView) SetClass(name string, on bool)
- func (n *TabView) SetClasses(names ...string)
- func (n *TabView) SetCursorName(s string)
- func (n *TabView) SetDebugName(name string)
- func (n *TabView) SetElement(name string)
- func (n *TabView) SetEnabled(enabled bool)
- func (n *TabView) SetFocusOnClick(on bool)
- func (n *TabView) SetHAlign(a Align)
- func (n *TabView) SetHExpand(on bool)
- func (n *TabView) SetID(id string)
- func (n *TabView) SetInlineStyle(css string)
- func (n *TabView) SetInlineStylePriority(css string, priority int)
- func (n *TabView) SetLayoutMotion(m LayoutMotion)
- func (n *TabView) SetMargin(m render.Insets)
- func (n *TabView) SetMaximumSize(w, h int)
- func (n *TabView) SetOnClickWithin(fn func())
- func (n *TabView) SetOnFocusChanged(fn func(focused bool))
- func (n *TabView) SetOnHoverWithin(fn func(on bool))
- func (n *TabView) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *TabView) SetOnScroll(fn func(e ScrollEvent) bool)
- func (v *TabView) SetPinned(p *TabPage, on bool)
- func (n *TabView) SetSharedElement(tag string)
- func (n *TabView) SetSizeRequest(w, h int)
- func (n *TabView) SetState(flags StateFlags, on bool)
- func (n *TabView) SetTooltip(s string)
- func (n *TabView) SetTooltipMarkup(markup string)
- func (n *TabView) SetVAlign(a Align)
- func (n *TabView) SetVExpand(on bool)
- func (n *TabView) SetVisible(visible bool)
- func (n *TabView) SharedElement() string
- func (n *TabView) SizeRequest() Size
- func (v *TabView) Subscribe(fn func()) (cancel func())
- func (n *TabView) TooltipMarkup() (string, bool)
- func (n *TabView) TooltipText() string
- func (v *TabView) TransferPage(p *TabPage, i int)
- func (n *TabView) VAlign() Align
- func (n *TabView) Visible() bool
- type TableColumn
- type TextArea
- func (n *TextArea) AccessibleName() string
- func (n *TextArea) AddClass(names ...string)
- func (t *TextArea) Arrange(r render.Rect)
- func (n *TextArea) AttachStylesheet(s *Stylesheet)
- func (n *TextArea) Attr(name string) (string, bool)
- func (t *TextArea) AutoIndent() bool
- func (t *TextArea) Backspace()
- func (t *TextArea) BindText(b *Binding[string]) (unbind func())
- func (n *TextArea) Bounds() render.Rect
- func (t *TextArea) CharExtents(offset int) (render.Rect, bool)
- func (n *TextArea) Classes() []string
- func (t *TextArea) ClickAt(p Point)
- func (t *TextArea) Composing() bool
- func (t *TextArea) CursorName() string
- func (t *TextArea) CursorPos() (line, col int)
- func (n *TextArea) DebugName() string
- func (t *TextArea) Delete()
- func (t *TextArea) DeleteWordBackward()
- func (t *TextArea) DeleteWordForward()
- func (n *TextArea) DetachStylesheet(s *Stylesheet)
- func (t *TextArea) Direction() Direction
- func (t *TextArea) DoubleClickAt(p Point)
- func (t *TextArea) DragMove(p Point)
- func (n *TextArea) Element() string
- func (n *TextArea) Enabled() bool
- func (n *TextArea) HAlign() Align
- func (n *TextArea) HasClass(name string) bool
- func (n *TextArea) HasState(flags StateFlags) bool
- func (n *TextArea) HitLeaf(self Widget, p Point) Widget
- func (t *TextArea) HitTest(p Point) Widget
- func (n *TextArea) HoverWithin() bool
- func (n *TextArea) ID() string
- func (t *TextArea) IMECommit(text string)
- func (t *TextArea) IMECursorRect() render.Rect
- func (t *TextArea) IMEDelete(before, after int)
- func (t *TextArea) IMEMultiline() bool
- func (t *TextArea) IMEPreedit(text string, cursorBegin, cursorEnd int)
- func (t *TextArea) IMERevision() IMERevision
- func (t *TextArea) IMESurrounding(limit int) (string, int, int)
- func (t *TextArea) Indent() int
- func (n *TextArea) InlineStyle() string
- func (t *TextArea) Insert(s string)
- func (t *TextArea) InsertRune(r rune)
- func (n *TextArea) Invalidate()
- func (n *TextArea) InvalidateLayout()
- func (n *TextArea) InvalidateRect(r render.Rect)
- func (t *TextArea) KeyAction(a KeyAction, mods Mods)
- func (n *TextArea) LayoutMotion() LayoutMotion
- func (t *TextArea) LineNumbers() bool
- func (n *TextArea) Margin() render.Insets
- func (n *TextArea) MaximumSize() Size
- func (t *TextArea) Measure(axis Axis, forSize int) Sizes
- func (t *TextArea) MoveWord(delta int)
- func (t *TextArea) MoveWordExtending(delta int)
- func (t *TextArea) OffsetAt(p Point) int
- func (t *TextArea) Paint(cv *render.Canvas)
- func (n *TextArea) Parent() Widget
- func (t *TextArea) Placeholder() string
- func (t *TextArea) ReadOnly() bool
- func (t *TextArea) Redo() bool
- func (n *TextArea) RemoveAttr(name string)
- func (n *TextArea) RemoveClass(names ...string)
- func (t *TextArea) Role() Role
- func (t *TextArea) Select(start, end int)
- func (t *TextArea) SelectAll()
- func (t *TextArea) SelectedText() (string, bool)
- func (t *TextArea) Selection() (start, end pos, active bool)
- func (n *TextArea) SetAccessibleName(name string)
- func (n *TextArea) SetAttr(name, value string)
- func (t *TextArea) SetAutoIndent(on bool)
- func (t *TextArea) SetCaret(offset int)
- func (n *TextArea) SetClass(name string, on bool)
- func (n *TextArea) SetClasses(names ...string)
- func (t *TextArea) SetCursor(line, col int)
- func (n *TextArea) SetCursorName(s string)
- func (n *TextArea) SetDebugName(name string)
- func (t *TextArea) SetDirection(d Direction)
- func (n *TextArea) SetElement(name string)
- func (n *TextArea) SetEnabled(enabled bool)
- func (n *TextArea) SetFocusOnClick(on bool)
- func (n *TextArea) SetHAlign(a Align)
- func (n *TextArea) SetHExpand(on bool)
- func (t *TextArea) SetHighlighter(h Highlighter, scheme TextScheme)
- func (n *TextArea) SetID(id string)
- func (t *TextArea) SetIndent(n int)
- func (n *TextArea) SetInlineStyle(css string)
- func (n *TextArea) SetInlineStylePriority(css string, priority int)
- func (n *TextArea) SetLayoutMotion(m LayoutMotion)
- func (t *TextArea) SetLineNumbers(on bool)
- func (n *TextArea) SetMargin(m render.Insets)
- func (n *TextArea) SetMaximumSize(w, h int)
- func (n *TextArea) SetOnClickWithin(fn func())
- func (n *TextArea) SetOnFocusChanged(fn func(focused bool))
- func (n *TextArea) SetOnHoverWithin(fn func(on bool))
- func (n *TextArea) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *TextArea) SetOnScroll(fn func(e ScrollEvent) bool)
- func (t *TextArea) SetPlaceholder(s string)
- func (t *TextArea) SetReadOnly(ro bool)
- func (t *TextArea) SetScheme(scheme TextScheme)
- func (n *TextArea) SetSharedElement(tag string)
- func (n *TextArea) SetSizeRequest(w, h int)
- func (n *TextArea) SetState(flags StateFlags, on bool)
- func (t *TextArea) SetText(s string)
- func (n *TextArea) SetTooltip(s string)
- func (n *TextArea) SetTooltipMarkup(markup string)
- func (n *TextArea) SetVAlign(a Align)
- func (n *TextArea) SetVExpand(on bool)
- func (t *TextArea) SetVariants(v VariantFunc)
- func (n *TextArea) SetVisible(visible bool)
- func (t *TextArea) SetWrap(on bool)
- func (n *TextArea) SharedElement() string
- func (n *TextArea) SizeRequest() Size
- func (t *TextArea) Text() string
- func (t *TextArea) TextLen() int
- func (n *TextArea) TooltipMarkup() (string, bool)
- func (n *TextArea) TooltipText() string
- func (t *TextArea) TrapTab(bool) bool
- func (t *TextArea) Undo() bool
- func (n *TextArea) VAlign() Align
- func (n *TextArea) Visible() bool
- func (t *TextArea) Wrap() bool
- type TextGeometry
- type TextInserter
- type TextScheme
- type TextSelector
- type TextSpan
- type TextStyle
- type Theme
- func (t *Theme) CardColor() Color
- func (t *Theme) ChartColor(i int) Color
- func (t *Theme) DestructiveColor() Color
- func (t *Theme) DisabledAccent() Color
- func (t *Theme) DisabledSurface() Color
- func (t *Theme) DisabledText() Color
- func (t *Theme) DrawShadow(cv *render.Canvas, r render.Rect, radius int)
- func (t *Theme) ErrorColor() Color
- func (t *Theme) HoverAccent() Color
- func (t *Theme) HoverSurface() Color
- func (t *Theme) InputColor() Color
- func (t *Theme) IsDark() bool
- func (t *Theme) MotionDurations() (short, medium, long time.Duration)
- func (t *Theme) Moves() bool
- func (t *Theme) MutedColor() Color
- func (t *Theme) PopoverColor() Color
- func (t *Theme) PressedSurface() Color
- func (t *Theme) RingColor() Color
- func (t *Theme) SecondaryColor() Color
- func (t *Theme) ShadowGutter() int
- func (t *Theme) ShadowRing(r render.Rect) render.Rect
- func (t *Theme) SidebarColor() Color
- func (t *Theme) SuccessColor() Color
- func (t *Theme) TitleSize() float64
- func (t *Theme) WarningColor() Color
- func (t *Theme) WithAccent(c Color) *Theme
- func (t *Theme) WithAccentHex(s string) (*Theme, error)
- func (t *Theme) WithAnimations(on bool) *Theme
- func (t *Theme) WithBg(c Color) *Theme
- func (t *Theme) WithBorder(c Color) *Theme
- func (t *Theme) WithCard(c Color) *Theme
- func (t *Theme) WithInput(c Color) *Theme
- func (t *Theme) WithMotion(short, medium, long time.Duration) *Theme
- func (t *Theme) WithMuted(c Color) *Theme
- func (t *Theme) WithOnAccent(c Color) *Theme
- func (t *Theme) WithPadding(px int) *Theme
- func (t *Theme) WithPopover(c Color) *Theme
- func (t *Theme) WithRadius(px int) *Theme
- func (t *Theme) WithRing(c Color) *Theme
- func (t *Theme) WithSecondary(c Color) *Theme
- func (t *Theme) WithShadowBlur(px int) *Theme
- func (t *Theme) WithShadowColor(c Color) *Theme
- func (t *Theme) WithSidebar(c Color) *Theme
- func (t *Theme) WithSpacing(px int) *Theme
- func (t *Theme) WithSurface(c Color) *Theme
- func (t *Theme) WithSurfaceDisabled(c Color) *Theme
- func (t *Theme) WithSurfaceHover(c Color) *Theme
- func (t *Theme) WithSurfacePressed(c Color) *Theme
- func (t *Theme) WithText(c Color) *Theme
- func (t *Theme) WithTextMuted(c Color) *Theme
- func (t *Theme) WithTextSize(px float64) *Theme
- type TimeOfDay
- type Toast
- func (n *Toast) AccessibleName() string
- func (t *Toast) Action() string
- func (n *Toast) AddClass(names ...string)
- func (t *Toast) Arrange(r render.Rect)
- func (n *Toast) AttachStylesheet(s *Stylesheet)
- func (n *Toast) Attr(name string) (string, bool)
- func (n *Toast) Bounds() render.Rect
- func (n *Toast) Classes() []string
- func (t *Toast) ClickAt(p Point)
- func (t *Toast) Close()
- func (t *Toast) Closed() bool
- func (n *Toast) DebugName() string
- func (t *Toast) Description() string
- func (n *Toast) DetachStylesheet(s *Stylesheet)
- func (t *Toast) Dismiss()
- func (n *Toast) Element() string
- func (n *Toast) Enabled() bool
- func (n *Toast) HAlign() Align
- func (n *Toast) HasClass(name string) bool
- func (n *Toast) HasState(flags StateFlags) bool
- func (n *Toast) HitLeaf(self Widget, p Point) Widget
- func (t *Toast) HitTest(p Point) Widget
- func (t *Toast) HoverMove(p Point)
- func (n *Toast) HoverWithin() bool
- func (n *Toast) ID() string
- func (n *Toast) InlineStyle() string
- func (n *Toast) Invalidate()
- func (n *Toast) InvalidateLayout()
- func (n *Toast) InvalidateRect(r render.Rect)
- func (n *Toast) LayoutMotion() LayoutMotion
- func (n *Toast) Margin() render.Insets
- func (n *Toast) MaximumSize() Size
- func (t *Toast) Measure(axis Axis, forSize int) Sizes
- func (t *Toast) Paint(cv *render.Canvas)
- func (n *Toast) Parent() Widget
- func (n *Toast) RemoveAttr(name string)
- func (n *Toast) RemoveClass(names ...string)
- func (n *Toast) SetAccessibleName(name string)
- func (t *Toast) SetAction(label string, fn func())
- func (n *Toast) SetAttr(name, value string)
- func (n *Toast) SetClass(name string, on bool)
- func (n *Toast) SetClasses(names ...string)
- func (n *Toast) SetCursorName(s string)
- func (n *Toast) SetDebugName(name string)
- func (t *Toast) SetDescription(desc string)
- func (n *Toast) SetElement(name string)
- func (n *Toast) SetEnabled(enabled bool)
- func (n *Toast) SetFocusOnClick(on bool)
- func (n *Toast) SetHAlign(a Align)
- func (n *Toast) SetHExpand(on bool)
- func (t *Toast) SetHovered(on bool)
- func (n *Toast) SetID(id string)
- func (n *Toast) SetInlineStyle(css string)
- func (n *Toast) SetInlineStylePriority(css string, priority int)
- func (n *Toast) SetLayoutMotion(m LayoutMotion)
- func (n *Toast) SetMargin(m render.Insets)
- func (n *Toast) SetMaximumSize(w, h int)
- func (n *Toast) SetOnClickWithin(fn func())
- func (n *Toast) SetOnFocusChanged(fn func(focused bool))
- func (n *Toast) SetOnHoverWithin(fn func(on bool))
- func (n *Toast) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *Toast) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *Toast) SetSharedElement(tag string)
- func (n *Toast) SetSizeRequest(w, h int)
- func (n *Toast) SetState(flags StateFlags, on bool)
- func (t *Toast) SetText(text string)
- func (n *Toast) SetTooltip(s string)
- func (n *Toast) SetTooltipMarkup(markup string)
- func (n *Toast) SetVAlign(a Align)
- func (n *Toast) SetVExpand(on bool)
- func (n *Toast) SetVisible(visible bool)
- func (n *Toast) SharedElement() string
- func (n *Toast) SizeRequest() Size
- func (t *Toast) Text() string
- func (n *Toast) TooltipMarkup() (string, bool)
- func (n *Toast) TooltipText() string
- func (n *Toast) VAlign() Align
- func (n *Toast) Visible() bool
- type ToggleButton
- func (n *ToggleButton) AccessibleName() string
- func (t *ToggleButton) Active() bool
- func (n *ToggleButton) AddClass(names ...string)
- func (n *ToggleButton) AttachStylesheet(s *Stylesheet)
- func (n *ToggleButton) Attr(name string) (string, bool)
- func (t *ToggleButton) BindAction(c Checkable) (unbind func())
- func (n *ToggleButton) Bounds() render.Rect
- func (n *ToggleButton) Classes() []string
- func (n *ToggleButton) DebugName() string
- func (n *ToggleButton) DetachStylesheet(s *Stylesheet)
- func (n *ToggleButton) Element() string
- func (n *ToggleButton) Enabled() bool
- func (n *ToggleButton) HAlign() Align
- func (n *ToggleButton) HasClass(name string) bool
- func (n *ToggleButton) HasState(flags StateFlags) bool
- func (n *ToggleButton) HitLeaf(self Widget, p Point) Widget
- func (n *ToggleButton) HoverWithin() bool
- func (n *ToggleButton) ID() string
- func (n *ToggleButton) InlineStyle() string
- func (n *ToggleButton) Invalidate()
- func (n *ToggleButton) InvalidateLayout()
- func (n *ToggleButton) InvalidateRect(r render.Rect)
- func (n *ToggleButton) LayoutMotion() LayoutMotion
- func (n *ToggleButton) Margin() render.Insets
- func (n *ToggleButton) MaximumSize() Size
- func (n *ToggleButton) Parent() Widget
- func (n *ToggleButton) RemoveAttr(name string)
- func (n *ToggleButton) RemoveClass(names ...string)
- func (t *ToggleButton) Role() Role
- func (n *ToggleButton) SetAccessibleName(name string)
- func (t *ToggleButton) SetActive(on bool)
- func (n *ToggleButton) SetAttr(name, value string)
- func (n *ToggleButton) SetClass(name string, on bool)
- func (n *ToggleButton) SetClasses(names ...string)
- func (n *ToggleButton) SetCursorName(s string)
- func (n *ToggleButton) SetDebugName(name string)
- func (n *ToggleButton) SetElement(name string)
- func (n *ToggleButton) SetEnabled(enabled bool)
- func (n *ToggleButton) SetFocusOnClick(on bool)
- func (t *ToggleButton) SetGroup(other *ToggleButton)
- func (n *ToggleButton) SetHAlign(a Align)
- func (n *ToggleButton) SetHExpand(on bool)
- func (n *ToggleButton) SetID(id string)
- func (n *ToggleButton) SetInlineStyle(css string)
- func (n *ToggleButton) SetInlineStylePriority(css string, priority int)
- func (n *ToggleButton) SetLayoutMotion(m LayoutMotion)
- func (n *ToggleButton) SetMargin(m render.Insets)
- func (n *ToggleButton) SetMaximumSize(w, h int)
- func (n *ToggleButton) SetOnClickWithin(fn func())
- func (n *ToggleButton) SetOnFocusChanged(fn func(focused bool))
- func (n *ToggleButton) SetOnHoverWithin(fn func(on bool))
- func (n *ToggleButton) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *ToggleButton) SetOnScroll(fn func(e ScrollEvent) bool)
- func (n *ToggleButton) SetSharedElement(tag string)
- func (n *ToggleButton) SetSizeRequest(w, h int)
- func (n *ToggleButton) SetState(flags StateFlags, on bool)
- func (n *ToggleButton) SetTooltip(s string)
- func (n *ToggleButton) SetTooltipMarkup(markup string)
- func (n *ToggleButton) SetVAlign(a Align)
- func (n *ToggleButton) SetVExpand(on bool)
- func (n *ToggleButton) SetVisible(visible bool)
- func (n *ToggleButton) SharedElement() string
- func (n *ToggleButton) SizeRequest() Size
- func (n *ToggleButton) TooltipMarkup() (string, bool)
- func (n *ToggleButton) TooltipText() string
- func (n *ToggleButton) VAlign() Align
- func (n *ToggleButton) Visible() bool
- type ToggleGroup
- func (g *ToggleGroup) Active() int
- func (g *ToggleGroup) Append(content Widget)
- func (c *ToggleGroup) Arrange(r render.Rect)
- func (c *ToggleGroup) Baseline() (int, bool)
- func (c *ToggleGroup) Children() []Widget
- func (g *ToggleGroup) Clear()
- func (c *ToggleGroup) HitTest(p Point) Widget
- func (g *ToggleGroup) KeyAction(a KeyAction, _ Mods)
- func (g *ToggleGroup) Len() int
- func (c *ToggleGroup) Measure(axis Axis, forSize int) Sizes
- func (c *ToggleGroup) Paint(cv *render.Canvas)
- func (g *ToggleGroup) SetActive(i int)
- type ToolbarStyle
- type ToolbarView
- func (t *ToolbarView) AddBottomBar(bar Widget)
- func (t *ToolbarView) AddTopBar(bar Widget)
- func (c *ToolbarView) Arrange(r render.Rect)
- func (c *ToolbarView) Baseline() (int, bool)
- func (c *ToolbarView) Children() []Widget
- func (t *ToolbarView) Content() Widget
- func (c *ToolbarView) HitTest(p Point) Widget
- func (c *ToolbarView) Measure(axis Axis, forSize int) Sizes
- func (c *ToolbarView) Paint(cv *render.Canvas)
- func (t *ToolbarView) RevealBottomBars() bool
- func (t *ToolbarView) RevealTopBars() bool
- func (t *ToolbarView) SetBottomBarStyle(s ToolbarStyle)
- func (t *ToolbarView) SetContent(w Widget)
- func (t *ToolbarView) SetExtendContentToBottomEdge(on bool)
- func (t *ToolbarView) SetExtendContentToTopEdge(on bool)
- func (t *ToolbarView) SetRevealBottomBars(on bool)
- func (t *ToolbarView) SetRevealTopBars(on bool)
- func (t *ToolbarView) SetTopBarStyle(s ToolbarStyle)
- type TooltipAnchorer
- type TooltipMarkupper
- type TooltipTexter
- type TouchPointer
- type TouchTracker
- type TreeRow
- type TypedFactory
- type TypedGrid
- func (n *TypedGrid) AccessibleName() string
- func (n *TypedGrid) AddClass(names ...string)
- func (n *TypedGrid) AttachStylesheet(s *Stylesheet)
- func (n *TypedGrid) Attr(name string) (string, bool)
- func (n *TypedGrid) Bounds() render.Rect
- func (n *TypedGrid) Classes() []string
- func (g *TypedGrid[T]) Columns() int
- func (n *TypedGrid) DebugName() string
- func (n *TypedGrid) DetachStylesheet(s *Stylesheet)
- func (n *TypedGrid) Element() string
- func (n *TypedGrid) Enabled() bool
- func (n *TypedGrid) HAlign() Align
- func (n *TypedGrid) HasClass(name string) bool
- func (n *TypedGrid) HasState(flags StateFlags) bool
- func (n *TypedGrid) HitLeaf(self Widget, p Point) Widget
- func (n *TypedGrid) HoverWithin() bool
- func (n *TypedGrid) ID() string
- func (n *TypedGrid) InlineStyle() string
- func (n *TypedGrid) Invalidate()
- func (n *TypedGrid) InvalidateLayout()
- func (n *TypedGrid) InvalidateRect(r render.Rect)
- func (n *TypedGrid) LayoutMotion() LayoutMotion
- func (n *TypedGrid) Margin() render.Insets
- func (g *TypedGrid[T]) MaxColumns() int
- func (n *TypedGrid) MaximumSize() Size
- func (g *TypedGrid[T]) MinColumns() int
- func (n *TypedGrid) Parent() Widget
- func (n *TypedGrid) RemoveAttr(name string)
- func (n *TypedGrid) RemoveClass(names ...string)
- func (s *TypedGrid) Select(i int)
- func (s *TypedGrid) SelectAll()
- func (s *TypedGrid) SelectRows(rows ...int)
- func (s *TypedGrid) Selected() int
- func (s *TypedGrid) Selection() []int
- func (s *TypedGrid) SelectionMode() SelectionMode
- func (n *TypedGrid) SetAccessibleName(name string)
- func (n *TypedGrid) SetAttr(name, value string)
- func (n *TypedGrid) SetClass(name string, on bool)
- func (n *TypedGrid) SetClasses(names ...string)
- func (n *TypedGrid) SetCursorName(s string)
- func (n *TypedGrid) SetDebugName(name string)
- func (n *TypedGrid) SetElement(name string)
- func (n *TypedGrid) SetEnabled(enabled bool)
- func (n *TypedGrid) SetFocusOnClick(on bool)
- func (n *TypedGrid) SetHAlign(a Align)
- func (n *TypedGrid) SetHExpand(on bool)
- func (n *TypedGrid) SetID(id string)
- func (n *TypedGrid) SetInlineStyle(css string)
- func (n *TypedGrid) SetInlineStylePriority(css string, priority int)
- func (n *TypedGrid) SetLayoutMotion(m LayoutMotion)
- func (n *TypedGrid) SetMargin(m render.Insets)
- func (g *TypedGrid[T]) SetMaxColumns(n int)
- func (n *TypedGrid) SetMaximumSize(w, h int)
- func (g *TypedGrid[T]) SetMinColumns(n int)
- func (n *TypedGrid) SetOnClickWithin(fn func())
- func (n *TypedGrid) SetOnFocusChanged(fn func(focused bool))
- func (n *TypedGrid) SetOnHoverWithin(fn func(on bool))
- func (n *TypedGrid) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *TypedGrid) SetOnScroll(fn func(e ScrollEvent) bool)
- func (s *TypedGrid) SetSelectionMode(mode SelectionMode)
- func (n *TypedGrid) SetSharedElement(tag string)
- func (n *TypedGrid) SetSizeRequest(w, h int)
- func (n *TypedGrid) SetState(flags StateFlags, on bool)
- func (n *TypedGrid) SetTooltip(s string)
- func (n *TypedGrid) SetTooltipMarkup(markup string)
- func (n *TypedGrid) SetVAlign(a Align)
- func (n *TypedGrid) SetVExpand(on bool)
- func (n *TypedGrid) SetVisible(visible bool)
- func (n *TypedGrid) SharedElement() string
- func (n *TypedGrid) SizeRequest() Size
- func (n *TypedGrid) TooltipMarkup() (string, bool)
- func (n *TypedGrid) TooltipText() string
- func (n *TypedGrid) VAlign() Align
- func (n *TypedGrid) Visible() bool
- type TypedItems
- func (m *TypedItems[T]) Append(item T)
- func (m *TypedItems[T]) Clear()
- func (m *TypedItems[T]) Get(i int) T
- func (m *TypedItems[T]) Insert(i int, item T)
- func (m *TypedItems[T]) InsertSorted(item T, cmp func(a, b T) int) int
- func (m *TypedItems[T]) Len() int
- func (m *TypedItems[T]) Notify()
- func (m *TypedItems[T]) NotifyItem(i int)
- func (m *TypedItems[T]) RemoveAt(i int)
- func (m *TypedItems[T]) Row(i int) T
- func (m *TypedItems[T]) Set(i int, item T)
- func (m *TypedItems[T]) SetItemRefresh(fn func(i int))
- func (m *TypedItems[T]) SetRefresh(fn func())
- type TypedList
- func (n *TypedList) AccessibleName() string
- func (n *TypedList) AddClass(names ...string)
- func (l *TypedList[T]) AddFilter(keep func(T) bool) *ViewFilter[T]
- func (n *TypedList) AttachStylesheet(s *Stylesheet)
- func (n *TypedList) Attr(name string) (string, bool)
- func (n *TypedList) Bounds() render.Rect
- func (n *TypedList) Classes() []string
- func (l *TypedList[T]) ClearFilters()
- func (n *TypedList) DebugName() string
- func (n *TypedList) DetachStylesheet(s *Stylesheet)
- func (n *TypedList) Element() string
- func (n *TypedList) Enabled() bool
- func (n *TypedList) HAlign() Align
- func (n *TypedList) HasClass(name string) bool
- func (n *TypedList) HasState(flags StateFlags) bool
- func (n *TypedList) HitLeaf(self Widget, p Point) Widget
- func (n *TypedList) HoverWithin() bool
- func (n *TypedList) ID() string
- func (n *TypedList) InlineStyle() string
- func (n *TypedList) Invalidate()
- func (n *TypedList) InvalidateLayout()
- func (n *TypedList) InvalidateRect(r render.Rect)
- func (l *TypedList[T]) ItemChanged(i int)
- func (n *TypedList) LayoutMotion() LayoutMotion
- func (n *TypedList) Margin() render.Insets
- func (n *TypedList) MaximumSize() Size
- func (n *TypedList) Parent() Widget
- func (l *TypedList[T]) PopFilter()
- func (l *TypedList[T]) Refresh()
- func (n *TypedList) RemoveAttr(name string)
- func (n *TypedList) RemoveClass(names ...string)
- func (l *TypedList[T]) Row(i int) T
- func (l *TypedList[T]) Rows() int
- func (s *TypedList) Select(i int)
- func (s *TypedList) SelectAll()
- func (s *TypedList) SelectRows(rows ...int)
- func (s *TypedList) Selected() int
- func (l *TypedList[T]) SelectedItem() (item T, ok bool)
- func (l *TypedList[T]) SelectedItems() []T
- func (s *TypedList) Selection() []int
- func (s *TypedList) SelectionMode() SelectionMode
- func (n *TypedList) SetAccessibleName(name string)
- func (n *TypedList) SetAttr(name, value string)
- func (n *TypedList) SetClass(name string, on bool)
- func (n *TypedList) SetClasses(names ...string)
- func (n *TypedList) SetCursorName(s string)
- func (n *TypedList) SetDebugName(name string)
- func (n *TypedList) SetElement(name string)
- func (n *TypedList) SetEnabled(enabled bool)
- func (l *TypedList[T]) SetFilterStatus(f *ViewFilter[T], on bool)
- func (n *TypedList) SetFocusOnClick(on bool)
- func (n *TypedList) SetHAlign(a Align)
- func (n *TypedList) SetHExpand(on bool)
- func (n *TypedList) SetID(id string)
- func (n *TypedList) SetInlineStyle(css string)
- func (n *TypedList) SetInlineStylePriority(css string, priority int)
- func (n *TypedList) SetLayoutMotion(m LayoutMotion)
- func (n *TypedList) SetMargin(m render.Insets)
- func (n *TypedList) SetMaximumSize(w, h int)
- func (l *TypedList[T]) SetModel(m ColumnModel[T])
- func (n *TypedList) SetOnClickWithin(fn func())
- func (n *TypedList) SetOnFocusChanged(fn func(focused bool))
- func (n *TypedList) SetOnHoverWithin(fn func(on bool))
- func (n *TypedList) SetOnPointer(fn func(e PointerEvent) bool)
- func (n *TypedList) SetOnScroll(fn func(e ScrollEvent) bool)
- func (s *TypedList) SetSelectionMode(mode SelectionMode)
- func (n *TypedList) SetSharedElement(tag string)
- func (n *TypedList) SetSizeRequest(w, h int)
- func (l *TypedList[T]) SetSort(cmp func(a, b T) int)
- func (n *TypedList) SetState(flags StateFlags, on bool)
- func (n *TypedList) SetTooltip(s string)
- func (n *TypedList) SetTooltipMarkup(markup string)
- func (n *TypedList) SetVAlign(a Align)
- func (n *TypedList) SetVExpand(on bool)
- func (n *TypedList) SetVisible(visible bool)
- func (n *TypedList) SharedElement() string
- func (n *TypedList) SizeRequest() Size
- func (n *TypedList) TooltipMarkup() (string, bool)
- func (n *TypedList) TooltipText() string
- func (n *TypedList) VAlign() Align
- func (n *TypedList) Visible() bool
- type Undoer
- type VariantFunc
- type Video
- func (c *Video) Arrange(r render.Rect)
- func (v *Video) Autoplay() bool
- func (c *Video) Baseline() (int, bool)
- func (c *Video) Children() []Widget
- func (v *Video) Controls() *MediaControls
- func (c *Video) HitTest(p Point) Widget
- func (c *Video) Measure(axis Axis, forSize int) Sizes
- func (c *Video) Paint(cv *render.Canvas)
- func (v *Video) Scale() ImageScale
- func (v *Video) SetAutoplay(on bool)
- func (v *Video) SetScale(s ImageScale)
- func (v *Video) SetStream(stream *media.Stream)
- func (v *Video) Stream() *media.Stream
- type ViewFilter
- type ViewSwitcher
- func (c ViewSwitcher) Arrange(r render.Rect)
- func (c ViewSwitcher) Baseline() (int, bool)
- func (c ViewSwitcher) Children() []Widget
- func (c ViewSwitcher) HitTest(p Point) Widget
- func (c ViewSwitcher) Measure(axis Axis, forSize int) Sizes
- func (c ViewSwitcher) Paint(cv *render.Canvas)
- func (v *ViewSwitcher) ReflectVisible()
- func (v *ViewSwitcher) SetPolicy(p StackSwitcherPolicy)
- func (v *ViewSwitcher) Sync()
- type Widget
- type WindowControls
- func (c *WindowControls) Arrange(r render.Rect)
- func (c *WindowControls) Baseline() (int, bool)
- func (c *WindowControls) Children() []Widget
- func (c *WindowControls) HitTest(p Point) Widget
- func (c *WindowControls) Measure(axis Axis, forSize int) Sizes
- func (c *WindowControls) Paint(cv *render.Canvas)
- func (c *WindowControls) ShowClose(on bool)
- func (c *WindowControls) ShowMaximize(on bool)
- func (c *WindowControls) ShowMinimize(on bool)
- func (c *WindowControls) Shown() (closeBtn, minimize, maximize bool)
- type WindowDoubleClickable
- type WindowMover
- type WindowTitle
- func (c *WindowTitle) Arrange(r render.Rect)
- func (c *WindowTitle) Baseline() (int, bool)
- func (c *WindowTitle) Children() []Widget
- func (c *WindowTitle) HitTest(p Point) Widget
- func (c *WindowTitle) Measure(axis Axis, forSize int) Sizes
- func (c *WindowTitle) Paint(cv *render.Canvas)
- func (w *WindowTitle) SetSubtitle(s string)
- func (w *WindowTitle) SetTitle(s string)
- func (w *WindowTitle) Subtitle() string
- func (w *WindowTitle) Title() string
Examples ¶
Constants ¶
const ( // DirectionAuto resolves the base from the paragraph's first strong // character (UAX #9 rules P2-P3). It is the zero value: existing // LTR content renders unchanged, and a Hebrew- or Arabic-first // paragraph lays out right to left on its own. DirectionAuto = text.DirectionAuto // DirectionLTR forces a left-to-right base; start hugs the left. DirectionLTR = text.DirectionLTR // DirectionRTL forces a right-to-left base; start hugs the right, // and a Box row flows from the right edge. DirectionRTL = text.DirectionRTL )
const ( // ImageFit scales the image to fit the box with its aspect ratio // kept; the default. ImageFit = render.ImageFit // ImageCover fills the box completely, cropping the overflow. ImageCover = render.ImageCover // ImageNone draws the image at its natural size, one source pixel // per device pixel, centered and clipped. ImageNone = render.ImageNone // ImageStretch fills the box exactly, ignoring the aspect ratio. ImageStretch = render.ImageStretch // ImageScaleDown draws the natural size when it fits and shrinks to // fit (aspect kept) when it does not; it never enlarges. ImageScaleDown = render.ImageScaleDown )
const ( // EllipsizeNone never truncates: long text overflows and clips. EllipsizeNone = render.EllipsizeNone // EllipsizeStart cuts from the front: "…cated text". EllipsizeStart = render.EllipsizeStart // EllipsizeMiddle keeps the head and the tail: "trunc…text" - the // mode for paths and filenames. EllipsizeMiddle = render.EllipsizeMiddle // EllipsizeEnd cuts from the back: "truncated te…". EllipsizeEnd = render.EllipsizeEnd )
const ( LayoutMotionNone = style.LayoutMotionNone LayoutMotionSmooth = style.LayoutMotionSmooth LayoutMotionSnappy = style.LayoutMotionSnappy LayoutMotionBouncy = style.LayoutMotionBouncy )
The layout motions.
const ( LevelBarOffsetLow = "low" LevelBarOffsetHigh = "high" LevelBarOffsetFull = "full" )
The default level bar offsets, GTK's names and thresholds; the theme layer colors a block carrying each (warning, accent, success).
const ( // StylePriorityFallback is for defaults below everything. StylePriorityFallback = style.PriorityFallback // StylePriorityTheme is for a theme's stylesheet. StylePriorityTheme = style.PriorityTheme // StylePrioritySettings is for settings-derived rules. StylePrioritySettings = style.PrioritySettings // StylePriorityApplication is the application's own stylesheet; // LoadStylesheet installs at it. StylePriorityApplication = style.PriorityApplication // StylePriorityUser is for user overrides, and the default priority // of a widget's inline style. StylePriorityUser = style.PriorityUser )
Style priorities, GTK's provider priorities: a higher priority wins over any specificity below it; equal priorities fall to specificity, then to load order.
const BTNLeft uint32 = 0x110
BTNLeft is the wayland button code of the primary pointer button.
const BTNMiddle uint32 = 0x112
BTNMiddle is the wayland button code of the middle pointer button, the X11 paste button.
const BTNRight uint32 = 0x111
BTNRight is the wayland button code of the secondary pointer button.
const BackLabelPrefix = "‹ "
BackLabelPrefix leads the back row's label (the parent row's label follows).
const FocusRingWidth = 3
FocusRingWidth is the width of the keyboard focus ring: the window's ring around the focused widget, and an outline-style: auto outline that declares no width of its own.
const GTKTextWidth = 150
GTKTextWidth is a GtkEntry's text width without width-chars (GtkText's MIN_TEXT_WIDTH): pass it to SetTextWidth for a field sized the way GTK sizes one.
const PopoverGap = 4
PopoverGap is the distance a popover or menu keeps from the trigger that opened it.
const TabMime = "application/x-lys-ui-tab"
TabMime is the drag payload of a dragged tab: its page id, which any TabBar in the process resolves to move the page.
const Unknown = -1
Unknown is a forSize the measuring container does not know yet: a width asked before any height is decided.
Variables ¶
var ErrGPUAreaOffscreen = errors.New("widget: the GPUArea is not on screen yet")
ErrGPUAreaOffscreen reports a GPUArea call before the area is on screen: frames are imported and presented once OnFrame first runs.
var ErrNotFocusable = errors.New("widget: not focusable")
ErrNotFocusable is SetFocus refusing a widget that cannot take focus: it has no KeyActionHandler, opted out, or is disabled or hidden.
var ErrNotInTree = errors.New("widget: not in the focused tree")
ErrNotInTree is SetFocus refusing a widget outside the router's tree.
Functions ¶
func A11yGeneration ¶ added in v0.2.5
func A11yGeneration() uint64
A11yGeneration moves whenever what an assistive technology reads may have changed: on any damage, and on the changes that paint nothing. Safe from any goroutine.
func ActivateMnemonic ¶
ActivateMnemonic fires the first mnemonic bound to sym at or below w, in paint order, and reports whether one fired. Hosts that hold raw keys for a tree (a popover's key root) route Alt-letter presses through here.
func ArrangeAsChild ¶
ArrangeAsChild arranges w in r as a container arranges its child: inside its margin, held to its CSS bounds. MeasureAsChild's pair.
func BackdropRegion ¶
BackdropRegion is the region behind root's tree a compositor blurs: the rounded border boxes, at the rects they show at, of the shown widgets whose style blurs their backdrop (backdrop-filter, the glass family). A glass root is the whole region. A tree without any is the root's own box, a window blurred behind as a whole.
The answer is kept on root until a widget moved, restyled, or the tree changed (shapeGen), so a frame that changed none of it walks nothing. The slice stays root's: the caller reads it and copies what it keeps.
func BackdropWalks ¶ added in v0.2.5
func BackdropWalks() int
BackdropWalks counts the tree walks BackdropRegion made; tests use it to pin that a frame changing no shape walks nothing.
func CSSCursorOf ¶
CSSCursorOf returns the cursor the stylesheet asks for over w: an xcursor shape name the session resolves ("pointer", "ns-resize", the hidden "none"), or a file request built from cursor: url() and its hotspot. Empty when no cursor declaration reaches w or it is auto — the caller falls back to the widget's own shape. The value inherits, so one declaration covers a subtree.
func CascadeBorder ¶
CascadeBorder resolves the widget's computed border widths: the stroke a canvas-drawn primitive takes from the stylesheet (the progress ring reads the top width as its stroke).
func CascadeColor ¶
CascadeColor resolves the widget's computed color: the CSS `color`, inherited down the tree, which the canvas-drawn primitives take as their ink (the progress ring's stroke). Zero paints nothing — the no-stylesheet behavior, same as everywhere else.
func CollectDamage ¶
CollectDamage drains every pending invalidation in the tree and returns the repaint rects in root coordinates plus whether anything is owed. Rects may overlap; the caller can clip painting to their bounding box and damage each rect on the wire. Draining clears the flags, so an empty result means the tree paints identically to the last frame.
func CollectDamageInto ¶
CollectDamageInto is CollectDamage reusing buf's storage for the rects, so a frame loop that keeps its buffer drains without allocating.
func CornerRadii ¶
CornerRadii is w's border-box corner rounding as its stylesheet sets it: the shape a focus ring or a compositor blur region follows. Unstyled corners are square.
func CursorNameOf ¶
CursorNameOf returns the hover pointer shape SetCursorName put on w, empty when none — the fallback cursorFor reads after the widget's own CursorName.
func DamageArea ¶
DamageArea returns the total pixel area the rects cover, counting overlaps once per rect. Tests use it to pin how much of a frame a damage-restricted repaint touches.
func DamageGeneration ¶
func DamageGeneration() uint64
DamageGeneration returns the current damage generation; it is never zero.
func DamageReport ¶
func DamageReport() string
DamageReport returns the widgets that owed their whole bounds since the last call, largest first ("1920x1080 *widget.Box invalid, ..."), and clears them; "" when there were none or the build lacks the lysdebug tag. The app logs it per frame under LYS_DEBUG=damage.
func DamageWalks ¶
func DamageWalks() uint64
DamageWalks counts the damage walks the process has run; tests use it to pin the idle skip.
func DefaultSwatches ¶
DefaultSwatches is the preset palette a ColorButton offers: neutrals then the hues around the wheel.
func DescendsFrom ¶
DescendsFrom reports whether w is ancestor or a descendant of it - the walk the input pipeline uses to find a drag handle under a press that resolved into a child control.
func Detach ¶
func Detach(w Widget)
Detach releases what w's tree holds for being on screen, for a tree leaving it (a removed widget, a closed window or popover): every GPUArea's surface, and the rasters every Image resampled from a source only it holds. A tree shown again re-creates them on its next paint.
func DeviceScaleOf ¶ added in v0.2.5
DeviceScaleOf returns the device scale w's tree presents at, num device pixels per denom logical ones, as SetDeviceScale set it on its style root; 0/120 while unknown.
func DumpTree ¶
DumpTree renders the tree as one indented line per widget: type, debug name, bounds, role, tooltip, and the set input-state flags. The format is stable - tests pin it byte for byte - so a dump pasted into a bug report says exactly the same thing to everyone.
*widget.Box bounds=0,0+400x200
*widget.Button name=save bounds=8,8+72x36 role=button tooltip="Save" focusable
*widget.Label bounds=18,17+52x18 role=label focusable
Flags read "this widget IS the router's X target": focused, hover, pressed. focusable marks Tab-reachable widgets. r may be nil.
func DumpTreeTo ¶
DumpTreeTo writes the DumpTree format to w.
func ErrorBell ¶
func ErrorBell(w Widget)
ErrorBell signals an input w rejected (gtk_widget_error_bell): typing into a read-only field, a value that does not parse. The application rings the system bell for w's window; the compositor may flash it instead.
func FocusRingRect ¶
FocusRingRect is the rect the keyboard focus ring of a focused w covers: its FocusRingOwner's border box grown by FocusRingWidth on every side. It is empty when the owner reports no bounds.
func FocusVisible ¶
FocusVisible reports whether w holds a focus that should show (:focus-visible): one that arrived by keyboard traversal, not by a pointer press or SetFocus.
func FontFaceResolved ¶ added in v0.2.5
func FontFaceResolved()
FontFaceResolved tells the widgets a fallback chain has a new face: text shaped before it shapes again, and the windows lay out and paint on the loop's next pass. It is a render.Chain's onResolved, safe on any goroutine. Answers that land before the loop has taken the last one share one relayout. Without a loop, only text painted from here on is shaped anew.
func FormatColor ¶
FormatColor writes c as the hex form ParseColor reads back: #rrggbb when opaque, #rrggbbaa otherwise (straight alpha).
func GrabFocus ¶
GrabFocus moves the keyboard focus of w's surface to w (GTK's gtk_widget_grab_focus): a form focusing its first invalid field. A widget that cannot take focus fails with ErrNotFocusable and leaves it where it was.
func HasClass ¶
HasClass reports whether w carries the style class — the read side for tests and accessibility tooling.
func Host ¶
func Host(root Widget) (unhost func())
Host marks root as the top of a tree a host shows on screen, a window's or a popover's, and returns the call that ends it. Only widgets under a hosted root animate: a subtree removed from its tree, a tree whose window closed, or one a test arranged and dropped schedules no frames. Hosting a widget twice is one hosting.
func IconSearchPaths ¶
func IconSearchPaths() []string
IconSearchPaths returns the base directories theme icons resolve from: what SetIconSearchPaths set, else the XDG default (GTK's IconTheme.search_path).
func InkOutset ¶
InkOutset is how far w paints outside its bounds: its box shadows, outline, border image and filters. A surface whose card w is reserves that room around it.
func InputRegionOf ¶
InputRegionOf is the input region of root's content: the first InputRegioner down from root through wrappers of a single child (a Revealer, a Clamp, a one-child Box), and false when there is none.
func IsEnabled ¶
IsEnabled reports whether w accepts input: its own flag AND every ancestor's, so disabling a container disables its subtree by query (see node.SetEnabled for why propagation is a walk, not a rewrite). Widgets that carry no enable state — third-party Widget implementations without an Enabled method — read as enabled, and so does nil (nothing there to block). Parents are recorded during Arrange, so call it on an arranged tree.
func IsInteractive ¶
IsInteractive reports whether w or any ancestor consumes presses: buttons, sliders, toggles, text inputs, and scroll areas. Hit tests return the deepest widget, often a plain label inside a control, so apps checking "was this chrome?" must walk up. Parents are recorded during Arrange, so call it on an arranged tree. Enabled state does not change the answer: a disabled button is still interactive — it consumes the press and swallows it — never chrome.
func IsVisible ¶
IsVisible folds the visibility of every ancestor: false when the widget or any container above it is hidden, by SetVisible or by a computed display: none — either way the widget is not laid out, painted, or hit. CSS visibility: hidden keeps the widget laid out and is not folded here (shown).
func LayoutPending ¶
LayoutPending reports whether w's cached measure is stale - a descendant was parented, restyled or resized since - so a host that just arranged it must measure and arrange again before painting.
func LoadStylesheet ¶
func LoadStylesheet(css string)
LoadStylesheet parses css and installs it as the application stylesheet (StylePriorityApplication), replacing whatever LoadStylesheet loaded before. An empty string removes it. Other stylesheets added with AddStylesheet are untouched.
func LoadStylesheetFile ¶
LoadStylesheetFile loads a stylesheet from path as the application stylesheet (StylePriorityApplication), replacing whatever LoadStylesheetFile loaded before, with the same hot reload AddStylesheetFile starts.
func MarkA11yChanged ¶ added in v0.2.5
func MarkA11yChanged()
MarkA11yChanged moves A11yGeneration without owing a frame: an accessible name, or a window coming or going.
func MarkLoop ¶
func MarkLoop()
MarkLoop records the calling goroutine as the event-loop goroutine and arms the guard: a sampled widget mutation from any other goroutine now trips the off-loop hook. Application.Run marks its own goroutine; tests can mark whichever goroutine they drive the tree on.
func MeasureMissReport ¶
func MeasureMissReport() string
MeasureMissReport returns the measure-cache misses since the last call, most frequent first ("12 uncached *widget.Box, ..."), and clears them; "" when there were none or the build lacks the lysdebug tag. The app logs it per frame under LYS_DEBUG=measure.
func MediaViewportOf ¶
MediaViewportOf returns the @media viewport w's tree computes against: its style root's own size, else the global one; 0×0 until either is set.
func OpenMenu ¶
func OpenMenu(from Widget, anchor Boundser, face render.Font, sizePx float64, items []MenuItem, opts MenuOptions)
OpenMenu opens items as a popup menu beside anchor through the host of from's tree.
func OpenPopover ¶
func OpenPopover(from Widget, anchor Boundser, content Widget, opts PopoverOptions) (close func())
OpenPopover opens content in a popover beside anchor through the host of from's tree, and returns what closes it. The popover's own node is a box around content, so content keeps its element and style.
func PaintBoxLayers ¶
PaintBoxLayers paints the widget's computed box layers — background, image, borders, shadows, and the outline — at its bounds. A custom widget's Paint calls it for its own chrome before drawing content, so the container styling stays in the cascade (the hovered row's background, the :hover rule, is this). The opacity and brightness in force wrap the layers.
func PaintChild ¶
PaintChild paints a container's child and then, when the frame armed it for that child, the keyboard focus ring (render.Canvas.MarkFocus), so later siblings cover the ring. Containers defined outside the kit call it for their children too; one that does not still gets the ring, drawn over the whole frame at its end. A child hidden by SetVisible or display: none paints nothing, whoever its container is, and nor does one its computed visibility hides, except that a Box still paints its children, which may show themselves (visibility: visible inside a hidden box).
func PaintFocusRing ¶
PaintFocusRing draws the keyboard focus ring of a focused w around its FocusRingOwner: FocusRingWidth wide outside the border box, following its corner radii, in the theme's ring color at focusRingAlpha.
func PreloadThemeIcon ¶ added in v0.2.1
PreloadThemeIcon decodes the icon NewThemeIconFallback(name, size) will paint at the device scale num/denom, so its first paint reads and rasterizes nothing. It reads the disk, so it belongs off the UI loop, and it is safe from any goroutine. name may also be an absolute path.
func PseudoContent ¶
PseudoContent returns w's resolved pseudo-element content — the strings, attr() values, and counter readings a `content:` value joined — empty when the pseudo-element declares none.
func PseudoStyle ¶
PseudoStyle returns w's computed ::before/::after/::first-letter style — the cascade the pseudo-element's rules produced, inheriting from the widget's own. nil when no rule addresses any of w's pseudo-elements or the name is not one of them. The values are fresh only after a restyle; paint paths read them through PaintBoxLayers.
func RefreshIcons ¶
func RefreshIcons()
RefreshIcons forgets every resolved theme icon, a found file and a miss alike, so icons installed or removed under the search paths since are picked up; live themed icons re-resolve on the repaint the application requests. Safe from any goroutine.
func RevealRect ¶
RevealRect scrolls every Scroll above w just far enough that r, in root coordinates, shows in its viewport: a rect below the viewport lands at its bottom edge, one above at its top, one taller than the viewport with its top showing. w's scroll-margin grows the target and each scroll's scroll-padding insets its viewport, and a scroll-behavior: smooth scroll animates to the reveal. The innermost scroll moves first and the outer ones reveal where r then sits, the way GTK's viewports scroll a focused widget into view. The scrolls re-lay out within the frame.
func SetAnimationsInstant ¶
func SetAnimationsInstant(on bool) (restore func())
SetAnimationsInstant collapses every transition and animation tween to its end state (GTK's gtk-enable-animations off) and returns the restore function. Already-running tweens keep their schedules; only launches after the call are affected. Hosts that screenshot, test, or honor reduced motion set it.
func SetDeviceScale ¶ added in v0.2.5
SetDeviceScale records that root's tree presents at num device pixels per denom logical ones, and has every dynamic Icon in it decode for that scale off the loop ahead of its paint; an Icon arranged into the tree later does the same. The application calls it as a window learns its scale, before the first frame, and on every change, while the rasters on show stay until their replacements are decoded.
func SetErrorBell ¶
func SetErrorBell(fn func(w Widget))
SetErrorBell installs the bell ErrorBell rings; nil silences it.
func SetFaceResolver ¶
SetFaceResolver installs the family/weight → face lookup the font-family and font-weight declarations shape with. One resolver per process; nil restores the default no-op. It is consulted at style-invalidation time, never per paint.
func SetGPUHost ¶
func SetGPUHost(fn func(a *GPUArea) (GPUSurface, error))
SetGPUHost installs the function that gives an on-screen GPUArea its surface; package app installs it. nil disables.
func SetIconNamespace ¶
SetIconNamespace declares icon names starting with one of prefixes and a dash to be the application's own, kept in dir (relative) below the icon search paths, such as "hicolor/scalable/actions". The first themed icon an application draws otherwise lists every directory of the theme chain; these names need only dir, so an application drawing nothing else never lists the chain. A theme cannot override them. A name dir does not hold resolves as usual, so ThemeIconExists stays exact.
func SetIconSearchPaths ¶
func SetIconSearchPaths(paths []string)
SetIconSearchPaths replaces the base directories theme icons resolve from, in priority order (GTK's IconTheme.set_search_path); nil restores the XDG default. Live themed icons re-resolve on the next repaint, which the application requests.
func SetInvoker ¶
func SetInvoker(fn func(func())) (remove func())
SetInvoker installs the function asynchronous image loads use to run their completion on the event-loop goroutine; app calls it with Application.Invoke. Nil removes the bridge. The returned function removes this one and leaves a later install in place.
func SetMediaContrast ¶
func SetMediaContrast(on bool)
SetMediaContrast turns the prefers-contrast media feature on or off; the desktop's contrast preference, which no Theme field carries. The whole tree restyles on a change.
func SetMediaResolution ¶
func SetMediaResolution(dpi float64)
SetMediaResolution sets the resolution the @media resolution feature reports, in dpi. The default is 96.
func SetMediaViewport ¶
func SetMediaViewport(w, h int)
SetMediaViewport sets the size @media width/height/aspect-ratio/ orientation conditions evaluate against for trees whose window reported no viewport of its own — the window's logical size, which the app layer feeds from its resize callback. The whole tree restyles when the size changes. Call it from the event-loop goroutine, like SetTheme.
func SetMediaViewportFor ¶
SetMediaViewportFor sets the @media viewport of one window's tree: root is the widget SetStyleRoot marked (the app layer passes each window's content root), and every widget below it computes @media conditions, the vw/vh family, and container units against this size, so two windows of one application style independently off one stylesheet. A tree whose root reports no viewport falls back to SetMediaViewport's global value; 0×0 clears the tree's own size.
func SetMessageCatalog ¶
func SetMessageCatalog(c Catalog)
SetMessageCatalog installs c as the translation for every built-in string and every Tr, TrN and TrCtx call; nil restores the identity. It is process-wide like SetTheme: install it before building widgets.
func SetOffLoopHook ¶
func SetOffLoopHook(hook func(what string))
SetOffLoopHook installs the debug hook fired with the sampled entry point's name when a widget mutation runs off the loop goroutine; nil disables. The hook runs on the offending goroutine and must not touch widgets. Production code leaves it nil; tests and lysdebug builds use it to enforce the threading contract.
func SetParents ¶
SetParents records parent as the arranging container of every child, so containers defined outside the kit wire the cascade the same way the built-in ones do during Arrange.
func SetParseWarn ¶
func SetParseWarn(f func(msg string))
SetParseWarn installs f as the CSS engine's parse-warning sink; nil restores the library logger. One sink per process. Hosts that want stylesheet problems visible — a settings app showing theme errors — route the messages to their log or interface.
func SetReducedMotion ¶ added in v0.2.1
func SetReducedMotion(on bool)
SetReducedMotion applies the desktop's reduced-motion preference: what moves stops moving and surfaces fade instead, the prefers-reduced-motion media feature turns on, and every Theme's Moves answers false, whatever its Animations says. app.Application calls it from the portal's reduced-motion setting, so apps need not.
func SetRemovedHook ¶
func SetRemovedHook(fn func(Widget))
SetRemovedHook installs the hook fired when a widget is detached from its container; nil disables. One hook per process, like SetInvoker — the last install wins. It runs on the goroutine that mutated the tree (the loop goroutine, per docs/threading.md), while the widget is still linked to its container, so a router can find the focus traversal neighbor of a removed focus.
func SetRootFontSize ¶
func SetRootFontSize(px float64)
SetRootFontSize sets the root font size stylesheet units resolve against: 1rem, and the default font size (CSS's `medium`) of widgets nothing sets one for. The default is 16 logical pixels, the CSS default; GTK derives its own from the desktop font setting. The whole tree restyles.
func SetStyleAnchor ¶
func SetStyleAnchor(w, anchor Widget)
SetStyleAnchor styles w's tree as a child of anchor while w has no layout parent: inheritance, selector ancestry, :root and the scoped sheets continue up anchor's chain, as a GTK popover's CSS node is a child of the widget it pops from. A change anchor's descendants would inherit restyles the tree too. nil unanchors it; a new anchor replaces the old.
func SetStyleRoot ¶
func SetStyleRoot(w Widget)
SetStyleRoot makes w the root of its tree for styling: :root matches it, and nothing above it is inherited or contributes scoped sheets, while it keeps its layout parent - the app wraps every window's tree in plumbing (a fader, the inspector overlay) that invalidations must climb through but stylesheets must not see.
func SetStylesheetWatcher ¶ added in v0.2.5
func SetStylesheetWatcher(watch StylesheetWatcher)
SetStylesheetWatcher installs what tells the stylesheet files' hot reload that something changed, and watches the files already loaded. One hook per process, like SetRemovedHook; the app installs it once at startup. Without a hook (no running Application) a loaded file simply never hot-reloads.
func SetSurfaceHost ¶
func SetSurfaceHost(root Widget, h SurfaceHost)
SetSurfaceHost makes h serve the tree under root. A root from outside this package carries no host, like SetStyleRoot's; asking its tree for a popup or a focus move then panics.
func SetSurfaceOriginResolver ¶
SetSurfaceOriginResolver installs the host's surface placement: resolve maps a widget tree's root (RootOf) to where its surface's (0,0) sits in its toplevel surface's coordinates, false while the compositor has not placed it. Shared-element morphs cross surfaces through it, a button into the popover it opens; one process-wide resolver, nil for none (morphs then stay inside one surface).
func SetTheme ¶
func SetTheme(t *Theme)
SetTheme replaces the active theme. Passing nil restores DarkTheme. The next frame repaints every widget with the new palette. Any palette pair whose contrast falls below WCAG AA is reported at Warn on the injected library logger (degraded but running: the swap proceeds); with the default logger the warning is discarded and SetTheme never fails.
func SharedMorphPending ¶
SharedMorphPending reports whether a tree about to show on a surface of its own holds a tagged widget that will morph out of another surface's: a widget whose tag last showed, placed, on a different surface. A popover opening with one skips its own reveal, since the morph carries the opening.
func ShownRect ¶
ShownRect is the rect w is shown at: its laid-out bounds, or mid-motion the rect its layout motion paints it at. A surface's backing (a popup's plate and shadow) follows it, so the visible box springs with the content.
func StopAssetLoads ¶ added in v0.2.5
func StopAssetLoads()
StopAssetLoads drops the icon, stylesheet image and font loads that have not started. Application calls it when its loop ends; answers from here on go nowhere, so nothing stays asked for.
func StyleBackground ¶
StyleBackground returns the widget's computed background color, the diagnostic view a paint test reads.
func StylesBackground ¶
StylesBackground reports whether the stylesheet declares w's background - a color (transparent included), an image, or another box layer - so a host that paints a default plate behind w (a popover's) can yield to it, as GTK leaves a popover's look to its CSS.
func ThemeIconExists ¶
ThemeIconExists reports whether name resolves in the current icon theme chain (hicolor included) or the unthemed fallback directories, at any size - GTK's IconTheme.has_icon. Apps use it to pick between candidate names (a distro logo, then a generic one) before building a NewThemeIcon, since a missing theme icon paints nothing.
func ThemeIconPreloaded ¶ added in v0.2.1
ThemeIconPreloaded reports whether PreloadThemeIcon's work is done for this icon, which a paint also does. It never blocks, so the UI loop may ask: while the cache is busy the answer is no.
func Tr ¶
Tr translates s through the installed catalog, English without one. Every toolkit-owned label passes through it; developer surfaces (the inspector dump, traces) stay English on purpose.
func TrN ¶
TrN translates a plural pair for n: singular for 1 and plural otherwise without a catalog, the catalog's form for n with one.
func TreeCell ¶
func TreeCell[T any](tree *FlatTree[T], sizePx float64, cell func(T) Widget) func(FlatRow[T]) Widget
TreeCell builds the expander column's Cell: indent guides for every ancestor level, the expander toggle (a leaf paints a dot-sized gap instead), then the value's own cell. Activating the toggle calls tree.Toggle(i) and then refresh - the default refresh re-lists the owning List; pass your own when the tree feeds something else.
func UnmarkLoop ¶
func UnmarkLoop()
UnmarkLoop disarms the guard. Run calls it when the loop exits, so post-Run teardown may touch widgets from any goroutine again.
func WaitAssetLoads ¶ added in v0.2.5
func WaitAssetLoads()
WaitAssetLoads blocks until every icon, stylesheet image and font load asked for so far has finished and queued its answer on the loop, whose next pass then applies it. It is what a test that needs a settled frame waits on; a UI loop must never call it.
func WantsExpand ¶
WantsExpand reports whether w wants extra space on axis: its own setting when set, else whether any visible child wants it, GTK's computed expand. The result is cached until the subtree's layout changes.
Types ¶
type A11yState ¶
type A11yState struct {
Role Role
// Name is the accessible name: SetAccessibleName's when set, else
// the tooltip text, else the visible label text for labeled
// controls.
Name string
// Text is the current contents for text-bearing roles.
Text string
// Caret is the text cursor as a rune offset into Text.
Caret int
// SelStart and SelEnd bound the selected rune range; HasSelection
// reports whether one is active.
SelStart, SelEnd int
HasSelection bool
// Checked is the Switch and CheckButton state.
Checked bool
// Pressed is a ToggleButton's active state.
Pressed bool
// Min, Max, and Value carry the ranged roles (slider, progress
// bar); Step is the keyboard increment (slider only, 0 when the
// slider divides the range itself).
Min, Max, Value, Step float64
// Editable reports whether the text can be changed by the user:
// false for a read-only field, and for a disabled one — the same
// contract the widget input paths enforce.
Editable bool
// Enabled reports whether the widget accepts input at all, folding
// its ancestors in (widget.IsEnabled): a widget inside a disabled
// container reports false, exactly as input treats it.
Enabled bool
// Multiline distinguishes text areas from single-line entries.
Multiline bool
// Focusable reports whether focus can land on the widget, by Tab,
// a click, SetFocus or an assistive technology: an enabled, rendered
// KeyActionHandler.
Focusable bool
// TabStop reports whether Tab traversal lands on it: focusable, and
// not a row of a list, whose rows are one stop with the list.
TabStop bool
// Bounds is the arranged rect, so a bridge can report extents.
Bounds render.Rect
}
A11yState is a point-in-time snapshot of what assistive technology needs about one widget: role, name, current value, text contents with caret and selection, and state flags.
func Describe ¶
Describe snapshots w's accessibility state. Focus is deliberately absent: it lives on the Router, and callers compare against Router.Focused directly.
func DescribeTree ¶
DescribeTree snapshots root and every rendered descendant in paint order, the same pre-order focus traversal uses: a widget hidden from the screen is hidden from assistive technology too.
type Accordion ¶
type Accordion struct {
// contains filtered or unexported fields
}
Accordion is a vertical stack of collapsible sections: each item a trigger row - the title, and a chevron that turns over as the item opens - above content whose height animates open and closed. In AccordionSingle mode opening an item closes the open one, and SetCollapsible decides whether the open item may close leaving none open. Up and Down move focus between the triggers, Home and End to the first and last. It styles as the `accordion` element, each item an .item (:checked while open) holding a button.trigger and its .content.
func NewAccordion ¶
func NewAccordion(mode AccordionMode) *Accordion
NewAccordion returns an empty accordion in mode; a single-mode one starts not collapsible.
func (*Accordion) Append ¶
func (a *Accordion) Append(it *AccordionItem)
Append adds it as the last item. In single mode an open item closes the open one. An item belongs to one accordion; appending it to a second is a caller bug and panics.
func (*Accordion) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*Accordion) Children ¶
func (c *Accordion) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Accordion) Items ¶
func (a *Accordion) Items() []*AccordionItem
Items returns the items in order.
func (*Accordion) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*Accordion) NavigateFocus ¶
NavigateFocus implements FocusNavigator: Up and Down step between the item triggers, Home and End go to the first and last.
func (*Accordion) SetCollapsible ¶
SetCollapsible lets the open item of a single-mode accordion close, leaving none open; a multiple-mode accordion always may.
type AccordionItem ¶
type AccordionItem struct {
// OnToggled fires after every open-state change, including ones the
// accordion made to keep a single item open.
OnToggled func(open bool)
// contains filtered or unexported fields
}
AccordionItem is one section of an Accordion (NewAccordionItem).
func NewAccordionItem ¶
func NewAccordionItem(face render.Font, title string, content Widget) *AccordionItem
NewAccordionItem returns a closed item titled title over content, for Accordion.Append.
func (*AccordionItem) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*AccordionItem) Baseline ¶
Baseline implements Baseliner: the root's, laid over the whole rect.
func (*AccordionItem) Children ¶
func (c *AccordionItem) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*AccordionItem) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*AccordionItem) Open ¶
func (it *AccordionItem) Open() bool
Open reports whether the item is open (the target state, while its content may still be animating).
func (*AccordionItem) SetOpen ¶
func (it *AccordionItem) SetOpen(open bool)
SetOpen opens or closes the item under its accordion's mode: opening one in single mode closes the open one, and closing the open one of a single-mode accordion that is not collapsible does nothing. An item not yet appended just opens or closes.
func (*AccordionItem) SetTitle ¶
func (it *AccordionItem) SetTitle(s string)
SetTitle replaces the trigger's title.
func (*AccordionItem) Title ¶
func (it *AccordionItem) Title() string
Title returns the trigger's title.
type AccordionMode ¶
type AccordionMode uint8
AccordionMode is how many of an accordion's items may be open.
const ( // AccordionSingle keeps at most one item open: opening one closes // the others. AccordionSingle AccordionMode = iota // AccordionMultiple lets any number be open. AccordionMultiple )
The accordion modes.
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
Action is a named, stateless action, relm4's RelmAction without state: menu items, buttons and accelerators activate it, and disabling it disables them all. Like every widget, it belongs to the loop goroutine.
func (*Action) Activate ¶
func (a *Action) Activate()
Activate runs the action unless it is disabled.
func (*Action) Enabled ¶
func (c *Action) Enabled() bool
Enabled reports whether the action may be activated.
func (*Action) SetEnabled ¶
func (c *Action) SetEnabled(on bool)
SetEnabled enables or disables the action and every proxy bound to it.
type ActionBar ¶
type ActionBar struct {
// contains filtered or unexported fields
}
ActionBar is the bottom bar: one pack, centered content optional - the gtk ActionBar shape. PackStart/PackEnd as on HeaderBar.
func (*ActionBar) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*ActionBar) Children ¶
func (c *ActionBar) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*ActionBar) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*ActionBar) PackEnd ¶
func (p *ActionBar) PackEnd(w Widget)
PackEnd adds w to the trailing slot.
type ActionRow ¶
type ActionRow struct {
// OnActivate fires for an activatable row's whole-row click or
// Enter press - the list-activation contract.
OnActivate func()
// contains filtered or unexported fields
}
ActionRow is the preferences vocabulary's row (#93): a title with an optional subtitle (both ellipsized in the middle when tight), start and end pack slots, activatable whole-row clicks, and a selectable state - the libadwaita AdwActionRow shape over the same Box plumbing every form was hand-built from. Styled as the `row` element inside a PreferencesGroup's `rows` list; alone it paints its surface too, so a bare row still reads.
func NewActionRow ¶
NewActionRow returns a row with a title and an optional subtitle (empty hides the line).
func (*ActionRow) Activatable ¶
Activatable reports the whole-row activation mode.
func (*ActionRow) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*ActionRow) Children ¶
func (c *ActionRow) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*ActionRow) ClickAt ¶
ClickAt activates an activatable row wherever it was clicked; a non-activatable row ignores the click (its packed controls handle their own).
func (*ActionRow) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*ActionRow) PackEnd ¶
func (p *ActionRow) PackEnd(w Widget)
PackEnd adds w to the trailing slot.
func (*ActionRow) PackStart ¶
func (p *ActionRow) PackStart(w Widget)
PackStart adds w to the leading slot.
func (*ActionRow) Paint ¶
Paint draws the row surface (selected and press washes) then the composed row.
func (*ActionRow) SetActivatable ¶
SetActivatable makes the whole row click- and Enter-activatable, with the pointer cursor and a disclosure chevron (ShowChevron controls the chevron alone).
func (*ActionRow) SetDirection ¶
SetDirection mirrors the row's packs (Box's RTL mirroring).
func (*ActionRow) SetDisclosure ¶
SetDisclosure wires sub-content revealed under the row - the ExpanderRow mechanism, a capability of the row itself: w sits in a slide-down revealer under the line, initially collapsed.
func (*ActionRow) SetPressed ¶
SetPressed paints the row's :checked press feedback (the router's press/release cycle calls it on activatable rows).
func (*ActionRow) SetRevealed ¶
SetRevealed opens or closes the disclosure.
func (*ActionRow) SetSearchable ¶
SetSearchable includes or excludes the row from a PreferencesView search; rows are searchable by default.
func (*ActionRow) SetSelected ¶
SetSelected paints the row's :selected state - the list selection contract, driven by whatever owns the selection.
func (*ActionRow) SetSubtitle ¶
SetSubtitle sets the subtitle; empty hides it.
func (*ActionRow) SetTitle ¶
SetTitle sets the title; SetSubtitle the line under it (empty hides it).
func (*ActionRow) ShowChevron ¶
ShowChevron shows or hides the trailing disclosure arrow independently of activation.
type Activatable ¶
type Activatable interface {
Name() string
Activate()
Enabled() bool
Subscribe(fn func()) (cancel func())
}
Activatable is what menu items, buttons and accelerators bind to: an action, or a stateful action's target. Activate does nothing while Enabled is false. Subscribe hears every enabled or state change.
type Adjustable ¶
type Adjustable interface {
// AxisRange reports the position along axis (Row: horizontal).
AxisRange(axis Axis) ScrollRange
// SetAxisOffset scrolls along axis, clamped.
SetAxisOffset(axis Axis, offset int)
// WatchRange registers fn to run whenever a range changed - the
// offset, the page, or the total.
WatchRange(fn func())
}
Adjustable is a scroll position a Scrollbar shows and drives - GTK's Adjustment role, implemented by Scroll.
type Alert ¶
type Alert struct {
// contains filtered or unexported fields
}
Alert is an inline callout in the content flow: an optional icon beside a title and a wrapped description, on a bordered card. Unlike Banner it carries no action and does not slide; it is there for as long as the content shows it. It styles as the `alert` element, with the .destructive class for that variant, and assistive technology announces it as a notification.
func NewAlert ¶
NewAlert returns a default-variant alert; an empty description shows the title alone.
func (*Alert) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*Alert) Children ¶
func (c *Alert) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Alert) Description ¶
Description returns the description.
func (*Alert) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*Alert) SetDescription ¶
SetDescription replaces the description; empty hides it.
func (*Alert) SetVariant ¶
func (a *Alert) SetVariant(v AlertVariant)
SetVariant switches the alert's look.
type AlertVariant ¶
type AlertVariant uint8
AlertVariant picks an alert's look.
const ( // AlertDefault is the neutral callout. AlertDefault AlertVariant = iota // AlertDestructive paints the callout in the destructive color. AlertDestructive )
The alert variants.
type Align ¶
type Align uint8
Align says how a grid child sits inside its cell along one axis when the cell is larger than the child's natural size.
const ( // AlignFill stretches the child across the whole cell. It is the // default, so plain Attach-ed children behave like Box children. AlignFill Align = iota // AlignStart pins the child to the cell's leading edge at its // natural size. AlignStart // AlignCenter centers the child in the cell at its natural size. AlignCenter // AlignEnd pins the child to the cell's trailing edge at its // natural size. AlignEnd // AlignBaseline lines a row Box's child up on the row's shared text // baseline at its natural height (GTK's valign baseline); children // with no baseline center, and across a column it pins to the start. AlignBaseline )
type AspectFrame ¶
type AspectFrame struct {
// contains filtered or unexported fields
}
AspectFrame keeps its child at a width:height ratio (GTK AspectFrame): it takes what its parent gives and arranges the child in the largest rect of that ratio, centered. A ratio of zero obeys the child's own natural ratio.
func NewAspectFrame ¶
func NewAspectFrame(child Widget, ratio float64) *AspectFrame
NewAspectFrame returns a frame holding child at ratio (W/H).
func (*AspectFrame) Arrange ¶
func (a *AspectFrame) Arrange(r render.Rect)
Arrange fits the largest rect of the ratio inside r, centered.
func (*AspectFrame) Children ¶
func (c *AspectFrame) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*AspectFrame) Measure ¶
func (a *AspectFrame) Measure(axis Axis, forSize int) Sizes
Measure is the child's request with its natural size grown along one axis to the ratio.
func (*AspectFrame) Ratio ¶
func (a *AspectFrame) Ratio() float64
Ratio reports the ratio (zero: the child's).
func (*AspectFrame) SetRatio ¶
func (a *AspectFrame) SetRatio(r float64)
SetRatio changes the ratio.
type Avatar ¶
type Avatar struct {
// contains filtered or unexported fields
}
Avatar is the round portrait: an image cropped to a circle, or the fallback of the name's initials on the muted fill, a person's outline for a name without any. It styles as the `avatar` element: background-color is the fallback's fill and color its initials.
func (*Avatar) AccessibleName ¶
func (n *Avatar) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Avatar) AddClass ¶
func (n *Avatar) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Avatar) AttachStylesheet ¶
func (n *Avatar) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Avatar) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Avatar) Classes ¶
func (n *Avatar) Classes() []string
Classes returns a copy of the widget's classes.
func (*Avatar) DebugName ¶
func (n *Avatar) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Avatar) DetachStylesheet ¶
func (n *Avatar) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Avatar) Element ¶
func (n *Avatar) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Avatar) Enabled ¶
func (n *Avatar) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Avatar) HasState ¶
func (n *Avatar) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Avatar) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Avatar) HoverWithin ¶
func (n *Avatar) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Avatar) Initials ¶
Initials are the name's first letters, at most two: the first and the last word's, uppercased.
func (*Avatar) InlineStyle ¶
func (n *Avatar) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Avatar) Invalidate ¶
func (n *Avatar) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Avatar) InvalidateLayout ¶
func (n *Avatar) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Avatar) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Avatar) LayoutMotion ¶
func (n *Avatar) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Avatar) MaximumSize ¶
func (n *Avatar) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Avatar) Parent ¶
func (n *Avatar) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Avatar) RemoveAttr ¶
func (n *Avatar) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Avatar) RemoveClass ¶
func (n *Avatar) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Avatar) SetAccessibleName ¶
func (n *Avatar) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Avatar) SetAttr ¶
func (n *Avatar) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Avatar) SetClasses ¶
func (n *Avatar) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Avatar) SetCursorName ¶
func (n *Avatar) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Avatar) SetDebugName ¶
func (n *Avatar) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Avatar) SetElement ¶
func (n *Avatar) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Avatar) SetEnabled ¶
func (n *Avatar) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Avatar) SetFocusOnClick ¶
func (n *Avatar) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Avatar) SetHAlign ¶
func (n *Avatar) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Avatar) SetHExpand ¶
func (n *Avatar) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Avatar) SetID ¶
func (n *Avatar) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Avatar) SetImage ¶
SetImage shows img instead of the initials; nil returns to them. The image is handed over read-only, as to NewImage.
func (*Avatar) SetInlineStyle ¶
func (n *Avatar) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Avatar) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Avatar) SetLayoutMotion ¶
func (n *Avatar) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Avatar) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Avatar) SetMaximumSize ¶
func (n *Avatar) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Avatar) SetOnClickWithin ¶
func (n *Avatar) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Avatar) SetOnFocusChanged ¶
func (n *Avatar) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Avatar) SetOnHoverWithin ¶
func (n *Avatar) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Avatar) SetOnPointer ¶
func (n *Avatar) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Avatar) SetOnScroll ¶
func (n *Avatar) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Avatar) SetSharedElement ¶
func (n *Avatar) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Avatar) SetSizeRequest ¶
func (n *Avatar) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Avatar) SetState ¶
func (n *Avatar) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Avatar) SetTooltip ¶
func (n *Avatar) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Avatar) SetTooltipMarkup ¶
func (n *Avatar) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Avatar) SetVAlign ¶
func (n *Avatar) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Avatar) SetVExpand ¶
func (n *Avatar) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Avatar) SetVisible ¶
func (n *Avatar) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Avatar) SharedElement ¶
func (n *Avatar) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Avatar) SizeRequest ¶
func (n *Avatar) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Avatar) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Avatar) TooltipText ¶
func (n *Avatar) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type BackdropRegioner ¶ added in v0.2.1
BackdropRegioner is a root that says itself what the compositor blurs behind it. A surface wider than its plate (a panel moving inside a full-output layer) needs one: asking for a backdrop-filter just to mark the plate would run a filter over its own transparent pixels every repaint, when the blur is the compositor's.
type Badge ¶
type Badge struct {
// contains filtered or unexported fields
}
Badge is a small inline pill label - a status, a count, a tag - with an optional leading icon. It styles as the `badge` element with the variant's class.
func (*Badge) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*Badge) Children ¶
func (c *Badge) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Badge) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*Badge) SetVariant ¶
func (b *Badge) SetVariant(v BadgeVariant)
SetVariant switches the badge's look.
type BadgeVariant ¶
type BadgeVariant uint8
BadgeVariant picks a badge's look.
const ( // BadgeDefault is the primary fill. BadgeDefault BadgeVariant = iota // BadgeSecondary is the quiet fill. BadgeSecondary // BadgeDestructive is the destructive fill. BadgeDestructive // BadgeOutline is a hairline on the background. BadgeOutline )
The badge variants.
type Banner ¶
type Banner struct {
// OnButton fires when the action button is clicked.
OnButton func()
// contains filtered or unexported fields
}
Banner is the strip that slides down to announce a state (adw Banner): a title, an optional action button, revealed and hidden through SetRevealed on a slide.
func (*Banner) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*Banner) Children ¶
func (c *Banner) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Banner) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*Banner) SetRevealed ¶
SetRevealed slides the banner in or out.
type Bar ¶
type Bar struct {
// contains filtered or unexported fields
}
Bar is an edge panel: start, center and end zones along its edge, the center kept centered as a CenterBox keeps it. Along a left or right edge it lays out as a column (the vertical class), its BarButtons drop their labels for their icons, its BarSeparators turn across it and its SegmentIndicators stack. It styles as the bar element with its edge's class (top, bottom, left, right).
func (*Bar) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*Bar) Children ¶
func (c *Bar) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Bar) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
type BarButton ¶
type BarButton struct {
Button
// contains filtered or unexported fields
}
BarButton is a bar's compact button: an icon, an optional label and an optional trailing badge, sized from the theme. In a vertical bar it shows its icon alone. With a popover set, a click opens it away from the bar's edge and the button stays :checked while it is open. Middle and right clicks and the wheel bind through SetOnPointer and SetOnScroll.
func NewBarButton ¶
NewBarButton returns a bar button of icon (nil for none) and label (empty for none) in face. Its parts sit border-spacing apart, a theme rule a stylesheet sets either way.
func (*BarButton) AccessibleName ¶
func (n *BarButton) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*BarButton) AddClass ¶
func (n *BarButton) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*BarButton) AttachStylesheet ¶
func (n *BarButton) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*BarButton) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*BarButton) Classes ¶
func (n *BarButton) Classes() []string
Classes returns a copy of the widget's classes.
func (*BarButton) DebugName ¶
func (n *BarButton) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*BarButton) DetachStylesheet ¶
func (n *BarButton) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*BarButton) Element ¶
func (n *BarButton) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*BarButton) Enabled ¶
func (n *BarButton) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*BarButton) HAlign ¶
func (n *BarButton) HAlign() Align
HAlign returns the horizontal placement.
func (*BarButton) HasState ¶
func (n *BarButton) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*BarButton) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*BarButton) HoverWithin ¶
func (n *BarButton) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*BarButton) ID ¶
func (n *BarButton) ID() string
ID returns the style id, empty when none is set.
func (*BarButton) InlineStyle ¶
func (n *BarButton) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*BarButton) Invalidate ¶
func (n *BarButton) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*BarButton) InvalidateLayout ¶
func (n *BarButton) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*BarButton) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*BarButton) LayoutMotion ¶
func (n *BarButton) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*BarButton) MaximumSize ¶
func (n *BarButton) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*BarButton) Parent ¶
func (n *BarButton) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*BarButton) RemoveAttr ¶
func (n *BarButton) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*BarButton) RemoveClass ¶
func (n *BarButton) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*BarButton) SetAccessibleName ¶
func (n *BarButton) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*BarButton) SetAttr ¶
func (n *BarButton) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*BarButton) SetClasses ¶
func (n *BarButton) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*BarButton) SetCursorName ¶
func (n *BarButton) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*BarButton) SetDebugName ¶
func (n *BarButton) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*BarButton) SetElement ¶
func (n *BarButton) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*BarButton) SetEnabled ¶
func (n *BarButton) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*BarButton) SetFocusOnClick ¶
func (n *BarButton) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*BarButton) SetHAlign ¶
func (n *BarButton) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*BarButton) SetHExpand ¶
func (n *BarButton) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*BarButton) SetID ¶
func (n *BarButton) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*BarButton) SetIconPosition ¶
func (b *BarButton) SetIconPosition(p IconPosition)
SetIconPosition puts the icon before the label (IconStart, the default) or after it.
func (*BarButton) SetInlineStyle ¶
func (n *BarButton) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*BarButton) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*BarButton) SetLayoutMotion ¶
func (n *BarButton) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*BarButton) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*BarButton) SetMaximumSize ¶
func (n *BarButton) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*BarButton) SetOnClickWithin ¶
func (n *BarButton) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*BarButton) SetOnFocusChanged ¶
func (n *BarButton) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*BarButton) SetOnHoverWithin ¶
func (n *BarButton) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*BarButton) SetOnPointer ¶
func (n *BarButton) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*BarButton) SetOnScroll ¶
func (n *BarButton) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*BarButton) SetPopover ¶
SetPopover makes a click open build's widget in a popover away from the bar's edge, and a click while it is open close it; nil leaves the button to its OnClick.
func (*BarButton) SetSharedElement ¶
func (n *BarButton) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*BarButton) SetSizeRequest ¶
func (n *BarButton) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*BarButton) SetState ¶
func (n *BarButton) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*BarButton) SetTooltip ¶
func (n *BarButton) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*BarButton) SetTooltipMarkup ¶
func (n *BarButton) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*BarButton) SetVAlign ¶
func (n *BarButton) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*BarButton) SetVExpand ¶
func (n *BarButton) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*BarButton) SetVisible ¶
func (n *BarButton) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*BarButton) SharedElement ¶
func (n *BarButton) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*BarButton) SizeRequest ¶
func (n *BarButton) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*BarButton) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*BarButton) TooltipText ¶
func (n *BarButton) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type BarEdge ¶
type BarEdge uint8
BarEdge is the screen edge a Bar runs along.
func (BarEdge) PopoverSide ¶
func (e BarEdge) PopoverSide() PopoverSide
PopoverSide is the side a popover opens on from a bar on this edge: away from the edge, into the screen.
type BarSeparator ¶
type BarSeparator struct {
Separator
}
BarSeparator is a short rule across a bar between its items, inset from both of the bar's edges by the theme's padding. The stylesheet styles it: its color is the rule's, min-width the thickness of a rule across a horizontal bar and min-height its length (filling the bar when unset), swapped across a vertical bar.
func NewBarSeparator ¶
func NewBarSeparator() *BarSeparator
NewBarSeparator returns a bar separator.
func (*BarSeparator) AccessibleName ¶
func (n *BarSeparator) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*BarSeparator) AddClass ¶
func (n *BarSeparator) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*BarSeparator) Arrange ¶
Arrange records the widget's rect. A rect that moved or resized from the previous frame also invalidates the old pixels, so partial damage does not leave the widget's old paint behind.
func (*BarSeparator) AttachStylesheet ¶
func (n *BarSeparator) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*BarSeparator) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*BarSeparator) Classes ¶
func (n *BarSeparator) Classes() []string
Classes returns a copy of the widget's classes.
func (*BarSeparator) DebugName ¶
func (n *BarSeparator) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*BarSeparator) DetachStylesheet ¶
func (n *BarSeparator) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*BarSeparator) Element ¶
func (n *BarSeparator) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*BarSeparator) Enabled ¶
func (n *BarSeparator) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*BarSeparator) HAlign ¶
func (n *BarSeparator) HAlign() Align
HAlign returns the horizontal placement.
func (*BarSeparator) HasState ¶
func (n *BarSeparator) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*BarSeparator) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*BarSeparator) HoverWithin ¶
func (n *BarSeparator) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*BarSeparator) ID ¶
func (n *BarSeparator) ID() string
ID returns the style id, empty when none is set.
func (*BarSeparator) InlineStyle ¶
func (n *BarSeparator) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*BarSeparator) Invalidate ¶
func (n *BarSeparator) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*BarSeparator) InvalidateLayout ¶
func (n *BarSeparator) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*BarSeparator) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*BarSeparator) LayoutMotion ¶
func (n *BarSeparator) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*BarSeparator) MaximumSize ¶
func (n *BarSeparator) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*BarSeparator) Measure ¶
func (s *BarSeparator) Measure(axis Axis, forSize int) Sizes
Measure turns the rule across the bar, then wants its thickness by its length.
func (*BarSeparator) Paint ¶
func (s *BarSeparator) Paint(cv *render.Canvas)
Paint draws the rule in its color, centered across its slot and, at a set length, along it.
func (*BarSeparator) Parent ¶
func (n *BarSeparator) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*BarSeparator) RemoveAttr ¶
func (n *BarSeparator) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*BarSeparator) RemoveClass ¶
func (n *BarSeparator) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*BarSeparator) SetAccessibleName ¶
func (n *BarSeparator) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*BarSeparator) SetAttr ¶
func (n *BarSeparator) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*BarSeparator) SetClasses ¶
func (n *BarSeparator) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*BarSeparator) SetCursorName ¶
func (n *BarSeparator) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*BarSeparator) SetDebugName ¶
func (n *BarSeparator) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*BarSeparator) SetElement ¶
func (n *BarSeparator) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*BarSeparator) SetEnabled ¶
func (n *BarSeparator) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*BarSeparator) SetFocusOnClick ¶
func (n *BarSeparator) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*BarSeparator) SetHAlign ¶
func (n *BarSeparator) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*BarSeparator) SetHExpand ¶
func (n *BarSeparator) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*BarSeparator) SetID ¶
func (n *BarSeparator) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*BarSeparator) SetInlineStyle ¶
func (n *BarSeparator) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*BarSeparator) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*BarSeparator) SetLayoutMotion ¶
func (n *BarSeparator) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*BarSeparator) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*BarSeparator) SetMaximumSize ¶
func (n *BarSeparator) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*BarSeparator) SetOnClickWithin ¶
func (n *BarSeparator) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*BarSeparator) SetOnFocusChanged ¶
func (n *BarSeparator) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*BarSeparator) SetOnHoverWithin ¶
func (n *BarSeparator) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*BarSeparator) SetOnPointer ¶
func (n *BarSeparator) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*BarSeparator) SetOnScroll ¶
func (n *BarSeparator) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*BarSeparator) SetSharedElement ¶
func (n *BarSeparator) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*BarSeparator) SetSizeRequest ¶
func (n *BarSeparator) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*BarSeparator) SetState ¶
func (n *BarSeparator) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*BarSeparator) SetTooltip ¶
func (n *BarSeparator) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*BarSeparator) SetTooltipMarkup ¶
func (n *BarSeparator) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*BarSeparator) SetVAlign ¶
func (n *BarSeparator) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*BarSeparator) SetVExpand ¶
func (n *BarSeparator) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*BarSeparator) SetVisible ¶
func (n *BarSeparator) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*BarSeparator) SharedElement ¶
func (n *BarSeparator) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*BarSeparator) SizeRequest ¶
func (n *BarSeparator) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*BarSeparator) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*BarSeparator) TooltipText ¶
func (n *BarSeparator) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base is the embeddable shared state for widgets defined outside the kit: it carries the arranged bounds, parent link, invalidation flags, and measure cache the frame loop leans on, exactly what internal widgets get from node. Embed it, implement the Widget interface, and route leaf hit tests through HitLeaf.
func NewBase ¶
func NewBase() Base
NewBase returns a zero Base for embedding:
type ruler struct {
widget.Base
...
}
func (*Base) AccessibleName ¶
func (n *Base) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Base) AddClass ¶
func (n *Base) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Base) Arrange ¶
Arrange records the widget's rect. A rect that moved or resized from the previous frame also invalidates the old pixels, so partial damage does not leave the widget's old paint behind.
func (*Base) ArrangeSelf ¶
ArrangeSelf records the widget's own rect. A container defined outside the kit shadows the promoted node.Arrange with its child recursion; call this first so the shadowed bookkeeping still runs.
func (*Base) AttachStylesheet ¶
func (n *Base) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Base) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Base) Classes ¶
func (n *Base) Classes() []string
Classes returns a copy of the widget's classes.
func (*Base) DebugName ¶
func (n *Base) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Base) DetachStylesheet ¶
func (n *Base) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Base) Element ¶
func (n *Base) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Base) Enabled ¶
func (n *Base) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Base) HasState ¶
func (n *Base) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Base) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Base) HoverWithin ¶
func (n *Base) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Base) InlineStyle ¶
func (n *Base) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Base) Invalidate ¶
func (n *Base) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Base) InvalidateLayout ¶
func (n *Base) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Base) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Base) LayoutMotion ¶
func (n *Base) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Base) MaximumSize ¶
func (n *Base) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Base) Parent ¶
func (n *Base) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Base) RemoveAttr ¶
func (n *Base) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Base) RemoveClass ¶
func (n *Base) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Base) SetAccessibleName ¶
func (n *Base) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Base) SetAttr ¶
func (n *Base) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Base) SetClasses ¶
func (n *Base) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Base) SetCursorName ¶
func (n *Base) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Base) SetDebugName ¶
func (n *Base) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Base) SetElement ¶
func (n *Base) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Base) SetEnabled ¶
func (n *Base) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Base) SetFocusOnClick ¶
func (n *Base) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Base) SetHAlign ¶
func (n *Base) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Base) SetHExpand ¶
func (n *Base) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Base) SetID ¶
func (n *Base) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Base) SetInlineStyle ¶
func (n *Base) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Base) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Base) SetLayoutMotion ¶
func (n *Base) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Base) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Base) SetMaximumSize ¶
func (n *Base) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Base) SetOnClickWithin ¶
func (n *Base) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Base) SetOnFocusChanged ¶
func (n *Base) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Base) SetOnHoverWithin ¶
func (n *Base) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Base) SetOnPointer ¶
func (n *Base) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Base) SetOnScroll ¶
func (n *Base) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Base) SetSharedElement ¶
func (n *Base) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Base) SetSizeRequest ¶
func (n *Base) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Base) SetState ¶
func (n *Base) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Base) SetTooltip ¶
func (n *Base) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Base) SetTooltipMarkup ¶
func (n *Base) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Base) SetVAlign ¶
func (n *Base) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Base) SetVExpand ¶
func (n *Base) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Base) SetVisible ¶
func (n *Base) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Base) SharedElement ¶
func (n *Base) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Base) SizeRequest ¶
func (n *Base) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Base) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Base) TooltipText ¶
func (n *Base) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type Baseliner ¶
Baseliner reports a widget's first text baseline (GTK's baseline): the distance from the top of the rect its parent arranges it in, at its natural height, down to the baseline its first line of text sits on. ok is false for a widget without text. A row Box lines up the children it holds with AlignBaseline on it, so labels, entries, and buttons of different sizes read as one line.
type Binding ¶
type Binding[T any] struct { // contains filtered or unexported fields }
Binding is a loop-owned observable model value, lys-ui's counterpart of relm4's binding module: one T that any number of widgets observe. Set applies the value and notifies the subscribers synchronously, which is what a widget connector needs - the new value is on screen by the time Set returns. Two rules keep two-way wiring echo-free by construction: an equal value is a no-op (nothing notifies), and a Set from inside a notification is deferred until that notification finishes, so a subscriber writing back cannot recurse.
Like every widget mutation, Get/Set/Subscribe belong on the loop goroutine (docs/threading.md); they are sampled by the off-loop hook.
func NewBinding ¶
NewBinding creates a Binding holding initial.
type Boundser ¶
Boundser exposes a widget's arranged rect; the app draws the focus ring around whatever widget.Boundser the router focuses.
type Box ¶
type Box struct {
// contains filtered or unexported fields
}
Box is a container that lays its children along one axis with fixed spacing and padding. The cross axis stretches children to the inner height (Row) or width (Column) of the box, unless a child was added with AppendAligned.
Every child gets its minimum; the room up to the naturals goes to the children furthest below theirs last, and what is left past every natural is shared equally among the expanding children (GTK's box allocation). Short of the minimums the children overflow the box and the painter's clip decides what is visible.
A row's start/end semantics mirror with the box's direction: an RTL row flows from the right edge, so the first child sits rightmost, where an RTL reader starts. Columns are unaffected.
A stylesheet display declaration lays the children out by CSS instead — normal flow or flexbox (docs/css.md's Layout) — with the settings above standing in wherever the stylesheet is silent.
func NewBox ¶
NewBox returns an empty box along axis with the given spacing between children and padding on every side.
func NewBulletList ¶
NewBulletList is a typography list: each item a wrapped label behind a bullet, indented.
func NewFieldGroup ¶
func NewFieldGroup() *Box
NewFieldGroup returns the column fields stack in, styled as the `fieldgroup` element.
func NewKbdGroup ¶
NewKbdGroup draws a key combination as keycaps side by side: NewKbdGroup(face, "Ctrl", "Shift", "P").
func NewShortcutLabel ¶
NewShortcutLabel draws keys as keycaps (adw ShortcutLabel): each key of an accelerator its own .keycap label, the steps of a chord set apart.
func NewSkeleton ¶
NewSkeleton is a width x height placeholder block that pulses while content loads: the `skeleton` element, a muted rounded fill whose pulse stops under reduced motion.
func NewTooltipCard ¶
NewTooltipCard is a tooltip's card: the text, parsed as markup when markup is set, in the small size on the primary fill. It styles as the `tooltip` element.
func (*Box) AccessibleName ¶
func (n *Box) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Box) AddClass ¶
func (n *Box) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Box) Append ¶
Append adds a widget to the box and reports whether it should expand into leftover main-axis space. It returns the box for chaining. The box's measure cache drops so the next frame sees the new child.
func (*Box) AppendAligned ¶
AppendAligned adds a child placed across the box by cross, GTK's valign in a row and halign in a column: AlignFill stretches it (Append), the others keep its natural cross size pinned to the start, center or end.
func (*Box) Arrange ¶
Arrange positions the children inside the content box — by the CSS layout its display declares, or the programmatic box layout — and orders them for paint and hit testing by their stacking keys. r is the margin box; Bounds records the border box.
func (*Box) ArrangeRoot ¶
ArrangeRoot records the box's own rect.
func (*Box) AttachStylesheet ¶
func (n *Box) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Box) Baseline ¶
Baseline implements Baseliner. A row's is its baseline group's, centered across the row as Arrange places it, else its first child with a baseline where its alignment puts it; a column's is its first child's. The children sit at their shares of the box's arranged width, or of its natural width before it is arranged.
func (*Box) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Box) Classes ¶
func (n *Box) Classes() []string
Classes returns a copy of the widget's classes.
func (*Box) Clear ¶
func (b *Box) Clear()
Clear detaches every child at once — the wholesale rebuild path. Each child's parent link clears and the removal hook fires per child; clearing an empty box does nothing.
func (*Box) DebugName ¶
func (n *Box) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Box) DetachStylesheet ¶
func (n *Box) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Box) Element ¶
func (n *Box) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Box) Enabled ¶
func (n *Box) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Box) HasState ¶
func (n *Box) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Box) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Box) HitTest ¶
HitTest returns the deepest child under p, topmost in stacking order first and only inside the overflow clip, or the box itself when p is inside its bounds but over no child (padding, spacing, leftover space) — never a display:contents box, which has no area of its own.
func (*Box) Homogeneous ¶
Homogeneous reports whether the children share the largest child's main-axis size.
func (*Box) HoverWithin ¶
func (n *Box) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Box) InlineStyle ¶
func (n *Box) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Box) InsertAligned ¶
InsertAligned is InsertAt with AppendAligned's cross placement.
func (*Box) InsertAt ¶
InsertAt puts w at index i with Append's expand meaning, so dynamic UIs can reorder without a rebuild. Out-of-range indexes clamp to the ends; the measure cache drops like every other mutation.
func (*Box) Invalidate ¶
func (n *Box) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Box) InvalidateLayout ¶
func (n *Box) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Box) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Box) LayoutMotion ¶
func (n *Box) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Box) MaximumSize ¶
func (n *Box) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Box) Measure ¶
Measure reports the box's request inside its CSS box (padding, border, margin, min sizes): along its axis the children's requests end to end with the spacing between, every child the largest one's when homogeneous; across, the largest child's at the share of the main extent each would get, which Arrange hands out the same way. The result is cached until an InvalidateLayout anywhere in the subtree, so a static tree costs no recursion on later frames.
func (*Box) Move ¶
Move moves the child at index from to index to (both clamped), in place: the child stays attached, so its focus and state survive.
func (*Box) Paint ¶
Paint draws the box's CSS layers when the stylesheet gives it any (a bare box paints nothing — theme-only boxes are transparent), then the children in stacking order, then the outline; opacity and filter wrap it all. A transform declaration paints the whole subtree into an offscreen layer and composites it back through the affine, so the transform applies to the children as one.
func (*Box) Parent ¶
func (n *Box) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Box) Remove ¶
Remove detaches w, found by identity, and reports whether it was a child. The removed widget's parent link clears, so it can be appended elsewhere without a double parent; removing a widget that is not (or no longer) a child reports false and changes nothing. The measure cache drops so the next frame reflows without it.
func (*Box) RemoveAttr ¶
func (n *Box) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Box) RemoveClass ¶
func (n *Box) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Box) SetAccessibleName ¶
func (n *Box) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Box) SetAttr ¶
func (n *Box) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Box) SetAxis ¶
SetAxis lays the children along a instead (GTK's orientable): a field turning horizontal when it gets wide.
func (*Box) SetClasses ¶
func (n *Box) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Box) SetCursorName ¶
func (n *Box) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Box) SetDebugName ¶
func (n *Box) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Box) SetDirection ¶
SetDirection selects the base direction the box's main axis flows along: an RTL row lays its children out right to left, mirroring start/end placement. Columns ignore it. Changing the direction re-arranges.
func (*Box) SetElement ¶
func (n *Box) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Box) SetEnabled ¶
SetEnabled turns the box's subtree on or off: the per-query enable walk (IsEnabled) folds the box's flag into every descendant, whose own flag stays untouched — re-enabling the box never resurrects a child the app disabled on purpose. The walk marks the whole subtree for repaint, since each descendant's effective state changed.
func (*Box) SetFocusOnClick ¶
func (n *Box) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Box) SetHAlign ¶
func (n *Box) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Box) SetHExpand ¶
func (n *Box) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Box) SetHomogeneous ¶
SetHomogeneous equalizes the children's main-axis sizes to the largest child's (gtk_box_set_homogeneous). Changing it relayouts.
func (*Box) SetID ¶
func (n *Box) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Box) SetInlineStyle ¶
func (n *Box) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Box) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Box) SetLayoutMotion ¶
func (n *Box) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Box) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Box) SetMaximumSize ¶
func (n *Box) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Box) SetOnClickWithin ¶
func (n *Box) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Box) SetOnFocusChanged ¶
func (n *Box) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Box) SetOnHoverWithin ¶
func (n *Box) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Box) SetOnPointer ¶
func (n *Box) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Box) SetOnScroll ¶
func (n *Box) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Box) SetPadding ¶
SetPadding sets the box's programmatic padding per side; the stylesheet's padding still wins where it sets a side. The box relayouts.
func (*Box) SetSharedElement ¶
func (n *Box) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Box) SetSizeRequest ¶
func (n *Box) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Box) SetSpacing ¶
SetSpacing sets the programmatic gap between children.
func (*Box) SetState ¶
func (n *Box) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Box) SetTooltip ¶
func (n *Box) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Box) SetTooltipMarkup ¶
func (n *Box) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Box) SetVAlign ¶
func (n *Box) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Box) SetVExpand ¶
func (n *Box) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Box) SetVisible ¶
func (n *Box) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Box) SharedElement ¶
func (n *Box) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Box) SizeRequest ¶
func (n *Box) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Box) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Box) TooltipText ¶
func (n *Box) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type Breadcrumb ¶
type Breadcrumb struct {
// user activated.
OnNavigate func(i int)
// contains filtered or unexported fields
}
Breadcrumb is the path to the current page: a link per ancestor, chevrons between, and the current page last, not a link. A path longer than SetMaxItems collapses its middle into an ellipsis that opens the hidden ancestors as a menu. It styles as the `breadcrumb` element: each link a button.crumb, the current page a .page label, the separators .separator and the ellipsis button.ellipsis.
func NewBreadcrumb ¶
func NewBreadcrumb(face render.Font, path ...string) *Breadcrumb
NewBreadcrumb returns a breadcrumb over path, the root first and the current page last.
func (*Breadcrumb) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*Breadcrumb) Children ¶
func (c *Breadcrumb) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Breadcrumb) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*Breadcrumb) SetMaxItems ¶
func (b *Breadcrumb) SetMaxItems(n int)
SetMaxItems collapses a path of more than n items: the first, an ellipsis for the middle, and the last n-2. Below 3, or 0, the whole path shows.
func (*Breadcrumb) SetPath ¶
func (b *Breadcrumb) SetPath(path ...string)
SetPath replaces the path.
type Breakpoint ¶
type Breakpoint struct {
Max int
Min int
// Apply runs when the breakpoint starts holding; Unapply, when it
// stops. Batches of setters are just closures.
Apply func()
Unapply func()
}
Breakpoint applies while the allocated width is at or below Max (or at or above Min, when Max is zero) - the adw 1.4 condition model narrowed to the width axis the adaptive shell needs.
type BreakpointBin ¶
type BreakpointBin struct {
// contains filtered or unexported fields
}
BreakpointBin wraps one widget and runs its breakpoints' apply batches as the allocated width crosses them - the seam an adaptive shell swaps layouts through. Conditions evaluate at the top of Arrange, before the child is laid out, so a batch's changes land in the same pass; a batch that changes what the child wants calls InvalidateLayout and the engine re-measures on demand.
func NewBreakpointBin ¶
func NewBreakpointBin(child Widget) *BreakpointBin
NewBreakpointBin returns a bin over child with no breakpoints.
func (*BreakpointBin) Add ¶
func (b *BreakpointBin) Add(bp Breakpoint)
Add appends a breakpoint; apply order is add order.
func (*BreakpointBin) Arrange ¶
func (b *BreakpointBin) Arrange(r render.Rect)
Arrange evaluates every breakpoint against the allocated width, then lays the child out.
func (*BreakpointBin) Baseline ¶
Baseline implements Baseliner: the root's, laid over the whole rect.
func (*BreakpointBin) Children ¶
func (c *BreakpointBin) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*BreakpointBin) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*BreakpointBin) Width ¶
func (b *BreakpointBin) Width() int
Width reports the last allocated width (the condition input).
type Button ¶
type Button struct {
// Background colors, one per visual state. A zero color means
// "unset": the stylesheet's background-color, else the theme
// surface for that state.
Bg render.Color
BgHover render.Color
BgPressed render.Color
// BgExplicit makes Bg, BgHover, and BgPressed literal: a zero color
// is transparent instead of unset, so a button can rest on
// whatever sits behind it and fill only on hover. Like any
// programmatic color it outranks the stylesheet. A transparent
// fill under a stylesheet border strokes just the rounded ring
// (render.Canvas.RoundedBorder).
BgExplicit bool
// Hovered and Pressed select the painted state; Pressed wins.
Hovered, Pressed bool
// OnClick fires from Click, the hook M4 input will call.
OnClick func()
// contains filtered or unexported fields
}
Button is a clickable region with a rounded background and one child, usually a Box of an icon and a label. Input arrives in M4; the hover and pressed states are plain fields so tests and future input code drive them directly.
func NewButton ¶
NewButton returns a button wrapping child with the given inner padding and corner radius. The pointer turns to the hand over it: every button is clickable, the way wayle's button primitives ask.
func (*Button) AccessibleName ¶
func (n *Button) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Button) AddClass ¶
func (n *Button) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Button) Arrange ¶
Arrange insets the child by the box inside r, the margin box; Bounds records the border box.
func (*Button) ArrangeRoot ¶
ArrangeRoot records the button's own rect.
func (*Button) AttachStylesheet ¶
func (n *Button) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Button) BindAction ¶
func (b *Button) BindAction(a Activatable) (unbind func())
BindAction makes the button a proxy of a: a click activates it, and the button is enabled exactly while the action is. The returned unbind detaches it.
func (*Button) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Button) Classes ¶
func (n *Button) Classes() []string
Classes returns a copy of the widget's classes.
func (*Button) ClickAt ¶
ClickAt fires the OnClick hook, ignoring the release point. It is a no-op without one, and a no-op while disabled: a dead button never fires.
func (*Button) DebugName ¶
func (n *Button) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Button) DetachStylesheet ¶
func (n *Button) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Button) Element ¶
func (n *Button) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Button) Enabled ¶
func (n *Button) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Button) HasState ¶
func (n *Button) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Button) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Button) HoverWithin ¶
func (n *Button) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Button) InlineStyle ¶
func (n *Button) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Button) InsertRune ¶
InsertRune implements RuneHandler: Space activates the button, the other half of the GTK activation pair. Text never reaches a focused button, so a blank rune can only mean "activate".
func (*Button) Invalidate ¶
func (n *Button) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Button) InvalidateLayout ¶
func (n *Button) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Button) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Button) KeyAction ¶
KeyAction implements KeyActionHandler: Enter activates the button when focused, which is what makes it reachable by Tab at all - the traversal only collects KeyActionHandler implementations.
func (*Button) LayoutMotion ¶
func (n *Button) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Button) MaximumSize ¶
func (n *Button) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Button) Measure ¶
Measure pads the child's natural size inside the CSS box: the constructor padding (or the stylesheet's, per side), border, margin, and min sizes.
func (*Button) Paint ¶
Paint draws the state's background, then the child. A zero Bg family falls back to the theme. Disabled, the fill is the derived disabled surface and the child paints through the shared disabled fade, so whatever a button wraps (label, icon) mutes without the child knowing about the state.
The stylesheet layers between the programmatic colors and the theme per state slot; its shadows, background image, border ring (rounded, per side), and outline paint around the fill, and opacity and filter wrap the whole button.
func (*Button) Parent ¶
func (n *Button) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Button) RemoveAttr ¶
func (n *Button) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Button) RemoveClass ¶
func (n *Button) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Button) SetAccessibleName ¶
func (n *Button) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Button) SetAttr ¶
func (n *Button) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Button) SetClasses ¶
func (n *Button) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Button) SetCursorName ¶
func (n *Button) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Button) SetDebugName ¶
func (n *Button) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Button) SetElement ¶
func (n *Button) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Button) SetEnabled ¶
func (n *Button) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Button) SetFocusOnClick ¶
func (n *Button) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Button) SetHAlign ¶
func (n *Button) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Button) SetHExpand ¶
func (n *Button) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Button) SetHovered ¶
SetHovered implements HoverSetter; the hover shade repaints.
func (*Button) SetID ¶
func (n *Button) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Button) SetInlineStyle ¶
func (n *Button) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Button) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Button) SetLayoutMotion ¶
func (n *Button) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Button) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Button) SetMaximumSize ¶
func (n *Button) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Button) SetOnClickWithin ¶
func (n *Button) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Button) SetOnFocusChanged ¶
func (n *Button) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Button) SetOnHoverWithin ¶
func (n *Button) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Button) SetOnPointer ¶
func (n *Button) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Button) SetOnScroll ¶
func (n *Button) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Button) SetPressed ¶
SetPressed implements PressSetter; the pressed shade repaints.
func (*Button) SetSharedElement ¶
func (n *Button) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Button) SetSizeRequest ¶
func (n *Button) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Button) SetState ¶
func (n *Button) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Button) SetTooltip ¶
func (n *Button) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Button) SetTooltipMarkup ¶
func (n *Button) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Button) SetVAlign ¶
func (n *Button) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Button) SetVExpand ¶
func (n *Button) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Button) SetVisible ¶
func (n *Button) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Button) SharedElement ¶
func (n *Button) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Button) SizeRequest ¶
func (n *Button) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Button) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Button) TooltipText ¶
func (n *Button) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type ButtonContent ¶
type ButtonContent struct {
// contains filtered or unexported fields
}
ButtonContent is the icon-and-label pair buttons wear (adw ButtonContent): either half may be empty.
func NewButtonContent ¶
func NewButtonContent(face render.Font, sizePx float64, iconName, label string) *ButtonContent
NewButtonContent returns the pair; an empty icon name or label drops that half.
func (*ButtonContent) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*ButtonContent) Baseline ¶
Baseline implements Baseliner: the root's, laid over the whole rect.
func (*ButtonContent) Children ¶
func (c *ButtonContent) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*ButtonContent) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*ButtonContent) SetIconName ¶
func (c *ButtonContent) SetIconName(name string)
SetIconName replaces the icon; empty drops it.
func (*ButtonContent) SetLabel ¶
func (c *ButtonContent) SetLabel(s string)
SetLabel replaces the label text.
type ButtonGroup ¶
type ButtonGroup struct {
// contains filtered or unexported fields
}
ButtonGroup joins buttons into one control: side by side or stacked, only the outer corners rounded and the inner borders shared, with SetSeparator lines between and groups nesting in groups. It styles as the `buttongroup` element, .vertical when stacked.
func NewButtonGroup ¶
func NewButtonGroup(buttons ...Widget) *ButtonGroup
NewButtonGroup joins buttons side by side.
func (*ButtonGroup) Append ¶
func (g *ButtonGroup) Append(w Widget)
Append adds w (a button, a separator, a nested group) at the end. Nested groups sit apart.
func (*ButtonGroup) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*ButtonGroup) Children ¶
func (c *ButtonGroup) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*ButtonGroup) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*ButtonGroup) SetVertical ¶
func (g *ButtonGroup) SetVertical(on bool)
SetVertical stacks the buttons.
type ButtonRow ¶
type ButtonRow struct {
*ActionRow
}
ButtonRow is a full-width activatable row wearing a button look: the title centered, activation whole-row, for the destructive and affirmative actions a preferences page ends with.
func NewButtonRow ¶
NewButtonRow returns the activatable centered row; onClick is its activation.
func (ButtonRow) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (ButtonRow) Children ¶
func (c ButtonRow) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (ButtonRow) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
type Calendar ¶
type Calendar struct {
// Detail, when set, describes a date - an event title, a holiday -
// shown as the tooltip of the day under the pointer ("" for none).
Detail func(date Date) string
// OnSelect fires with the picked day in single mode, on every
// applied selection - click, keyboard, or Select.
OnSelect func(Date)
// OnRangeSelect fires in range mode on every pick: the start and,
// once picked, the end (zero until then).
OnRangeSelect func(from, to Date)
// contains filtered or unexported fields
}
Calendar is a month grid: the month title between previous and next buttons, the weekday header, and the days with the adjacent months' leading and trailing days muted. Today takes the muted wash, a picked day the primary fill, and a range's days between its ends a band. SetMonths shows several months side by side, the date range picker's two. Colors come from the typed theme.
Pointer: a click picks its day; the buttons step the shown months. Keyboard: in single mode the arrows move the selection a day (a week vertically) and PageUp/PageDown a month (Shift: a year), the view following; in range mode they move a cursor and Enter or Space picks it.
func NewCalendar ¶
NewCalendar returns a single-mode calendar showing initial's month with initial selected; a zero initial shows today's month with no selection. Today is read from the clock now (SetToday overrides).
func (*Calendar) AccessibleName ¶
func (n *Calendar) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Calendar) AddClass ¶
func (n *Calendar) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Calendar) Arrange ¶
Arrange records the rect, widens the day columns to share a wider one, and places the previous button at the first month's left and the next at the last month's right.
func (*Calendar) AttachStylesheet ¶
func (n *Calendar) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Calendar) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Calendar) Children ¶
Children exposes the navigation buttons for focus traversal and the damage walk; the day cells are painted geometry, not widgets.
func (*Calendar) Classes ¶
func (n *Calendar) Classes() []string
Classes returns a copy of the widget's classes.
func (*Calendar) DebugName ¶
func (n *Calendar) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Calendar) DetachStylesheet ¶
func (n *Calendar) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Calendar) Element ¶
func (n *Calendar) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Calendar) Enabled ¶
func (n *Calendar) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Calendar) HAlign ¶
func (n *Calendar) HAlign() Align
HAlign returns the horizontal placement.
func (*Calendar) HasState ¶
func (n *Calendar) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Calendar) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Calendar) HitTest ¶
HitTest returns a navigation button under p, else the calendar (the day cells are its own geometry).
func (*Calendar) HoverWithin ¶
func (n *Calendar) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Calendar) ID ¶
func (n *Calendar) ID() string
ID returns the style id, empty when none is set.
func (*Calendar) InlineStyle ¶
func (n *Calendar) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Calendar) Invalidate ¶
func (n *Calendar) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Calendar) InvalidateLayout ¶
func (n *Calendar) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Calendar) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Calendar) KeyAction ¶
KeyAction implements KeyActionHandler: the arrows move a day (a week vertically) and PageUp/PageDown a month (with Shift, a year) - the selection itself in single mode, the cursor in range mode, where Enter and Space pick it. The view follows. Disabled calendars ignore keys.
func (*Calendar) LayoutMotion ¶
func (n *Calendar) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Calendar) MarkDay ¶
MarkDay marks d (GTK mark_day): a dot under its number. Marks are per date, so they stay with their month as the view moves.
func (*Calendar) MaximumSize ¶
func (n *Calendar) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Calendar) Measure ¶
Measure wants each month's title, header and six week rows of natural cells, side by side.
func (*Calendar) Paint ¶
Paint draws each month's title, weekday header and days, then the navigation buttons.
func (*Calendar) Parent ¶
func (n *Calendar) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Calendar) RemoveAttr ¶
func (n *Calendar) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Calendar) RemoveClass ¶
func (n *Calendar) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Calendar) Select ¶
Select applies d as single mode's selection, shows its month if it is not shown, and fires OnSelect. A zero d clears the selection, keeping the shown month and the keyboard's day.
func (*Calendar) SetAccessibleName ¶
func (n *Calendar) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Calendar) SetAttr ¶
func (n *Calendar) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Calendar) SetClasses ¶
func (n *Calendar) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Calendar) SetCursorName ¶
func (n *Calendar) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Calendar) SetDebugName ¶
func (n *Calendar) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Calendar) SetElement ¶
func (n *Calendar) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Calendar) SetEnabled ¶
func (n *Calendar) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Calendar) SetFirstWeekday ¶
SetFirstWeekday makes day the week's first column, overriding the name set's (lys-shell's calendar takes it from its config).
func (*Calendar) SetFocusOnClick ¶
func (n *Calendar) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Calendar) SetHAlign ¶
func (n *Calendar) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Calendar) SetHExpand ¶
func (n *Calendar) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Calendar) SetHovered ¶
SetHovered forgets the day when the pointer leaves.
func (*Calendar) SetID ¶
func (n *Calendar) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Calendar) SetInlineStyle ¶
func (n *Calendar) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Calendar) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Calendar) SetLayoutMotion ¶
func (n *Calendar) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Calendar) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Calendar) SetMaximumSize ¶
func (n *Calendar) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Calendar) SetMode ¶
func (c *Calendar) SetMode(m CalendarMode)
SetMode switches between picking a day and a range; the picks of the other mode clear.
func (*Calendar) SetMonths ¶
SetMonths shows n months side by side from the shown one, at least one.
func (*Calendar) SetNames ¶
func (c *Calendar) SetNames(names CalendarNames)
SetNames swaps the locale's names; nil restores CalendarCatalog.
func (*Calendar) SetOnClickWithin ¶
func (n *Calendar) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Calendar) SetOnFocusChanged ¶
func (n *Calendar) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Calendar) SetOnHoverWithin ¶
func (n *Calendar) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Calendar) SetOnPointer ¶
func (n *Calendar) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Calendar) SetOnScroll ¶
func (n *Calendar) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Calendar) SetRange ¶
SetRange applies a range, the earlier day starting it, and shows its start's month; it fires nothing.
func (*Calendar) SetSharedElement ¶
func (n *Calendar) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Calendar) SetSizeRequest ¶
func (n *Calendar) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Calendar) SetState ¶
func (n *Calendar) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Calendar) SetTooltip ¶
func (n *Calendar) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Calendar) SetTooltipMarkup ¶
func (n *Calendar) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Calendar) SetVAlign ¶
func (n *Calendar) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Calendar) SetVExpand ¶
func (n *Calendar) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Calendar) SetVisible ¶
func (n *Calendar) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Calendar) SetWeekend ¶
SetWeekend names the weekend days, Saturday and Sunday by default: their cells take the `calendar .weekend` rule's color and background, which the theme leaves unset.
func (*Calendar) SharedElement ¶
func (n *Calendar) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Calendar) SizeRequest ¶
func (n *Calendar) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Calendar) TooltipAnchor ¶
TooltipAnchor implements TooltipAnchorer: the hovered day's cell while its Detail names the tooltip, else the whole calendar.
func (*Calendar) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Calendar) TooltipText ¶
TooltipText is the hovered day's Detail, else the calendar's own tooltip.
type CalendarCatalog ¶
type CalendarCatalog struct{}
CalendarCatalog is the default name set, read through the installed message catalog (SetCatalog) the GTK way, English without one: the month and weekday names translate as themselves, the week's first day is the translation of "calendar:week_start:0" (a translator writes calendar:week_start:1 for Monday), and dates follow the translation of the layout "%B %-d, %Y" (see formatDate).
func (CalendarCatalog) FirstWeekday ¶
func (CalendarCatalog) FirstWeekday() time.Weekday
FirstWeekday implements CalendarNames.
func (CalendarCatalog) FormatDate ¶
func (n CalendarCatalog) FormatDate(d Date) string
FormatDate implements CalendarNames.
func (CalendarCatalog) MonthName ¶
func (CalendarCatalog) MonthName(m time.Month) string
MonthName implements CalendarNames.
func (CalendarCatalog) WeekdayName ¶
func (CalendarCatalog) WeekdayName(w time.Weekday) string
WeekdayName implements CalendarNames.
type CalendarENUS ¶
type CalendarENUS struct{}
CalendarENUS is the en-US name set: full English month names, two-letter weekday abbreviations, weeks starting Sunday, dates as "October 24, 2026".
func (CalendarENUS) FirstWeekday ¶
func (CalendarENUS) FirstWeekday() time.Weekday
FirstWeekday implements CalendarNames.
func (CalendarENUS) FormatDate ¶
func (n CalendarENUS) FormatDate(d Date) string
FormatDate implements CalendarNames.
func (CalendarENUS) MonthName ¶
func (CalendarENUS) MonthName(m time.Month) string
MonthName implements CalendarNames.
func (CalendarENUS) WeekdayName ¶
func (CalendarENUS) WeekdayName(w time.Weekday) string
WeekdayName implements CalendarNames.
type CalendarMode ¶
type CalendarMode uint8
CalendarMode is what a Calendar's clicks pick.
const ( // CalendarSingle picks one day. CalendarSingle CalendarMode = iota // CalendarRange picks a span: the first pick starts it, the second // ends it (the earlier of the two starting), a third starts anew. CalendarRange )
The calendar modes.
type CalendarNames ¶
type CalendarNames interface {
// MonthName is the full month name for the title.
MonthName(time.Month) string
// WeekdayName is the short weekday label for the header.
WeekdayName(time.Weekday) string
// FirstWeekday is the week's first column (Sunday for en-US).
FirstWeekday() time.Weekday
// FormatDate writes a day the way the locale does: "October 24,
// 2026" in en-US.
FormatDate(Date) string
}
CalendarNames supplies a Calendar's localized pieces. A nil interface (the default) reads them through the message catalog (CalendarCatalog); supply your own to localize otherwise.
type Card ¶
type Card struct {
// contains filtered or unexported fields
}
Card is the card anatomy as one widget: a header with the title, an optional muted description and an optional trailing action, then the content, then a footer of actions, right-aligned unless SetFooterAlign says otherwise. The sections space themselves and pad the card from the theme (three Spacing between them, three Padding around), so a caller sets no margins; the text sizes follow the theme's TextSize, the title at TitleSize. It is the card element, styled as the .card class is, and its parts the .card-header, .card-title, .card-description, .card-action, .card-content and .card-footer classes a stylesheet restyles.
func (*Card) AppendFooter ¶
AppendFooter adds w to the footer, after the ones already there; the footer shows once it holds anything.
func (*Card) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*Card) Children ¶
func (c *Card) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Card) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*Card) SetAction ¶
SetAction puts w at the header's trailing edge, level with the title; nil removes it.
func (*Card) SetContent ¶
SetContent puts w between the header and the footer; nil removes it.
func (*Card) SetDescription ¶
SetDescription sets the muted line under the title; empty hides it.
func (*Card) SetFooterAlign ¶
SetFooterAlign places the footer's actions: AlignEnd (the default), AlignStart, AlignCenter, or AlignFill to spread the row across.
type Carousel ¶
type Carousel struct {
// OnPage fires when the settled page changes.
OnPage func(i int)
// contains filtered or unexported fields
}
Carousel is a horizontal swipeable page strip: pages side by side at the carousel's width, pointer drags and touchpad swipes pan, releases snap to the nearest page on the animation clock, the round previous and next buttons step a page (disabled at the ends, Left and Right on them step too), and the painted dots index the position. It styles as the `carousel` element: the button.nav pair.
func NewCarousel ¶
NewCarousel returns an empty carousel.
func (*Carousel) AccessibleName ¶
func (n *Carousel) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Carousel) AddClass ¶
func (n *Carousel) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Carousel) Arrange ¶
Arrange lays the pages side by side at the carousel's width (each aligned in its slot), offset by the fractional page position, and the previous and next buttons inside the sides, centered.
func (*Carousel) AttachStylesheet ¶
func (n *Carousel) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Carousel) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Carousel) Classes ¶
func (n *Carousel) Classes() []string
Classes returns a copy of the widget's classes.
func (*Carousel) DebugName ¶
func (n *Carousel) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Carousel) DetachStylesheet ¶
func (n *Carousel) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Carousel) Element ¶
func (n *Carousel) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Carousel) Enabled ¶
func (n *Carousel) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Carousel) Gesture ¶
Gesture implements GestureHandler: a touchpad swipe pans the pages like a drag, snapping when the fingers lift (touchscreen drags reach the carousel through the touch pointer emulation).
func (*Carousel) HAlign ¶
func (n *Carousel) HAlign() Align
HAlign returns the horizontal placement.
func (*Carousel) HasState ¶
func (n *Carousel) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Carousel) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Carousel) HoverWithin ¶
func (n *Carousel) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Carousel) ID ¶
func (n *Carousel) ID() string
ID returns the style id, empty when none is set.
func (*Carousel) InlineStyle ¶
func (n *Carousel) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Carousel) InterceptKey ¶
InterceptKey implements KeyInterceptor: Left and Right on the previous or next button step a page.
func (*Carousel) Invalidate ¶
func (n *Carousel) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Carousel) InvalidateLayout ¶
func (n *Carousel) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Carousel) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Carousel) LayoutMotion ¶
func (n *Carousel) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Carousel) MaximumSize ¶
func (n *Carousel) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Carousel) Measure ¶
Measure wants the widest page's request: each page lays out at the carousel's full width, the tallest at that width wins.
func (*Carousel) Paint ¶
Paint draws the visible pages clipped, then the indicator dots and the buttons.
func (*Carousel) Parent ¶
func (n *Carousel) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Carousel) PressEnd ¶
func (c *Carousel) PressEnd()
PressEnd snaps to the nearest page when a drag ends - released, cancelled, or lost alike.
func (*Carousel) RemoveAttr ¶
func (n *Carousel) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Carousel) RemoveClass ¶
func (n *Carousel) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Carousel) SetAccessibleName ¶
func (n *Carousel) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Carousel) SetAttr ¶
func (n *Carousel) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Carousel) SetClasses ¶
func (n *Carousel) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Carousel) SetCursorName ¶
func (n *Carousel) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Carousel) SetDebugName ¶
func (n *Carousel) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Carousel) SetElement ¶
func (n *Carousel) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Carousel) SetEnabled ¶
func (n *Carousel) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Carousel) SetFocusOnClick ¶
func (n *Carousel) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Carousel) SetHAlign ¶
func (n *Carousel) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Carousel) SetHExpand ¶
func (n *Carousel) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Carousel) SetID ¶
func (n *Carousel) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Carousel) SetInlineStyle ¶
func (n *Carousel) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Carousel) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Carousel) SetLayoutMotion ¶
func (n *Carousel) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Carousel) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Carousel) SetMaximumSize ¶
func (n *Carousel) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Carousel) SetOnClickWithin ¶
func (n *Carousel) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Carousel) SetOnFocusChanged ¶
func (n *Carousel) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Carousel) SetOnHoverWithin ¶
func (n *Carousel) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Carousel) SetOnPointer ¶
func (n *Carousel) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Carousel) SetOnScroll ¶
func (n *Carousel) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Carousel) SetSharedElement ¶
func (n *Carousel) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Carousel) SetSizeRequest ¶
func (n *Carousel) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Carousel) SetState ¶
func (n *Carousel) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Carousel) SetTooltip ¶
func (n *Carousel) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Carousel) SetTooltipMarkup ¶
func (n *Carousel) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Carousel) SetVAlign ¶
func (n *Carousel) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Carousel) SetVExpand ¶
func (n *Carousel) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Carousel) SetVisible ¶
func (n *Carousel) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Carousel) SharedElement ¶
func (n *Carousel) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Carousel) SizeRequest ¶
func (n *Carousel) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Carousel) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Carousel) TooltipText ¶
func (n *Carousel) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type Catalog ¶
type Catalog interface {
Get(id string) string
GetN(singular, plural string, n int) string
GetCtx(ctx, id string) string
}
Catalog translates user-facing strings, the gettext model: the key is the English string itself, plural pairs choose a form for n, and a context disambiguates equal English strings. *i18n.Catalog implements it from .po and .mo files; an untranslated key comes back unchanged.
type CenterBox ¶
type CenterBox struct {
// contains filtered or unexported fields
}
CenterBox lays three children like gtk::CenterBox along its orientation (Row by default): the center one at the middle of the allocation, the start and end children at the ends. The center child stays centered however long the sides run, until one would overlap it: then it moves just clear of that side (GtkCenterLayout).
func NewCenterBox ¶
NewCenterBox returns a three-slot row; any slot may be nil.
func (*CenterBox) AccessibleName ¶
func (n *CenterBox) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*CenterBox) AddClass ¶
func (n *CenterBox) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*CenterBox) Arrange ¶
Arrange places the start slot at the start, the end slot at the end, and the center slot at the middle unless a side would overlap it; every slot spans the box's thickness.
func (*CenterBox) ArrangeRoot ¶
ArrangeRoot records the box's own rect.
func (*CenterBox) AttachStylesheet ¶
func (n *CenterBox) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*CenterBox) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*CenterBox) Classes ¶
func (n *CenterBox) Classes() []string
Classes returns a copy of the widget's classes.
func (*CenterBox) DebugName ¶
func (n *CenterBox) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*CenterBox) DetachStylesheet ¶
func (n *CenterBox) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*CenterBox) Element ¶
func (n *CenterBox) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*CenterBox) Enabled ¶
func (n *CenterBox) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*CenterBox) HAlign ¶
func (n *CenterBox) HAlign() Align
HAlign returns the horizontal placement.
func (*CenterBox) HasState ¶
func (n *CenterBox) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*CenterBox) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*CenterBox) HoverWithin ¶
func (n *CenterBox) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*CenterBox) ID ¶
func (n *CenterBox) ID() string
ID returns the style id, empty when none is set.
func (*CenterBox) InlineStyle ¶
func (n *CenterBox) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*CenterBox) Invalidate ¶
func (n *CenterBox) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*CenterBox) InvalidateLayout ¶
func (n *CenterBox) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*CenterBox) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*CenterBox) LayoutMotion ¶
func (n *CenterBox) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*CenterBox) MaximumSize ¶
func (n *CenterBox) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*CenterBox) Measure ¶
Measure sizes to the three naturals end to end along the axis, as thick as the thickest.
func (*CenterBox) Orientation ¶
Orientation is the axis the slots run along.
func (*CenterBox) Parent ¶
func (n *CenterBox) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*CenterBox) RemoveAttr ¶
func (n *CenterBox) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*CenterBox) RemoveClass ¶
func (n *CenterBox) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*CenterBox) SetAccessibleName ¶
func (n *CenterBox) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*CenterBox) SetAttr ¶
func (n *CenterBox) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*CenterBox) SetClasses ¶
func (n *CenterBox) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*CenterBox) SetCursorName ¶
func (n *CenterBox) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*CenterBox) SetDebugName ¶
func (n *CenterBox) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*CenterBox) SetElement ¶
func (n *CenterBox) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*CenterBox) SetEnabled ¶
func (n *CenterBox) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*CenterBox) SetFocusOnClick ¶
func (n *CenterBox) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*CenterBox) SetHAlign ¶
func (n *CenterBox) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*CenterBox) SetHExpand ¶
func (n *CenterBox) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*CenterBox) SetID ¶
func (n *CenterBox) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*CenterBox) SetInlineStyle ¶
func (n *CenterBox) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*CenterBox) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*CenterBox) SetLayoutMotion ¶
func (n *CenterBox) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*CenterBox) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*CenterBox) SetMaximumSize ¶
func (n *CenterBox) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*CenterBox) SetOnClickWithin ¶
func (n *CenterBox) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*CenterBox) SetOnFocusChanged ¶
func (n *CenterBox) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*CenterBox) SetOnHoverWithin ¶
func (n *CenterBox) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*CenterBox) SetOnPointer ¶
func (n *CenterBox) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*CenterBox) SetOnScroll ¶
func (n *CenterBox) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*CenterBox) SetOrientation ¶
SetOrientation lays the slots along a (gtk_orientable_set_orientation): a Column runs top to bottom.
func (*CenterBox) SetSharedElement ¶
func (n *CenterBox) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*CenterBox) SetSizeRequest ¶
func (n *CenterBox) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*CenterBox) SetState ¶
func (n *CenterBox) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*CenterBox) SetTooltip ¶
func (n *CenterBox) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*CenterBox) SetTooltipMarkup ¶
func (n *CenterBox) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*CenterBox) SetVAlign ¶
func (n *CenterBox) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*CenterBox) SetVExpand ¶
func (n *CenterBox) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*CenterBox) SetVisible ¶
func (n *CenterBox) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*CenterBox) SharedElement ¶
func (n *CenterBox) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*CenterBox) SizeRequest ¶
func (n *CenterBox) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*CenterBox) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*CenterBox) TooltipText ¶
func (n *CenterBox) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type Chart ¶
type Chart struct {
// contains filtered or unexported fields
}
Chart plots categories of data: bars grouped or stacked, areas, lines, a pie or donut, a radar, or radial bars, in the theme's chart colors (@chart_1 to @chart_5). The cartesian kinds draw a value axis on rounded ticks, horizontal grid lines and the category labels; every kind but the radial one has a legend of the series (pie: of the categories). Hovering a category or a wedge shows a tooltip card with its values. Changing the data (SetData) eases the shown values to the new ones. Assistive technology reads a summary of the data. It styles as the `chart` element.
func (*Chart) AccessibleName ¶
func (n *Chart) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Chart) AddClass ¶
func (n *Chart) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Chart) Arrange ¶
Arrange records the widget's rect. A rect that moved or resized from the previous frame also invalidates the old pixels, so partial damage does not leave the widget's old paint behind.
func (*Chart) AttachStylesheet ¶
func (n *Chart) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Chart) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Chart) Classes ¶
func (n *Chart) Classes() []string
Classes returns a copy of the widget's classes.
func (*Chart) DebugName ¶
func (n *Chart) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Chart) DetachStylesheet ¶
func (n *Chart) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Chart) Element ¶
func (n *Chart) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Chart) Enabled ¶
func (n *Chart) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Chart) HasState ¶
func (n *Chart) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Chart) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Chart) HoverWithin ¶
func (n *Chart) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Chart) InlineStyle ¶
func (n *Chart) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Chart) Invalidate ¶
func (n *Chart) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Chart) InvalidateLayout ¶
func (n *Chart) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Chart) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Chart) LayoutMotion ¶
func (n *Chart) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Chart) MaximumSize ¶
func (n *Chart) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Chart) Parent ¶
func (n *Chart) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Chart) RemoveAttr ¶
func (n *Chart) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Chart) RemoveClass ¶
func (n *Chart) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Chart) SetAccessibleName ¶
func (n *Chart) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Chart) SetAttr ¶
func (n *Chart) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Chart) SetClasses ¶
func (n *Chart) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Chart) SetCursorName ¶
func (n *Chart) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Chart) SetData ¶
func (c *Chart) SetData(labels []string, series ...ChartSeries)
SetData replaces the categories and the series, easing the shown values to the new ones.
func (*Chart) SetDebugName ¶
func (n *Chart) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Chart) SetElement ¶
func (n *Chart) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Chart) SetEnabled ¶
func (n *Chart) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Chart) SetFocusOnClick ¶
func (n *Chart) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Chart) SetHAlign ¶
func (n *Chart) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Chart) SetHExpand ¶
func (n *Chart) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Chart) SetHovered ¶
SetHovered clears the tooltip when the pointer leaves.
func (*Chart) SetID ¶
func (n *Chart) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Chart) SetInlineStyle ¶
func (n *Chart) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Chart) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Chart) SetLayoutMotion ¶
func (n *Chart) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Chart) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Chart) SetMaximumSize ¶
func (n *Chart) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Chart) SetOnClickWithin ¶
func (n *Chart) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Chart) SetOnFocusChanged ¶
func (n *Chart) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Chart) SetOnHoverWithin ¶
func (n *Chart) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Chart) SetOnPointer ¶
func (n *Chart) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Chart) SetOnScroll ¶
func (n *Chart) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Chart) SetSharedElement ¶
func (n *Chart) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Chart) SetSizeRequest ¶
func (n *Chart) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Chart) SetStacked ¶
SetStacked stacks a bar or area chart's series.
func (*Chart) SetState ¶
func (n *Chart) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Chart) SetTooltip ¶
func (n *Chart) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Chart) SetTooltipMarkup ¶
func (n *Chart) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Chart) SetVAlign ¶
func (n *Chart) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Chart) SetVExpand ¶
func (n *Chart) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Chart) SetVisible ¶
func (n *Chart) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Chart) SharedElement ¶
func (n *Chart) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Chart) SizeRequest ¶
func (n *Chart) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Chart) Summary ¶
Summary is the chart's data in words: its kind, then each series' values by category.
func (*Chart) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Chart) TooltipText ¶
func (n *Chart) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type ChartKind ¶
type ChartKind uint8
ChartKind is how a Chart draws its data.
const ( // ChartBar draws a bar per series per category, grouped, or // stacked with SetStacked. ChartBar ChartKind = iota // ChartArea fills each series' line down to the baseline, stacked // with SetStacked. ChartArea // ChartLine strokes each series' line. ChartLine // ChartPie draws the first series as wedges per category; a donut // with SetDonut. ChartPie // ChartRadar draws each series as a polygon over the categories' // spokes. ChartRadar // ChartRadial draws the first series as concentric bars per // category, each around a track. ChartRadial )
The chart kinds.
type ChartSeries ¶
ChartSeries is one series of a Chart: a name and a value per category; Color 0 takes the theme's next chart color.
type CheckButton ¶
type CheckButton struct {
// OnChanged fires after every state change, including programmatic
// ones.
OnChanged func(checked bool)
// contains filtered or unexported fields
}
CheckButton is a boolean checkbox with a painted check mark, and an optional child (its label) beside the mark that clicks toggle too.
func NewCheckButton ¶
func NewCheckButton(checked bool) *CheckButton
NewCheckButton returns a checkbox in the given state. The pointer turns to the hand over it, the way wayle's checkbox primitive asks.
func (*CheckButton) AccessibleName ¶
func (n *CheckButton) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*CheckButton) AddClass ¶
func (n *CheckButton) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*CheckButton) Arrange ¶
func (c *CheckButton) Arrange(r render.Rect)
Arrange records the box. Without a child the check fills the content box; with one it keeps its size at the start, centered across, and the child takes the rest.
func (*CheckButton) AttachStylesheet ¶
func (n *CheckButton) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*CheckButton) BindAction ¶
func (c *CheckButton) BindAction(target Checkable) (unbind func())
BindAction makes the check button a proxy of c, like ToggleButton.BindAction.
func (*CheckButton) BindChecked ¶
func (c *CheckButton) BindChecked(b *Binding[bool]) (unbind func())
BindChecked wires the binding two-way to the checkbox's state.
func (*CheckButton) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*CheckButton) Child ¶
func (c *CheckButton) Child() Widget
Child is the widget SetChild placed, nil for none.
func (*CheckButton) Classes ¶
func (n *CheckButton) Classes() []string
Classes returns a copy of the widget's classes.
func (*CheckButton) ClickAt ¶
func (c *CheckButton) ClickAt(Point)
ClickAt toggles the checkbox; the Router invokes it on press+release. Disabled checkboxes ignore clicks.
func (*CheckButton) DebugName ¶
func (n *CheckButton) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*CheckButton) DetachStylesheet ¶
func (n *CheckButton) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*CheckButton) Element ¶
func (n *CheckButton) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*CheckButton) Enabled ¶
func (n *CheckButton) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*CheckButton) HAlign ¶
func (n *CheckButton) HAlign() Align
HAlign returns the horizontal placement.
func (*CheckButton) HasState ¶
func (n *CheckButton) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*CheckButton) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*CheckButton) HitTest ¶
func (c *CheckButton) HitTest(p Point) Widget
HitTest returns the checkbox when p is inside its bounds.
func (*CheckButton) HoverWithin ¶
func (n *CheckButton) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*CheckButton) ID ¶
func (n *CheckButton) ID() string
ID returns the style id, empty when none is set.
func (*CheckButton) Inconsistent ¶
func (c *CheckButton) Inconsistent() bool
Inconsistent reports the indeterminate state.
func (*CheckButton) InlineStyle ¶
func (n *CheckButton) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*CheckButton) InsertRune ¶
func (c *CheckButton) InsertRune(r rune)
InsertRune implements RuneHandler: Space toggles, the other half of the GTK activation pair. Disabled checkboxes ignore it.
func (*CheckButton) Invalidate ¶
func (n *CheckButton) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*CheckButton) InvalidateLayout ¶
func (n *CheckButton) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*CheckButton) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*CheckButton) KeyAction ¶
func (c *CheckButton) KeyAction(a KeyAction, _ Mods)
KeyAction implements KeyActionHandler: Enter toggles when focused, which makes the checkbox reachable and activatable by keyboard only. Disabled checkboxes ignore keys.
func (*CheckButton) LayoutMotion ¶
func (n *CheckButton) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*CheckButton) MaximumSize ¶
func (n *CheckButton) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*CheckButton) Measure ¶
func (c *CheckButton) Measure(axis Axis, forSize int) Sizes
Measure sizes the indicator and the child after it, inside the checkbox's CSS box.
func (*CheckButton) Paint ¶
func (c *CheckButton) Paint(cv *render.Canvas)
Paint draws the indicator through the check node: the box layers (background, border, radius) it resolves, the tick or minus bar in its color. Unstyled, a 2px theme-border ring around the theme surface, accent-filled with a mark while checked or inconsistent. Disabled, ring and mark fade through the derived disabled colors.
func (*CheckButton) Parent ¶
func (n *CheckButton) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*CheckButton) RemoveAttr ¶
func (n *CheckButton) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*CheckButton) RemoveClass ¶
func (n *CheckButton) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*CheckButton) SetAccessibleName ¶
func (n *CheckButton) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*CheckButton) SetAttr ¶
func (n *CheckButton) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*CheckButton) SetChecked ¶
func (c *CheckButton) SetChecked(checked bool)
SetChecked changes the state and fires OnChanged when it flipped.
func (*CheckButton) SetChild ¶
func (c *CheckButton) SetChild(w Widget)
SetChild places w after the check (gtk_check_button_set_child): a label, typically, styled as `checkbutton > label`. The checkbox stays the leaf: a click on the child toggles it. nil removes the child.
func (*CheckButton) SetClasses ¶
func (n *CheckButton) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*CheckButton) SetCursorName ¶
func (n *CheckButton) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*CheckButton) SetDebugName ¶
func (n *CheckButton) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*CheckButton) SetElement ¶
func (n *CheckButton) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*CheckButton) SetEnabled ¶
func (n *CheckButton) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*CheckButton) SetFocusOnClick ¶
func (n *CheckButton) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*CheckButton) SetGroup ¶
func (c *CheckButton) SetGroup(other *CheckButton)
SetGroup makes c a radio button in other's group: drawn as a round `radio` indicator, checking it unchecks the others, and a click on the checked one keeps it checked.
func (*CheckButton) SetHAlign ¶
func (n *CheckButton) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*CheckButton) SetHExpand ¶
func (n *CheckButton) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*CheckButton) SetID ¶
func (n *CheckButton) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*CheckButton) SetInconsistent ¶
func (c *CheckButton) SetInconsistent(on bool)
SetInconsistent marks the check indeterminate (`:indeterminate`), the neither-checked-nor-unchecked state a tri-state control shows.
func (*CheckButton) SetInlineStyle ¶
func (n *CheckButton) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*CheckButton) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*CheckButton) SetLayoutMotion ¶
func (n *CheckButton) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*CheckButton) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*CheckButton) SetMaximumSize ¶
func (n *CheckButton) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*CheckButton) SetOnClickWithin ¶
func (n *CheckButton) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*CheckButton) SetOnFocusChanged ¶
func (n *CheckButton) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*CheckButton) SetOnHoverWithin ¶
func (n *CheckButton) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*CheckButton) SetOnPointer ¶
func (n *CheckButton) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*CheckButton) SetOnScroll ¶
func (n *CheckButton) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*CheckButton) SetSharedElement ¶
func (n *CheckButton) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*CheckButton) SetSizeRequest ¶
func (n *CheckButton) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*CheckButton) SetState ¶
func (n *CheckButton) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*CheckButton) SetTooltip ¶
func (n *CheckButton) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*CheckButton) SetTooltipMarkup ¶
func (n *CheckButton) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*CheckButton) SetVAlign ¶
func (n *CheckButton) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*CheckButton) SetVExpand ¶
func (n *CheckButton) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*CheckButton) SetVisible ¶
func (n *CheckButton) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*CheckButton) SharedElement ¶
func (n *CheckButton) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*CheckButton) SizeRequest ¶
func (n *CheckButton) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*CheckButton) Toggle ¶
func (c *CheckButton) Toggle()
Toggle flips the state and fires OnChanged; a radio button only ever checks - clicking the checked one keeps it checked.
func (*CheckButton) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*CheckButton) TooltipText ¶
func (n *CheckButton) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type Checkable ¶
type Checkable interface {
Activatable
Checked() bool
}
Checkable is an Activatable with a checked state: a toggle or a radio target, rendered as a check or radio menu item.
func Toggle ¶
func Toggle(a *StateAction[bool]) Checkable
Toggle is the Checkable that flips a bool action: a check item, a toggle button.
type Chip ¶
type Chip struct {
// contains filtered or unexported fields
}
Chip is a badge-shaped control: an optional leading widget, its text (or any content in its place, an entry for a renamable chip), and, while OnDismiss is set, a dismiss button that is keyboard reachable. It styles as the chip element, the dismissible class while it has the button. In a ChipBox it drags by its body.
func (*Chip) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*Chip) Children ¶
func (c *Chip) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Chip) DragContent ¶
func (c *Chip) DragContent() *DragContent
DragContent implements DragSource: a chip in a ChipBox offers its move, marked dragging while it travels.
func (*Chip) HitTest ¶
HitTest keeps the dismiss button's and the content's controls their presses; anywhere else is the chip's own, its drag handle.
func (*Chip) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*Chip) SetContent ¶
SetContent shows w in place of the text, an entry or nested chips; nil restores the text.
func (*Chip) SetLeading ¶
SetLeading puts w before the content, an icon or a swatch; nil removes it.
func (*Chip) SetOnDismiss ¶
func (c *Chip) SetOnDismiss(fn func())
SetOnDismiss shows the dismiss button, which runs fn; nil hides it.
type ChipBox ¶
type ChipBox struct {
// OnMoved hears a chip moved from index from of box src (the box
// itself for a reorder) to index to of this box.
OnMoved func(src *ChipBox, from, to int)
// contains filtered or unexported fields
}
ChipBox wraps its chips into lines, as a FlowBox does, and reorders them by drag. It is the chipbox element, a CSS box whose padding is part of its drop area: a chip dragged within the box or from another ChipBox lands where the drop indicator shows, and OnMoved reports the move after the box made it.
func (*ChipBox) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*ChipBox) Children ¶
func (c *ChipBox) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*ChipBox) Drop ¶
Drop implements Dropper: the chip in flight moves to the indicated place. A payload that is not the chip in flight's is ignored.
func (*ChipBox) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
type Clamp ¶
type Clamp struct {
// contains filtered or unexported fields
}
Clamp centers its child at a maximum width: wider allocations pad the sides, narrower ones pass through untouched (the adw Clamp, a pure measure wrapper).
func (*Clamp) Children ¶
func (c *Clamp) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Clamp) Measure ¶
Measure is the child's request with its natural width capped, and its height at the capped width.
type Clicker ¶
type Clicker interface {
ClickAt(p Point)
}
Clicker is invoked when a press and release land on the same widget. p is the release point in root coordinates.
type Color ¶
Color aliases render.Color so themes read naturally without importing render at every call site.
func ParseColor ¶
ParseColor reads a hex color — #rgb, #rrggbb, or #rrggbbaa, the same forms the markup parser accepts — into a premultiplied Color. It reports malformed input instead of defaulting, so a config file's mistake fails loudly at theme-construction time.
type ColorButton ¶
type ColorButton struct {
Button
// Presets are the picker's swatches.
Presets []render.Color
// Custom, when set, lists colors for the picker's custom row.
Custom func() []render.Color
// OnColorSet runs when the user picked or edited a color, not on
// SetColor.
OnColorSet func(c render.Color)
// contains filtered or unexported fields
}
ColorButton shows the current color as a swatch on an outline icon button and opens a SwatchPicker under itself on click: a swatch picks and closes, the picker's Custom entry edits any color in place. Presets are the swatches offered, DefaultSwatches until set; Custom, when set, lists the user's own colors under them.
func NewColorButton ¶
NewColorButton returns a button showing c, its picker's text in face at sizePx.
func (*ColorButton) AccessibleName ¶
func (n *ColorButton) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*ColorButton) AddClass ¶
func (n *ColorButton) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*ColorButton) AttachStylesheet ¶
func (n *ColorButton) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*ColorButton) BindColor ¶
func (b *ColorButton) BindColor(binding *Binding[render.Color]) (unbind func())
BindColor wires the binding two-way to the shown color: changes show, picks write back.
func (*ColorButton) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*ColorButton) Choose ¶
func (b *ColorButton) Choose(c render.Color)
Choose applies a color the user picked: it shows it and fires OnColorSet.
func (*ColorButton) Classes ¶
func (n *ColorButton) Classes() []string
Classes returns a copy of the widget's classes.
func (*ColorButton) Color ¶
func (b *ColorButton) Color() render.Color
Color returns the shown color.
func (*ColorButton) DebugName ¶
func (n *ColorButton) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*ColorButton) DetachStylesheet ¶
func (n *ColorButton) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*ColorButton) Element ¶
func (n *ColorButton) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*ColorButton) Enabled ¶
func (n *ColorButton) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*ColorButton) HAlign ¶
func (n *ColorButton) HAlign() Align
HAlign returns the horizontal placement.
func (*ColorButton) HasState ¶
func (n *ColorButton) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*ColorButton) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*ColorButton) HoverWithin ¶
func (n *ColorButton) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*ColorButton) ID ¶
func (n *ColorButton) ID() string
ID returns the style id, empty when none is set.
func (*ColorButton) InlineStyle ¶
func (n *ColorButton) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*ColorButton) Invalidate ¶
func (n *ColorButton) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*ColorButton) InvalidateLayout ¶
func (n *ColorButton) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*ColorButton) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*ColorButton) LayoutMotion ¶
func (n *ColorButton) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*ColorButton) MaximumSize ¶
func (n *ColorButton) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*ColorButton) Parent ¶
func (n *ColorButton) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*ColorButton) RemoveAttr ¶
func (n *ColorButton) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*ColorButton) RemoveClass ¶
func (n *ColorButton) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*ColorButton) SetAccessibleName ¶
func (n *ColorButton) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*ColorButton) SetAttr ¶
func (n *ColorButton) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*ColorButton) SetClasses ¶
func (n *ColorButton) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*ColorButton) SetColor ¶
func (b *ColorButton) SetColor(c render.Color)
SetColor shows c without firing OnColorSet.
func (*ColorButton) SetCursorName ¶
func (n *ColorButton) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*ColorButton) SetDebugName ¶
func (n *ColorButton) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*ColorButton) SetElement ¶
func (n *ColorButton) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*ColorButton) SetEnabled ¶
func (n *ColorButton) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*ColorButton) SetFocusOnClick ¶
func (n *ColorButton) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*ColorButton) SetHAlign ¶
func (n *ColorButton) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*ColorButton) SetHExpand ¶
func (n *ColorButton) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*ColorButton) SetID ¶
func (n *ColorButton) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*ColorButton) SetInlineStyle ¶
func (n *ColorButton) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*ColorButton) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*ColorButton) SetLayoutMotion ¶
func (n *ColorButton) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*ColorButton) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*ColorButton) SetMaximumSize ¶
func (n *ColorButton) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*ColorButton) SetOnClickWithin ¶
func (n *ColorButton) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*ColorButton) SetOnFocusChanged ¶
func (n *ColorButton) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*ColorButton) SetOnHoverWithin ¶
func (n *ColorButton) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*ColorButton) SetOnPointer ¶
func (n *ColorButton) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*ColorButton) SetOnScroll ¶
func (n *ColorButton) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*ColorButton) SetSharedElement ¶
func (n *ColorButton) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*ColorButton) SetSizeRequest ¶
func (n *ColorButton) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*ColorButton) SetState ¶
func (n *ColorButton) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*ColorButton) SetTooltip ¶
func (n *ColorButton) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*ColorButton) SetTooltipMarkup ¶
func (n *ColorButton) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*ColorButton) SetVAlign ¶
func (n *ColorButton) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*ColorButton) SetVExpand ¶
func (n *ColorButton) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*ColorButton) SetVisible ¶
func (n *ColorButton) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*ColorButton) SharedElement ¶
func (n *ColorButton) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*ColorButton) SizeRequest ¶
func (n *ColorButton) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*ColorButton) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*ColorButton) TooltipText ¶
func (n *ColorButton) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type ColorChooser ¶
type ColorChooser struct {
// OnChanged fires after every applied color change, whatever
// produced it.
OnChanged func(render.Color)
// contains filtered or unexported fields
}
ColorChooser edits one color end to end: an SV square with a hue strip and an alpha strip beside it, a hex entry, and two palette rows (theme-derived presets and custom picks). OnChanged fires with the straight (non-premultiplied) color on every applied change; the SV square is two stacked linear gradients — white to hue, transparent to black — composited through the canvas's exact premultiplied blending, a shader-less SV square.
Pointer: drags on the square and both strips track the pointer; a click on a swatch picks it; the hex entry parses on change (#RGB, #RRGGBB, #RRGGBBAA, with or without the #). Keyboard: arrows move saturation (horizontal) and value (vertical), shift+arrows move the hue, PageUp/PageDown step alpha, and the entry types hex directly - the chooser is fully operable without the pointer.
func NewColorChooser ¶
NewColorChooser returns a chooser editing initial (its alpha comes along), preset swatches derived from the current theme.
func (*ColorChooser) AccessibleName ¶
func (n *ColorChooser) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*ColorChooser) AddClass ¶
func (n *ColorChooser) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*ColorChooser) Arrange ¶
func (c *ColorChooser) Arrange(r render.Rect)
Arrange records the rect and places the hex entry and the + button.
func (*ColorChooser) AttachStylesheet ¶
func (n *ColorChooser) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*ColorChooser) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*ColorChooser) Children ¶
func (c *ColorChooser) Children() []Widget
Children exposes the entry (and the + and pick buttons when their sources are wired) for focus traversal.
func (*ColorChooser) Classes ¶
func (n *ColorChooser) Classes() []string
Classes returns a copy of the widget's classes.
func (*ColorChooser) ClickAt ¶
func (c *ColorChooser) ClickAt(p Point)
ClickAt applies one press-release: the square and strips set their component from the point, a swatch picks its color.
func (*ColorChooser) Color ¶
func (c *ColorChooser) Color() render.Color
Color returns the current color with its alpha.
func (*ColorChooser) DebugName ¶
func (n *ColorChooser) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*ColorChooser) DetachStylesheet ¶
func (n *ColorChooser) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*ColorChooser) DragMove ¶
func (c *ColorChooser) DragMove(p Point)
DragMove tracks drags across the square and strips exactly like ClickAt. Disabled choosers do not drag.
func (*ColorChooser) Element ¶
func (n *ColorChooser) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*ColorChooser) Enabled ¶
func (n *ColorChooser) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*ColorChooser) HAlign ¶
func (n *ColorChooser) HAlign() Align
HAlign returns the horizontal placement.
func (*ColorChooser) HasState ¶
func (n *ColorChooser) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*ColorChooser) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*ColorChooser) HitTest ¶
func (c *ColorChooser) HitTest(p Point) Widget
HitTest returns the entry or the + button under p, else the chooser (the square, strips, and swatches are its own geometry).
func (*ColorChooser) HoverWithin ¶
func (n *ColorChooser) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*ColorChooser) ID ¶
func (n *ColorChooser) ID() string
ID returns the style id, empty when none is set.
func (*ColorChooser) InlineStyle ¶
func (n *ColorChooser) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*ColorChooser) Invalidate ¶
func (n *ColorChooser) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*ColorChooser) InvalidateLayout ¶
func (n *ColorChooser) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*ColorChooser) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*ColorChooser) KeyAction ¶
func (c *ColorChooser) KeyAction(a KeyAction, mods Mods)
KeyAction implements KeyActionHandler: arrows move saturation and value, shift+arrows the hue, PageUp/PageDown step alpha, Home and End pin saturation. Disabled choosers ignore keys.
func (*ColorChooser) LayoutMotion ¶
func (n *ColorChooser) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*ColorChooser) MaximumSize ¶
func (n *ColorChooser) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*ColorChooser) Measure ¶
func (c *ColorChooser) Measure(axis Axis, forSize int) Sizes
Measure wants the SV square (160) plus the strips (24 + gaps), the entry row, and the two palette rows.
func (*ColorChooser) Paint ¶
func (c *ColorChooser) Paint(cv *render.Canvas)
Paint draws the SV square as two stacked gradients, both strips, the cursors, and the palette rows - the square's arithmetic is the canvas's own premultiplied source-over.
func (*ColorChooser) Parent ¶
func (n *ColorChooser) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*ColorChooser) RemoveAttr ¶
func (n *ColorChooser) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*ColorChooser) RemoveClass ¶
func (n *ColorChooser) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*ColorChooser) SetAccessibleName ¶
func (n *ColorChooser) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*ColorChooser) SetAttr ¶
func (n *ColorChooser) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*ColorChooser) SetClasses ¶
func (n *ColorChooser) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*ColorChooser) SetColor ¶
func (c *ColorChooser) SetColor(col render.Color)
SetColor applies col (firing OnChanged once) — the programmatic path.
func (*ColorChooser) SetCursorName ¶
func (n *ColorChooser) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*ColorChooser) SetDebugName ¶
func (n *ColorChooser) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*ColorChooser) SetElement ¶
func (n *ColorChooser) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*ColorChooser) SetEnabled ¶
func (n *ColorChooser) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*ColorChooser) SetEyedropper ¶
func (c *ColorChooser) SetEyedropper(start func())
SetEyedropper wires the pick-from-screen button: start begins a screen color pick (the application's captured-screen flow, #84); without it the button stays hidden - swatches-only.
func (*ColorChooser) SetFocusOnClick ¶
func (n *ColorChooser) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*ColorChooser) SetHAlign ¶
func (n *ColorChooser) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*ColorChooser) SetHExpand ¶
func (n *ColorChooser) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*ColorChooser) SetID ¶
func (n *ColorChooser) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*ColorChooser) SetInlineStyle ¶
func (n *ColorChooser) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*ColorChooser) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*ColorChooser) SetLayoutMotion ¶
func (n *ColorChooser) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*ColorChooser) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*ColorChooser) SetMaximumSize ¶
func (n *ColorChooser) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*ColorChooser) SetOnClickWithin ¶
func (n *ColorChooser) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*ColorChooser) SetOnFocusChanged ¶
func (n *ColorChooser) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*ColorChooser) SetOnHoverWithin ¶
func (n *ColorChooser) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*ColorChooser) SetOnPointer ¶
func (n *ColorChooser) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*ColorChooser) SetOnScroll ¶
func (n *ColorChooser) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*ColorChooser) SetPaletteSource ¶
func (c *ColorChooser) SetPaletteSource(colors func() []render.Color, add func(render.Color))
SetPaletteSource wires the chooser's custom-palette view: colors lists the session's picks and add records a new one (the chooser calls it from the + button). Without a source the custom row stays empty and the button is hidden.
func (*ColorChooser) SetSharedElement ¶
func (n *ColorChooser) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*ColorChooser) SetSizeRequest ¶
func (n *ColorChooser) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*ColorChooser) SetState ¶
func (n *ColorChooser) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*ColorChooser) SetTooltip ¶
func (n *ColorChooser) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*ColorChooser) SetTooltipMarkup ¶
func (n *ColorChooser) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*ColorChooser) SetVAlign ¶
func (n *ColorChooser) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*ColorChooser) SetVExpand ¶
func (n *ColorChooser) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*ColorChooser) SetVisible ¶
func (n *ColorChooser) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*ColorChooser) SharedElement ¶
func (n *ColorChooser) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*ColorChooser) SizeRequest ¶
func (n *ColorChooser) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*ColorChooser) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*ColorChooser) TooltipText ¶
func (n *ColorChooser) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type ColorSwatch ¶
type ColorSwatch struct {
// contains filtered or unexported fields
}
ColorSwatch is a chip of one color: the colorswatch element, sized by its min-width and min-height, with the theme's radius and border, a checkerboard under a translucent color, and a ring while selected (the :selected state).
func NewColorSwatch ¶
func NewColorSwatch(c render.Color) *ColorSwatch
NewColorSwatch returns a swatch of c.
func (*ColorSwatch) AccessibleName ¶
func (n *ColorSwatch) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*ColorSwatch) AddClass ¶
func (n *ColorSwatch) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*ColorSwatch) Arrange ¶
Arrange records the widget's rect. A rect that moved or resized from the previous frame also invalidates the old pixels, so partial damage does not leave the widget's old paint behind.
func (*ColorSwatch) AttachStylesheet ¶
func (n *ColorSwatch) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*ColorSwatch) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*ColorSwatch) Classes ¶
func (n *ColorSwatch) Classes() []string
Classes returns a copy of the widget's classes.
func (*ColorSwatch) Color ¶
func (s *ColorSwatch) Color() render.Color
Color returns the shown color.
func (*ColorSwatch) DebugName ¶
func (n *ColorSwatch) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*ColorSwatch) DetachStylesheet ¶
func (n *ColorSwatch) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*ColorSwatch) Element ¶
func (n *ColorSwatch) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*ColorSwatch) Enabled ¶
func (n *ColorSwatch) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*ColorSwatch) HAlign ¶
func (n *ColorSwatch) HAlign() Align
HAlign returns the horizontal placement.
func (*ColorSwatch) HasState ¶
func (n *ColorSwatch) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*ColorSwatch) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*ColorSwatch) HitTest ¶
func (s *ColorSwatch) HitTest(p Point) Widget
HitTest returns the swatch inside its bounds.
func (*ColorSwatch) HoverWithin ¶
func (n *ColorSwatch) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*ColorSwatch) ID ¶
func (n *ColorSwatch) ID() string
ID returns the style id, empty when none is set.
func (*ColorSwatch) InlineStyle ¶
func (n *ColorSwatch) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*ColorSwatch) Invalidate ¶
func (n *ColorSwatch) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*ColorSwatch) InvalidateLayout ¶
func (n *ColorSwatch) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*ColorSwatch) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*ColorSwatch) LayoutMotion ¶
func (n *ColorSwatch) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*ColorSwatch) MaximumSize ¶
func (n *ColorSwatch) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*ColorSwatch) Measure ¶
func (s *ColorSwatch) Measure(axis Axis, forSize int) Sizes
Measure wants the min-width by min-height border box.
func (*ColorSwatch) Paint ¶
func (s *ColorSwatch) Paint(cv *render.Canvas)
Paint draws the box, then the color over a checkerboard inside the border.
func (*ColorSwatch) Parent ¶
func (n *ColorSwatch) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*ColorSwatch) RemoveAttr ¶
func (n *ColorSwatch) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*ColorSwatch) RemoveClass ¶
func (n *ColorSwatch) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*ColorSwatch) Selected ¶
func (s *ColorSwatch) Selected() bool
Selected reports whether the swatch is ringed.
func (*ColorSwatch) SetAccessibleName ¶
func (n *ColorSwatch) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*ColorSwatch) SetAttr ¶
func (n *ColorSwatch) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*ColorSwatch) SetClasses ¶
func (n *ColorSwatch) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*ColorSwatch) SetCursorName ¶
func (n *ColorSwatch) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*ColorSwatch) SetDebugName ¶
func (n *ColorSwatch) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*ColorSwatch) SetElement ¶
func (n *ColorSwatch) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*ColorSwatch) SetEnabled ¶
func (n *ColorSwatch) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*ColorSwatch) SetFocusOnClick ¶
func (n *ColorSwatch) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*ColorSwatch) SetHAlign ¶
func (n *ColorSwatch) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*ColorSwatch) SetHExpand ¶
func (n *ColorSwatch) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*ColorSwatch) SetID ¶
func (n *ColorSwatch) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*ColorSwatch) SetInlineStyle ¶
func (n *ColorSwatch) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*ColorSwatch) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*ColorSwatch) SetLayoutMotion ¶
func (n *ColorSwatch) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*ColorSwatch) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*ColorSwatch) SetMaximumSize ¶
func (n *ColorSwatch) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*ColorSwatch) SetOnClickWithin ¶
func (n *ColorSwatch) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*ColorSwatch) SetOnFocusChanged ¶
func (n *ColorSwatch) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*ColorSwatch) SetOnHoverWithin ¶
func (n *ColorSwatch) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*ColorSwatch) SetOnPointer ¶
func (n *ColorSwatch) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*ColorSwatch) SetOnScroll ¶
func (n *ColorSwatch) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*ColorSwatch) SetSelected ¶
func (s *ColorSwatch) SetSelected(on bool)
SetSelected rings the swatch as the current pick.
func (*ColorSwatch) SetSharedElement ¶
func (n *ColorSwatch) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*ColorSwatch) SetSizeRequest ¶
func (n *ColorSwatch) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*ColorSwatch) SetState ¶
func (n *ColorSwatch) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*ColorSwatch) SetTooltip ¶
func (n *ColorSwatch) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*ColorSwatch) SetTooltipMarkup ¶
func (n *ColorSwatch) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*ColorSwatch) SetVAlign ¶
func (n *ColorSwatch) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*ColorSwatch) SetVExpand ¶
func (n *ColorSwatch) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*ColorSwatch) SetVisible ¶
func (n *ColorSwatch) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*ColorSwatch) SharedElement ¶
func (n *ColorSwatch) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*ColorSwatch) SizeRequest ¶
func (n *ColorSwatch) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*ColorSwatch) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*ColorSwatch) TooltipText ¶
func (n *ColorSwatch) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type ColumnModel ¶
ColumnModel is the table's data source, ListModel's typed sibling.
type ColumnView ¶
type ColumnView[T any] struct { // OnRowReorder, when set, receives drag-and-drop row moves: from // and to are visible indices (post sort/filter), fired on the loop // goroutine. The application performs the move in its model - the // view never mutates data it does not own. OnRowReorder func(from, to int) // contains filtered or unexported fields }
ColumnView is the virtualized table (#90): typed columns over a ColumnModel, a header row with sort indicators, sort and filter in one stable permutation, tree indentation through the tree helpers, and optional row drag reordering. List underneath does what List is for - virtualization, selection, keyboard - through the same model adapter, so a million rows cost about what twenty do.
The model layer is the GIO list-model analog, shared with the typed views (#166): sorting and a stack of toggleable filters never touch the source model, they live in a permutation of its row indices - stable (equal rows keep source order), recomputed on SortBy/SetFilter/SetModel/AddFilter/SetFilterStatus/PopFilter/ ClearFilters, and the source's own order is one call away.
func NewColumnView ¶
func NewColumnView[T any](face render.Font, sizePx float64, model ColumnModel[T], cols []TableColumn[T]) *ColumnView[T]
NewColumnView returns a view over model with the given columns.
func (*ColumnView[T]) AddFilter ¶
func (v *ColumnView[T]) AddFilter(keep func(T) bool) *ViewFilter[T]
AddFilter appends a filter to the stack and returns its handle; every enabled filter must accept a row for it to show.
func (*ColumnView) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*ColumnView) Children ¶
func (c *ColumnView) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*ColumnView[T]) ClearFilters ¶
func (v *ColumnView[T]) ClearFilters()
ClearFilters drops every filter, SetFilter's slot included.
func (*ColumnView[T]) EnableRowDrag ¶
func (v *ColumnView[T]) EnableRowDrag(on bool)
EnableRowDrag turns row drag-and-drop on: rows become drag sources offering the internal reorder mime, and a row dropped on another fires OnRowReorder with the two visible indices.
func (*ColumnView[T]) List ¶
func (v *ColumnView[T]) List() *List
List exposes the underlying list - selection, activation, keyboard, scrolling - the same surface a plain List gives.
func (*ColumnView[T]) Matching ¶
func (v *ColumnView[T]) Matching() int
Matching reports how many rows pass the filters, the window aside.
func (*ColumnView) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*ColumnView[T]) PopFilter ¶
func (v *ColumnView[T]) PopFilter()
PopFilter drops the most recently added filter.
func (*ColumnView[T]) Row ¶
func (v *ColumnView[T]) Row(i int) T
Row returns the data of visible row i (post sort, filter and window).
func (*ColumnView[T]) Rows ¶
func (v *ColumnView[T]) Rows() int
Rows reports the visible row count: the window's share of the matching rows.
func (*ColumnView[T]) SetColumns ¶
func (v *ColumnView[T]) SetColumns(cols []TableColumn[T])
SetColumns replaces the columns: a column toggled visible or hidden. The sort stays on the column it was on when that column remains.
func (*ColumnView[T]) SetFilter ¶
func (v *ColumnView[T]) SetFilter(keep func(T) bool)
SetFilter narrows the view to rows keep accepts (nil clears); the source model is untouched and the sort stays. It is one slot in the filter stack: AddFilter/SetFilterStatus/PopFilter/ClearFilters manage the rest alongside it.
func (*ColumnView[T]) SetFilterStatus ¶
func (v *ColumnView[T]) SetFilterStatus(f *ViewFilter[T], on bool)
SetFilterStatus turns a filter AddFilter returned on or off without dropping it.
func (*ColumnView[T]) SetModel ¶
func (v *ColumnView[T]) SetModel(m ColumnModel[T])
SetModel replaces the data source and drops the sort/filter permutation back to the source order.
func (*ColumnView[T]) SetWindow ¶
func (v *ColumnView[T]) SetWindow(offset, limit int)
SetWindow shows only limit of the sorted, filtered rows from offset on - a page of them; limit 0 shows them all.
func (*ColumnView[T]) SortBy ¶
func (v *ColumnView[T]) SortBy(col int, desc bool)
SortBy sorts by column col (descending with desc); col -1 returns to the source order. A column without a Sort function clears the sort instead.
func (*ColumnView[T]) SortedBy ¶
func (v *ColumnView[T]) SortedBy() (col int, ascending bool)
SortedBy reports the active sort column (-1 when none) and its direction.
func (*ColumnView[T]) SourceIndex ¶
func (v *ColumnView[T]) SourceIndex(i int) int
SourceIndex maps visible row i to its row in the model, -1 when out of range.
type ComboEntry ¶
type ComboEntry struct {
*Entry
// OnSelected fires with the picked item (arrow keys, Enter, or a
// click in the list) - a choice, unlike free typing.
OnSelected func(item string)
// contains filtered or unexported fields
}
ComboEntry is the editable dropdown, GTK's ComboBox-with-entry: an Entry whose completion lists the items (prefix match, case-insensitive), a trailing chevron toggling the full list, and OnSelected for the pick. Free text stays free - typing an unmatched value is valid input, exactly like the GTK original.
func NewComboEntry ¶
NewComboEntry returns an editable dropdown over items, its text starting at selected ("" for empty).
func (ComboEntry) AccessibleName ¶
func (n ComboEntry) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (ComboEntry) AddClass ¶
func (n ComboEntry) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (ComboEntry) AttachStylesheet ¶
func (n ComboEntry) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (ComboEntry) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (ComboEntry) Classes ¶
func (n ComboEntry) Classes() []string
Classes returns a copy of the widget's classes.
func (ComboEntry) DebugName ¶
func (n ComboEntry) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (ComboEntry) DetachStylesheet ¶
func (n ComboEntry) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (ComboEntry) Element ¶
func (n ComboEntry) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (ComboEntry) Enabled ¶
func (n ComboEntry) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (ComboEntry) HAlign ¶
func (n ComboEntry) HAlign() Align
HAlign returns the horizontal placement.
func (ComboEntry) HasState ¶
func (n ComboEntry) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (ComboEntry) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (ComboEntry) HoverWithin ¶
func (n ComboEntry) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (ComboEntry) ID ¶
func (n ComboEntry) ID() string
ID returns the style id, empty when none is set.
func (ComboEntry) InlineStyle ¶
func (n ComboEntry) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (ComboEntry) Invalidate ¶
func (n ComboEntry) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (ComboEntry) InvalidateLayout ¶
func (n ComboEntry) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (ComboEntry) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (ComboEntry) LayoutMotion ¶
func (n ComboEntry) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (ComboEntry) MaximumSize ¶
func (n ComboEntry) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (ComboEntry) Parent ¶
func (n ComboEntry) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (ComboEntry) RemoveAttr ¶
func (n ComboEntry) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (ComboEntry) RemoveClass ¶
func (n ComboEntry) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (ComboEntry) SetAccessibleName ¶
func (n ComboEntry) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (ComboEntry) SetAttr ¶
func (n ComboEntry) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (ComboEntry) SetClasses ¶
func (n ComboEntry) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (ComboEntry) SetCursorName ¶
func (n ComboEntry) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (ComboEntry) SetDebugName ¶
func (n ComboEntry) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (ComboEntry) SetElement ¶
func (n ComboEntry) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (ComboEntry) SetEnabled ¶
func (n ComboEntry) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (ComboEntry) SetFocusOnClick ¶
func (n ComboEntry) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (ComboEntry) SetHAlign ¶
func (n ComboEntry) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (ComboEntry) SetHExpand ¶
func (n ComboEntry) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (ComboEntry) SetID ¶
func (n ComboEntry) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (ComboEntry) SetInlineStyle ¶
func (n ComboEntry) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (ComboEntry) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*ComboEntry) SetItems ¶
func (c *ComboEntry) SetItems(items []string)
SetItems replaces the item list; the field's text is untouched.
func (ComboEntry) SetLayoutMotion ¶
func (n ComboEntry) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (ComboEntry) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (ComboEntry) SetMaximumSize ¶
func (n ComboEntry) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (ComboEntry) SetOnClickWithin ¶
func (n ComboEntry) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (ComboEntry) SetOnFocusChanged ¶
func (n ComboEntry) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (ComboEntry) SetOnHoverWithin ¶
func (n ComboEntry) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (ComboEntry) SetOnPointer ¶
func (n ComboEntry) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (ComboEntry) SetOnScroll ¶
func (n ComboEntry) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (ComboEntry) SetSharedElement ¶
func (n ComboEntry) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (ComboEntry) SetSizeRequest ¶
func (n ComboEntry) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (ComboEntry) SetState ¶
func (n ComboEntry) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (ComboEntry) SetTooltip ¶
func (n ComboEntry) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (ComboEntry) SetTooltipMarkup ¶
func (n ComboEntry) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (ComboEntry) SetVAlign ¶
func (n ComboEntry) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (ComboEntry) SetVExpand ¶
func (n ComboEntry) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (ComboEntry) SetVisible ¶
func (n ComboEntry) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (ComboEntry) SharedElement ¶
func (n ComboEntry) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (ComboEntry) SizeRequest ¶
func (n ComboEntry) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (ComboEntry) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (ComboEntry) TooltipText ¶
func (n ComboEntry) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type ComboRow ¶
type ComboRow struct {
*ActionRow
// contains filtered or unexported fields
}
ComboRow is an ActionRow with a Dropdown in its end slot; the selection shows on the row's face.
func NewComboRow ¶
func NewComboRow(face render.Font, sizePx float64, title, subtitle string, items []string, selected int, on func(i int)) *ComboRow
NewComboRow returns the row over items with selected picked; on, when set, receives selection changes.
func (ComboRow) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (ComboRow) Children ¶
func (c ComboRow) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (ComboRow) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (ComboRow) PackStart ¶
func (p ComboRow) PackStart(w Widget)
PackStart adds w to the leading slot.
func (*ComboRow) SetSelected ¶
SetSelected selects i, firing on like every selection change (the Dropdown fires OnSelect whatever the source).
type Combobox ¶
type Combobox[T comparable] struct { // OnChanged fires with the selection after the user changed it. OnChanged func(selected []T) // contains filtered or unexported fields }
Combobox picks typed values from a searchable list: an outline button showing the selection that opens a Command of the options in a popover, a check trailing each selected one. A single-choice combobox closes on a pick, and picking the selected option clears it; a multiple-choice one toggles the picked option and stays open. It styles as the `combobox` element: the button.outline trigger and its .placeholder text.
func NewCombobox ¶
func NewCombobox[T comparable](face render.Font, placeholder string, options ...ComboboxOption[T]) *Combobox[T]
NewCombobox returns a single-choice combobox over options showing placeholder while nothing is selected.
func (*Combobox) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*Combobox) Children ¶
func (c *Combobox) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Combobox) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*Combobox[T]) Selected ¶
func (c *Combobox[T]) Selected() []T
Selected returns the selected values in option order.
func (*Combobox[T]) SetMultiple ¶
SetMultiple lets the user pick any number of options.
func (*Combobox[T]) SetSelected ¶
func (c *Combobox[T]) SetSelected(values ...T)
SetSelected selects values, which must all be options' values, or the call panics. It reports nothing.
type ComboboxOption ¶
type ComboboxOption[T comparable] struct { Value T Label string }
ComboboxOption is one choice of a Combobox: the typed value it picks and the label it shows and is searched by.
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command is a searchable list of actions: a search entry over grouped items that filters them fuzzily as the query is typed, ranking the best matches first within each group and the groups by their best, with an empty state when nothing matches. Up, Down, Home and End move the highlight while the entry keeps the focus; Enter or a click picks the highlighted item. A list built with NewCommandList has no search row: it takes the focus itself, moves the highlight on the same keys, picks on Enter or Space, and jumps by type-ahead on printable keys. It works inline or as a popover's or dialog's content. It styles as the `command` element: the .input row, .heading labels, .item rows (:selected while highlighted), .shortcut labels, .separator lines and the .empty label.
func NewCommand ¶
func NewCommand(face render.Font, placeholder string, groups ...CommandGroup) *Command
NewCommand returns a command over groups whose search entry shows placeholder.
func NewCommandList ¶
func NewCommandList(face render.Font, groups ...CommandGroup) *Command
NewCommandList returns a command over groups with no search row: a pick list, such as a dropdown's, that is its own focus target.
func (*Command) Arrange ¶
Arrange lays the command out and reveals a highlight set before its rows had a place.
func (*Command) Children ¶
func (c *Command) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Command) FocusTarget ¶
FocusTarget returns the widget the keyboard focus belongs on: the search entry, or the command itself when it has no search row.
func (*Command) Highlighted ¶
func (c *Command) Highlighted() (CommandItem, bool)
Highlighted returns the highlighted item and whether there is one.
func (*Command) InsertRune ¶
InsertRune implements RuneHandler for a command without a search row: Space picks the highlighted item, the other half of the activation pair, and every other printable rune jumps the highlight by type-ahead over the pickable items.
func (*Command) InterceptKey ¶
InterceptKey implements KeyInterceptor: while the search entry has the focus, the navigation keys move the highlight and Enter picks.
func (*Command) KeyAction ¶
KeyAction implements KeyActionHandler: a command without a search row holds the focus itself and navigates on its own keys.
func (*Command) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*Command) SetEmptyText ¶
SetEmptyText replaces the text shown when nothing matches.
func (*Command) SetGroups ¶
func (c *Command) SetGroups(groups ...CommandGroup)
SetGroups replaces the groups and clears the query.
type CommandGroup ¶
type CommandGroup struct {
Heading string
Items []CommandItem
}
CommandGroup is a headed run of items; an empty heading shows none.
type CommandItem ¶
type CommandItem struct {
// Label is the text shown and matched.
Label string
// Keywords are extra terms the search matches the item by.
Keywords []string
// Shortcut is the keys shown at the row's end, display only.
Shortcut string
// Icon leads the row; nil shows none.
Icon Widget
// Trailing ends the row, after the shortcut; nil shows none.
Trailing Widget
// OnSelect runs when the item is picked.
OnSelect func()
// Disabled shows the item without letting it be picked.
Disabled bool
}
CommandItem is one entry of a Command.
type ContentPaster ¶
ContentPaster takes ctrl+v content in formats of its own instead of text: PasteMimes lists the mimes it reads, best first, and PasteContent receives the best one the clipboard offers. widget.Image reads images (decoding off the loop goroutine); a file list would read transfer.MimeURIList. Holding this interface is what makes a widget a non-text paste target.
type ContextMenu ¶
type ContextMenu struct {
// contains filtered or unexported fields
}
ContextMenu gives a region a context menu: a right click anywhere on its child, a long press, or the Menu key (Shift+F10) while something inside it has the focus opens items as a menu at the pointer - submenus, check and radio items and shortcuts included, as Menu renders them. It styles as the `contextmenu` element.
func NewContextMenu ¶
func NewContextMenu(face render.Font, child Widget, items ...MenuItem) *ContextMenu
NewContextMenu wraps child with a context menu of items.
func (*ContextMenu) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*ContextMenu) Children ¶
func (c *ContextMenu) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*ContextMenu) Gesture ¶
func (c *ContextMenu) Gesture(g Gesture) bool
Gesture implements GestureHandler: a long press opens the menu where the finger is.
func (*ContextMenu) Items ¶
func (c *ContextMenu) Items() []MenuItem
Items returns the menu's items.
func (*ContextMenu) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*ContextMenu) OpenContextMenu ¶
func (c *ContextMenu) OpenContextMenu(at Point)
OpenContextMenu implements ContextMenuOpener: the menu opens at at.
func (*ContextMenu) SetItems ¶
func (c *ContextMenu) SetItems(items ...MenuItem)
SetItems replaces the menu's items.
type ContextMenuOpener ¶
type ContextMenuOpener interface {
OpenContextMenu(at Point)
}
ContextMenuOpener is a widget that opens a context menu for itself and its descendants: a right click on one of them, a long press, or the Menu key (Shift+F10) while one has the focus. at is where the menu opens, the pointer or the focused widget's center.
type CursorNamer ¶
type CursorNamer interface {
// CursorName returns the xcursor shape for the hovered widget.
CursorName() string
}
CursorNamer lets a widget request a pointer shape while hovered, using xcursor names ("xterm" for text, "left_ptr" arrow default).
type DataTable ¶
type DataTable[T any] struct { // OnSelectionChanged fires with the selected model rows, ascending, // after the user changed them. OnSelectionChanged func(rows []int) // contains filtered or unexported fields }
DataTable is a data table on a ColumnView: a text filter over the rows, a Columns menu that hides and shows columns, sorting by the sortable columns' headers, row selection with a check column (the header check selecting the page), and pages of rows with a pager and a count of the selected rows under the table. The rows stay virtualized: a page of a million rows costs what a page of ten does. Selection is by row of the model, so it survives paging, sorting and filtering. It styles as the `datatable` element: the .toolbar row, the .table box, and the .footer row.
func NewDataTable ¶
func NewDataTable[T any](face render.Font, model ColumnModel[T], cols []TableColumn[T], match func(row T, query string) bool) *DataTable[T]
NewDataTable returns a table over model's rows in cols; match decides whether a row passes the filter's text (nil hides the filter).
func (*DataTable) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*DataTable) Children ¶
func (c *DataTable) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*DataTable[T]) ColumnVisible ¶
ColumnVisible reports data column i shown.
func (*DataTable) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*DataTable[T]) SetColumnVisible ¶
SetColumnVisible shows or hides data column i (in the order the table was given them).
func (*DataTable[T]) SetPageSize ¶
SetPageSize shows n rows a page, at least one.
func (*DataTable[T]) SortBy ¶
SortBy sorts by data column i (in the order the table was given them; descending with desc), or returns to the model's order for -1 or a hidden or unsortable column.
func (*DataTable[T]) View ¶
func (t *DataTable[T]) View() *ColumnView[T]
View returns the table's column view.
type Date ¶
Date is a calendar day: a year, month and day with no time of day and no zone, so it means the same day wherever it is read. The zero Date is no date.
func Today ¶
func Today() Date
Today is the local calendar day now, the one reading of the clock and zone the calendar widgets make (see Calendar.SetToday).
func (Date) AddMonths ¶
AddMonths is the same day n months on, clamped to that month's length: January 31 plus one month is the last of February.
func (Date) Compare ¶
Compare orders days: -1 when d is earlier than o, 0 when the same, +1 when later.
func (Date) FirstOfMonth ¶
FirstOfMonth is the first day of d's month.
type DatePicker ¶
type DatePicker struct {
// OnDate fires with a single-date picker's pick; OnRange with a
// range picker's, once both ends are picked; OnTime with the time
// the user set. None fires for the setters.
OnDate func(Date)
OnRange func(from, to Date)
OnTime func(TimeOfDay)
// contains filtered or unexported fields
}
DatePicker is a date field: an outline button showing the picked date - or range - formatted for the locale, that opens a Calendar in a popover. A single-date picker closes on a pick; a range picker shows two months and closes once the range has both ends. Presets list ready-made picks beside the calendar, and SetTimeInput adds an hour and minute under it. Dates are widget.Date and times TimeOfDay, so nothing depends on the local zone. It styles as the `datepicker` element: the button.outline trigger and its .placeholder text.
func NewDatePicker ¶
func NewDatePicker(face render.Font, placeholder string) *DatePicker
NewDatePicker returns a single-date picker showing placeholder until a date is picked.
func (*DatePicker) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*DatePicker) Children ¶
func (c *DatePicker) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*DatePicker) Date ¶
func (p *DatePicker) Date() Date
Date returns a single-date picker's date, zero when none.
func (*DatePicker) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*DatePicker) Range ¶
func (p *DatePicker) Range() (from, to Date)
Range returns a range picker's range.
func (*DatePicker) SetDate ¶
func (p *DatePicker) SetDate(d Date)
SetDate sets a single-date picker's date; zero clears it.
func (*DatePicker) SetMode ¶
func (p *DatePicker) SetMode(m CalendarMode)
SetMode switches between picking a date and a range; the picks clear.
func (*DatePicker) SetNames ¶
func (p *DatePicker) SetNames(names CalendarNames)
SetNames localizes the calendar and the formatting; nil reads the message catalog (CalendarCatalog).
func (*DatePicker) SetPresets ¶
func (p *DatePicker) SetPresets(presets ...DatePreset)
SetPresets lists ready-made picks beside the calendar.
func (*DatePicker) SetRange ¶
func (p *DatePicker) SetRange(from, to Date)
SetRange sets a range picker's range, the earlier day starting it.
func (*DatePicker) SetTime ¶
func (p *DatePicker) SetTime(t TimeOfDay)
SetTime sets the time; it must be a valid wall-clock time, or the call panics.
func (*DatePicker) SetTimeInput ¶
func (p *DatePicker) SetTimeInput(on bool)
SetTimeInput adds an hour and minute under the calendar, shown on the trigger after the date.
type DatePreset ¶
DatePreset is a ready-made pick beside a DatePicker's calendar: "Today", "Next week". A single-date picker picks From; a range picker picks From to To.
type DebugNamer ¶
type DebugNamer interface {
// DebugName returns the debug name, empty when none is set.
DebugName() string
}
DebugNamer is implemented by widgets carrying a debug name set with SetDebugName. Every widget that embeds node has the method; the interface lets the inspector also recognize third-party Widget implementations that mirror the API.
type DirSource ¶
DirSource lists one directory; the default walks the filesystem, hiding dot files. Tests and portal backends substitute their own. It runs off the loop goroutine and must touch no widget.
type Direction ¶
Direction names the base paragraph direction a text widget resolves and lays out with. It is text.Direction — the one resolution every text path shares; the alias lets call sites read against the widget package.
type DoubleClicker ¶
type DoubleClicker interface {
DoubleClickAt(p Point)
}
DoubleClicker is invoked on the second click of a double-click; p is the release point in root coordinates.
type DragContent ¶
DragContent is the payload a drag carries - mime types best first with a writer, the actions offered (copy unless set), and the source's feedback and completion hooks; see transfer.Drag.
type DragEnterer ¶
DragEnterer decides whether a widget accepts a drag hovering it, by mime. mimes lists the offered types best first; return the mime to receive on drop, or "" to reject the drag.
type DragHoverer ¶
type DragHoverer interface {
DragHover(p Point)
}
DragHoverer receives drag movement while a drag hovers the widget, for position-aware feedback (drop indicators, insertion gaps).
type DragIconer ¶
type DragIconer interface {
DragIcon() Widget
}
DragIconer is a DragSource that names the widget its drag icon renders, instead of itself: a list dragging several rows shows a stack of them.
type DragInterceptor ¶
DragInterceptor is an ancestor that may take over a press in its subtree once the pointer moves: a swipe-to-dismiss card takes a sideways drag from the button the press landed on. It sees every move of a press it has not taken; true takes the gesture. The pressed widget's press then ends without a click, and the interceptor receives the rest: its DragMove for each move, and PressEnd at the release.
type DragLeaver ¶
type DragLeaver interface {
DragLeave()
}
DragLeaver receives a drag that left the widget without dropping.
type DragMover ¶
type DragMover interface {
DragMove(p Point)
}
DragMover receives pointer motion while the widget is pressed.
type DragOverSetter ¶
type DragOverSetter interface {
SetDragOver(on bool)
}
DragOverSetter receives drag-hover tracking from the Router, the highlight bit while a drag sits over the widget — the drop-target counterpart of HoverSetter.
type DragSource ¶
type DragSource interface {
// DragContent returns the offered payload, or nil to not drag.
DragContent() *DragContent
}
DragSource lets a widget start a drag-and-drop: a press on it plus motion past the app's drag threshold offers DragContent through the wl_data_device. Return nil to decline this particular press.
type DrawSurface ¶
type DrawSurface struct {
// OnResize redraws the whole surface into the fresh backing
// canvas; it runs on the loop, from the paint that reallocated.
OnResize func(cv *render.Canvas)
// OnStylus receives every tablet sample over the surface.
OnStylus func(s Stylus)
// contains filtered or unexported fields
}
DrawSurface is DrawingArea's retained counterpart (relm4's DrawHandler): a backing canvas whose pixels persist between paints, so an incremental application - a paint program, a plot that appends samples - draws only what changed and never repaints the rest. The application draws through Draw any time on the loop; Paint shows the backing canvas as it stands. OnStylus receives tablet samples over the area, like DrawingArea's.
A resize at the same device scale keeps the content and leaves the newly exposed area transparent; a rescale (or a first paint before any Draw, which allocates at 1x) reallocates the buffer, drops the pixels, and hands the fresh canvas to OnResize - the one place an application redraws everything it owes.
func NewDrawSurface ¶
func NewDrawSurface(w, h int) *DrawSurface
NewDrawSurface returns a surface requesting w x h logical pixels.
func (*DrawSurface) AccessibleName ¶
func (n *DrawSurface) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*DrawSurface) AddClass ¶
func (n *DrawSurface) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*DrawSurface) Arrange ¶
Arrange records the widget's rect. A rect that moved or resized from the previous frame also invalidates the old pixels, so partial damage does not leave the widget's old paint behind.
func (*DrawSurface) AttachStylesheet ¶
func (n *DrawSurface) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*DrawSurface) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*DrawSurface) Canvas ¶
func (d *DrawSurface) Canvas() *render.Canvas
Canvas returns the backing canvas, or nil before the surface first drew or painted. It carries the device scale the pixels were laid down at; draw through Draw, which also schedules the repaint.
func (*DrawSurface) Classes ¶
func (n *DrawSurface) Classes() []string
Classes returns a copy of the widget's classes.
func (*DrawSurface) DebugName ¶
func (n *DrawSurface) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*DrawSurface) DetachStylesheet ¶
func (n *DrawSurface) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*DrawSurface) Draw ¶
func (d *DrawSurface) Draw(r render.Rect, fn func(cv *render.Canvas))
Draw runs fn over the backing canvas with drawing clipped to r, a rect in the surface's own logical pixels, and schedules a repaint of exactly that rect. fn must draw only inside r: the clip enforces it, so a stray primitive cannot land outside the damage. It runs on the loop, like every widget mutation.
func (*DrawSurface) Element ¶
func (n *DrawSurface) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*DrawSurface) Enabled ¶
func (n *DrawSurface) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*DrawSurface) HAlign ¶
func (n *DrawSurface) HAlign() Align
HAlign returns the horizontal placement.
func (*DrawSurface) HasState ¶
func (n *DrawSurface) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*DrawSurface) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*DrawSurface) HitTest ¶
func (d *DrawSurface) HitTest(p Point) Widget
HitTest makes the whole surface the target.
func (*DrawSurface) HoverWithin ¶
func (n *DrawSurface) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*DrawSurface) ID ¶
func (n *DrawSurface) ID() string
ID returns the style id, empty when none is set.
func (*DrawSurface) InlineStyle ¶
func (n *DrawSurface) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*DrawSurface) Invalidate ¶
func (n *DrawSurface) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*DrawSurface) InvalidateLayout ¶
func (n *DrawSurface) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*DrawSurface) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*DrawSurface) LayoutMotion ¶
func (n *DrawSurface) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*DrawSurface) MaximumSize ¶
func (n *DrawSurface) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*DrawSurface) Measure ¶
func (d *DrawSurface) Measure(axis Axis, forSize int) Sizes
Measure requests the content size.
func (*DrawSurface) Paint ¶
func (d *DrawSurface) Paint(cv *render.Canvas)
Paint shows the backing canvas, allocating it first if this paint is the surface's first look at its size or scale.
func (*DrawSurface) Parent ¶
func (n *DrawSurface) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*DrawSurface) RemoveAttr ¶
func (n *DrawSurface) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*DrawSurface) RemoveClass ¶
func (n *DrawSurface) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*DrawSurface) SetAccessibleName ¶
func (n *DrawSurface) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*DrawSurface) SetAttr ¶
func (n *DrawSurface) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*DrawSurface) SetClasses ¶
func (n *DrawSurface) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*DrawSurface) SetContentSize ¶
func (d *DrawSurface) SetContentSize(w, h int)
SetContentSize changes the requested size.
func (*DrawSurface) SetCursorName ¶
func (n *DrawSurface) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*DrawSurface) SetDebugName ¶
func (n *DrawSurface) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*DrawSurface) SetElement ¶
func (n *DrawSurface) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*DrawSurface) SetEnabled ¶
func (n *DrawSurface) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*DrawSurface) SetFocusOnClick ¶
func (n *DrawSurface) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*DrawSurface) SetHAlign ¶
func (n *DrawSurface) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*DrawSurface) SetHExpand ¶
func (n *DrawSurface) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*DrawSurface) SetID ¶
func (n *DrawSurface) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*DrawSurface) SetInlineStyle ¶
func (n *DrawSurface) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*DrawSurface) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*DrawSurface) SetLayoutMotion ¶
func (n *DrawSurface) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*DrawSurface) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*DrawSurface) SetMaximumSize ¶
func (n *DrawSurface) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*DrawSurface) SetOnClickWithin ¶
func (n *DrawSurface) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*DrawSurface) SetOnFocusChanged ¶
func (n *DrawSurface) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*DrawSurface) SetOnHoverWithin ¶
func (n *DrawSurface) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*DrawSurface) SetOnPointer ¶
func (n *DrawSurface) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*DrawSurface) SetOnScroll ¶
func (n *DrawSurface) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*DrawSurface) SetSharedElement ¶
func (n *DrawSurface) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*DrawSurface) SetSizeRequest ¶
func (n *DrawSurface) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*DrawSurface) SetState ¶
func (n *DrawSurface) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*DrawSurface) SetTooltip ¶
func (n *DrawSurface) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*DrawSurface) SetTooltipMarkup ¶
func (n *DrawSurface) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*DrawSurface) SetVAlign ¶
func (n *DrawSurface) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*DrawSurface) SetVExpand ¶
func (n *DrawSurface) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*DrawSurface) SetVisible ¶
func (n *DrawSurface) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*DrawSurface) SharedElement ¶
func (n *DrawSurface) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*DrawSurface) SizeRequest ¶
func (n *DrawSurface) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*DrawSurface) Stylus ¶
func (d *DrawSurface) Stylus(s Stylus)
Stylus implements StylusHandler.
func (*DrawSurface) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*DrawSurface) TooltipText ¶
func (n *DrawSurface) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type DrawingArea ¶
type DrawingArea struct {
// OnDraw paints the area into its bounds.
OnDraw func(cv *render.Canvas, area render.Rect)
// OnStylus receives every tablet sample over the area.
OnStylus func(s Stylus)
// contains filtered or unexported fields
}
DrawingArea is a widget the application paints itself (GTK DrawingArea): OnDraw receives the canvas, clipped to the area, on every paint; QueueDraw asks for one. OnStylus receives tablet samples over the area - pressure and tilt for freehand drawing - while the pen also drives the pointer like any tool.
func NewDrawingArea ¶
func NewDrawingArea(w, h int) *DrawingArea
NewDrawingArea returns an area requesting w x h logical pixels.
func (*DrawingArea) AccessibleName ¶
func (n *DrawingArea) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*DrawingArea) AddClass ¶
func (n *DrawingArea) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*DrawingArea) Arrange ¶
Arrange records the widget's rect. A rect that moved or resized from the previous frame also invalidates the old pixels, so partial damage does not leave the widget's old paint behind.
func (*DrawingArea) AttachStylesheet ¶
func (n *DrawingArea) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*DrawingArea) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*DrawingArea) Classes ¶
func (n *DrawingArea) Classes() []string
Classes returns a copy of the widget's classes.
func (*DrawingArea) DebugName ¶
func (n *DrawingArea) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*DrawingArea) DetachStylesheet ¶
func (n *DrawingArea) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*DrawingArea) Element ¶
func (n *DrawingArea) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*DrawingArea) Enabled ¶
func (n *DrawingArea) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*DrawingArea) HAlign ¶
func (n *DrawingArea) HAlign() Align
HAlign returns the horizontal placement.
func (*DrawingArea) HasState ¶
func (n *DrawingArea) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*DrawingArea) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*DrawingArea) HitTest ¶
func (d *DrawingArea) HitTest(p Point) Widget
HitTest makes the whole area the target.
func (*DrawingArea) HoverWithin ¶
func (n *DrawingArea) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*DrawingArea) ID ¶
func (n *DrawingArea) ID() string
ID returns the style id, empty when none is set.
func (*DrawingArea) InlineStyle ¶
func (n *DrawingArea) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*DrawingArea) Invalidate ¶
func (n *DrawingArea) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*DrawingArea) InvalidateLayout ¶
func (n *DrawingArea) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*DrawingArea) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*DrawingArea) LayoutMotion ¶
func (n *DrawingArea) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*DrawingArea) MaximumSize ¶
func (n *DrawingArea) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*DrawingArea) Measure ¶
func (d *DrawingArea) Measure(axis Axis, forSize int) Sizes
Measure requests the content size.
func (*DrawingArea) Paint ¶
func (d *DrawingArea) Paint(cv *render.Canvas)
Paint runs OnDraw clipped to the area.
func (*DrawingArea) Parent ¶
func (n *DrawingArea) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*DrawingArea) RemoveAttr ¶
func (n *DrawingArea) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*DrawingArea) RemoveClass ¶
func (n *DrawingArea) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*DrawingArea) SetAccessibleName ¶
func (n *DrawingArea) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*DrawingArea) SetAttr ¶
func (n *DrawingArea) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*DrawingArea) SetClasses ¶
func (n *DrawingArea) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*DrawingArea) SetContentSize ¶
func (d *DrawingArea) SetContentSize(w, h int)
SetContentSize changes the requested size.
func (*DrawingArea) SetCursorName ¶
func (n *DrawingArea) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*DrawingArea) SetDebugName ¶
func (n *DrawingArea) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*DrawingArea) SetElement ¶
func (n *DrawingArea) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*DrawingArea) SetEnabled ¶
func (n *DrawingArea) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*DrawingArea) SetFocusOnClick ¶
func (n *DrawingArea) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*DrawingArea) SetHAlign ¶
func (n *DrawingArea) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*DrawingArea) SetHExpand ¶
func (n *DrawingArea) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*DrawingArea) SetID ¶
func (n *DrawingArea) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*DrawingArea) SetInlineStyle ¶
func (n *DrawingArea) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*DrawingArea) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*DrawingArea) SetLayoutMotion ¶
func (n *DrawingArea) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*DrawingArea) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*DrawingArea) SetMaximumSize ¶
func (n *DrawingArea) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*DrawingArea) SetOnClickWithin ¶
func (n *DrawingArea) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*DrawingArea) SetOnFocusChanged ¶
func (n *DrawingArea) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*DrawingArea) SetOnHoverWithin ¶
func (n *DrawingArea) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*DrawingArea) SetOnPointer ¶
func (n *DrawingArea) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*DrawingArea) SetOnScroll ¶
func (n *DrawingArea) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*DrawingArea) SetSharedElement ¶
func (n *DrawingArea) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*DrawingArea) SetSizeRequest ¶
func (n *DrawingArea) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*DrawingArea) SetState ¶
func (n *DrawingArea) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*DrawingArea) SetTooltip ¶
func (n *DrawingArea) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*DrawingArea) SetTooltipMarkup ¶
func (n *DrawingArea) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*DrawingArea) SetVAlign ¶
func (n *DrawingArea) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*DrawingArea) SetVExpand ¶
func (n *DrawingArea) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*DrawingArea) SetVisible ¶
func (n *DrawingArea) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*DrawingArea) SharedElement ¶
func (n *DrawingArea) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*DrawingArea) SizeRequest ¶
func (n *DrawingArea) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*DrawingArea) Stylus ¶
func (d *DrawingArea) Stylus(s Stylus)
Stylus implements StylusHandler.
func (*DrawingArea) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*DrawingArea) TooltipText ¶
func (n *DrawingArea) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type DropActionChooser ¶
DropActionChooser is a drop target that picks the action from those the source offers - a file view moving within one disk, copying across. Without it a drop prefers copy.
type Dropdown ¶
type Dropdown struct {
// OnSelect fires exactly once per selection change, whatever
// produced it: a pick in the list or SetSelected. Re-picking the
// selected row is not a change and fires nothing.
OnSelect func(i int)
// contains filtered or unexported fields
}
Dropdown is a combobox: a closed face showing the current selection that opens its items in a popover beneath it, through the surface host of its tree (OpenPopover), as a Command list with no search row: header rows head its groups, row icons lead their items, and a check trails the selected one. The popover closes on a pick, on Esc or a click away, or on a second click on the face.
Keyboard: Enter, Space, or Down opens while focused; in the open list arrows move the highlight (Home/End jump), Enter or Space picks, and printable keys jump the highlight by type-ahead.
Type-ahead on the closed face (GTK combobox parity): printable keys cycle the selection through the rows whose label starts with the typed prefix (case-insensitive). Space never joins a prefix: it opens. Repeated keys cycle among the equal-prefix rows; the chain resets after a short idle timeout. Keys that match nothing are ignored outright.
The constructor takes the face like every other text widget: face, then sizePx, then the items. Face may be a render.Chain for mixed-script fallback; a nil face panics there (see requireFace) instead of failing later, in shaping.
Example ¶
package main
import (
"fmt"
"log"
"github.com/stubbedev/lys-lib/render"
"golang.org/x/image/font/gofont/goregular"
"github.com/stubbedev/lys-ui/widget"
)
func face() *render.Typeface {
tf, err := render.LoadFont(goregular.TTF)
if err != nil {
log.Fatal(err)
}
return tf
}
// popoverHost is a stand-in for the application's surface host: it
// hands every popover's keys to the widget the popover focuses.
type popoverHost struct{ focus widget.KeyActionHandler }
func (h *popoverHost) OpenMenu(widget.Boundser, render.Font, float64, []widget.MenuItem, widget.MenuOptions) {
}
func (h *popoverHost) OpenPopover(_ widget.Boundser, _ widget.Widget, opts widget.PopoverOptions) func() {
h.focus = opts.Focus.(widget.KeyActionHandler)
return func() {}
}
func (h *popoverHost) Focus(widget.Widget) error { return nil }
func main() {
// A dropdown is a closed face showing the selection; Enter, Space,
// or Down opens the item list in a popover beneath it while
// focused, through the surface host of its tree. The list holds the
// focus: arrows move the highlight and Enter picks. Here the list
// opens from the keyboard, Down walks to the second row, and Enter
// commits it exactly once.
dd := widget.NewDropdown(face(), 13, []string{"Light", "Dark", "System"}, 0)
host := &popoverHost{}
widget.SetSurfaceHost(dd, host)
var picked string
dd.OnSelect = func(int) { picked = dd.Selection() }
dd.KeyAction(widget.KeyEnter, 0)
host.focus.KeyAction(widget.KeyDown, 0)
host.focus.KeyAction(widget.KeyEnter, 0)
fmt.Println("picked:", picked)
// DropdownOf carries typed values behind the labels, so handlers
// see the value, not an index to look up.
outputs := []widget.DropdownItem[string]{
{Label: "eDP-1", Value: "/dev/drm0"},
{Label: "HDMI-A-1", Value: "/dev/drm1"},
}
selector := widget.NewDropdownOf(face(), 13, outputs, 0)
selector.OnSelect = func(i int, dev string) {
fmt.Println("output", i, "->", dev)
}
selector.SetSelected(1)
fmt.Println("value:", selector.Value())
}
Output: picked: Dark output 1 -> /dev/drm1 value: /dev/drm1
func NewDropdown ¶
NewDropdown returns a dropdown showing items, painted with face at sizePx, with the selected index clamped into range (-1 when there are no items). Face may be a render.Chain for mixed-script fallback.
func NewDropdownRows ¶
NewDropdownRows is NewDropdown over rich rows. A selected index on a header moves to the nearest selectable row after it (before it at the end).
func (*Dropdown) AccessibleName ¶
func (n *Dropdown) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Dropdown) AddClass ¶
func (n *Dropdown) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Dropdown) Arrange ¶
Arrange records the widget's rect. A rect that moved or resized from the previous frame also invalidates the old pixels, so partial damage does not leave the widget's old paint behind.
func (*Dropdown) AttachStylesheet ¶
func (n *Dropdown) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Dropdown) BindSelected ¶
BindSelected wires the binding two-way to the dropdown's selection index.
func (*Dropdown) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Dropdown) Classes ¶
func (n *Dropdown) Classes() []string
Classes returns a copy of the widget's classes.
func (*Dropdown) ClickAt ¶
ClickAt toggles the list; the Router invokes it when a press and release land on the face.
func (*Dropdown) Close ¶
func (d *Dropdown) Close()
Close closes the item list's popover; a closed dropdown ignores it.
func (*Dropdown) DebugName ¶
func (n *Dropdown) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Dropdown) DetachStylesheet ¶
func (n *Dropdown) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Dropdown) Direction ¶
Direction returns the base paragraph direction the labels resolve with.
func (*Dropdown) Element ¶
func (n *Dropdown) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Dropdown) Enabled ¶
func (n *Dropdown) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Dropdown) HAlign ¶
func (n *Dropdown) HAlign() Align
HAlign returns the horizontal placement.
func (*Dropdown) HasState ¶
func (n *Dropdown) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Dropdown) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Dropdown) HoverWithin ¶
func (n *Dropdown) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Dropdown) ID ¶
func (n *Dropdown) ID() string
ID returns the style id, empty when none is set.
func (*Dropdown) InlineStyle ¶
func (n *Dropdown) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Dropdown) InsertRune ¶
InsertRune implements RuneHandler: Space opens, the other half of the activation pair (Enter is the first). Every other printable rune feeds the type-ahead chain, which moves the selection.
func (*Dropdown) Invalidate ¶
func (n *Dropdown) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Dropdown) InvalidateLayout ¶
func (n *Dropdown) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Dropdown) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Dropdown) KeyAction ¶
KeyAction implements KeyActionHandler: Enter or Down opens. The open list holds the focus, so its keys reach it, not the face.
func (*Dropdown) LayoutMotion ¶
func (n *Dropdown) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Dropdown) MaximumSize ¶
func (n *Dropdown) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Dropdown) Measure ¶
Measure wants the widest item plus arrow and padding, and one row height; the closed face keeps its width whatever the selection, so a change never relayouts the surrounding tree. 80px is the width floor. It needs the label start, the icon slot, an ellipsis and the chevron, the selection ellipsizing into what is left.
func (*Dropdown) Open ¶
func (d *Dropdown) Open()
Open shows the item list in a popover beneath the face, at least as wide as the face and highlighted on the selection, with the keyboard focus in the list. A disabled dropdown and one with nothing to select stay closed.
func (*Dropdown) Paint ¶
Paint draws the face — surface, selection, chevron — in its pressed shade while the list is open. A disabled dropdown fills with the derived disabled surface and paints muted.
func (*Dropdown) Parent ¶
func (n *Dropdown) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Dropdown) RemoveAttr ¶
func (n *Dropdown) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Dropdown) RemoveClass ¶
func (n *Dropdown) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Dropdown) SetAccessibleName ¶
func (n *Dropdown) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Dropdown) SetAttr ¶
func (n *Dropdown) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Dropdown) SetClasses ¶
func (n *Dropdown) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Dropdown) SetCursorName ¶
func (n *Dropdown) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Dropdown) SetDebugName ¶
func (n *Dropdown) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Dropdown) SetDirection ¶
SetDirection selects the base paragraph direction the selection label resolves and lays out with. DirectionAuto (the default) reads it off the label's first strong character. Changing the direction invalidates.
func (*Dropdown) SetElement ¶
func (n *Dropdown) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Dropdown) SetEnabled ¶
SetEnabled turns the dropdown on or off, following the toolkit-wide node.SetEnabled convention (the flag lives on the embedded node; Enabled reads it). Disabling closes the list; a disabled dropdown ignores clicks and keys and paints muted.
func (*Dropdown) SetFocusOnClick ¶
func (n *Dropdown) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Dropdown) SetHAlign ¶
func (n *Dropdown) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Dropdown) SetHExpand ¶
func (n *Dropdown) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Dropdown) SetHovered ¶
SetHovered implements HoverSetter; the face's hover shade repaints.
func (*Dropdown) SetID ¶
func (n *Dropdown) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Dropdown) SetInlineStyle ¶
func (n *Dropdown) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Dropdown) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Dropdown) SetItems ¶
SetItems replaces the items (GTK's DropDown.set_model) and selects selected, clamped as the constructor clamps it. It fires no OnSelect: the caller is choosing what shows, not the user. An open list closes at once.
func (*Dropdown) SetLayoutMotion ¶
func (n *Dropdown) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Dropdown) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Dropdown) SetMaximumSize ¶
func (n *Dropdown) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Dropdown) SetOnClickWithin ¶
func (n *Dropdown) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Dropdown) SetOnFocusChanged ¶
func (n *Dropdown) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Dropdown) SetOnHoverWithin ¶
func (n *Dropdown) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Dropdown) SetOnPointer ¶
func (n *Dropdown) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Dropdown) SetOnScroll ¶
func (n *Dropdown) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Dropdown) SetRows ¶
func (d *Dropdown) SetRows(rows []DropdownRow, selected int)
SetRows is SetItems over rich rows.
func (*Dropdown) SetSelected ¶
SetSelected moves the selection to i (clamped) and fires OnSelect when the index changed.
func (*Dropdown) SetSharedElement ¶
func (n *Dropdown) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Dropdown) SetSizeRequest ¶
func (n *Dropdown) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Dropdown) SetState ¶
func (n *Dropdown) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Dropdown) SetTooltip ¶
func (n *Dropdown) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Dropdown) SetTooltipMarkup ¶
func (n *Dropdown) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Dropdown) SetVAlign ¶
func (n *Dropdown) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Dropdown) SetVExpand ¶
func (n *Dropdown) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Dropdown) SetVisible ¶
func (n *Dropdown) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Dropdown) SharedElement ¶
func (n *Dropdown) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Dropdown) SizeRequest ¶
func (n *Dropdown) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Dropdown) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Dropdown) TooltipText ¶
func (n *Dropdown) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type DropdownItem ¶
DropdownItem pairs a display label with the typed value picking it reports.
type DropdownOf ¶
type DropdownOf[T any] struct { *Dropdown // OnSelect fires exactly once per selection change with the new // row's index and value. It shadows the wrapped Dropdown's OnSelect // (a func(int)); set this one. OnSelect func(i int, value T) // contains filtered or unexported fields }
DropdownOf is a Dropdown whose rows carry typed values: the labels feed the visible list, and a change comes back with the value behind the picked row. It is a Dropdown in every other respect — embed it in a tree as-is.
func NewDropdownOf ¶
func NewDropdownOf[T any](face render.Font, sizePx float64, items []DropdownItem[T], selected int) *DropdownOf[T]
NewDropdownOf builds a typed dropdown from labeled values, painted with face at sizePx, showing the selected index clamped into range. Face may be a render.Chain for mixed-script fallback; a nil face panics here, naming the argument (see requireFace).
func (DropdownOf) AccessibleName ¶
func (n DropdownOf) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (DropdownOf) AddClass ¶
func (n DropdownOf) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (DropdownOf) Arrange ¶
Arrange records the widget's rect. A rect that moved or resized from the previous frame also invalidates the old pixels, so partial damage does not leave the widget's old paint behind.
func (DropdownOf) AttachStylesheet ¶
func (n DropdownOf) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (DropdownOf) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (DropdownOf) Classes ¶
func (n DropdownOf) Classes() []string
Classes returns a copy of the widget's classes.
func (DropdownOf) DebugName ¶
func (n DropdownOf) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (DropdownOf) DetachStylesheet ¶
func (n DropdownOf) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (DropdownOf) Element ¶
func (n DropdownOf) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (DropdownOf) Enabled ¶
func (n DropdownOf) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (DropdownOf) HAlign ¶
func (n DropdownOf) HAlign() Align
HAlign returns the horizontal placement.
func (DropdownOf) HasState ¶
func (n DropdownOf) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (DropdownOf) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (DropdownOf) HoverWithin ¶
func (n DropdownOf) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (DropdownOf) ID ¶
func (n DropdownOf) ID() string
ID returns the style id, empty when none is set.
func (DropdownOf) InlineStyle ¶
func (n DropdownOf) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (DropdownOf) Invalidate ¶
func (n DropdownOf) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (DropdownOf) InvalidateLayout ¶
func (n DropdownOf) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (DropdownOf) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (DropdownOf) LayoutMotion ¶
func (n DropdownOf) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (DropdownOf) MaximumSize ¶
func (n DropdownOf) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (DropdownOf) Parent ¶
func (n DropdownOf) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (DropdownOf) RemoveAttr ¶
func (n DropdownOf) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (DropdownOf) RemoveClass ¶
func (n DropdownOf) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (DropdownOf) SetAccessibleName ¶
func (n DropdownOf) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (DropdownOf) SetAttr ¶
func (n DropdownOf) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (DropdownOf) SetClasses ¶
func (n DropdownOf) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (DropdownOf) SetCursorName ¶
func (n DropdownOf) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (DropdownOf) SetDebugName ¶
func (n DropdownOf) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (DropdownOf) SetElement ¶
func (n DropdownOf) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (DropdownOf) SetFocusOnClick ¶
func (n DropdownOf) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (DropdownOf) SetHAlign ¶
func (n DropdownOf) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (DropdownOf) SetHExpand ¶
func (n DropdownOf) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (DropdownOf) SetID ¶
func (n DropdownOf) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (DropdownOf) SetInlineStyle ¶
func (n DropdownOf) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (DropdownOf) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (DropdownOf) SetLayoutMotion ¶
func (n DropdownOf) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (DropdownOf) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (DropdownOf) SetMaximumSize ¶
func (n DropdownOf) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (DropdownOf) SetOnClickWithin ¶
func (n DropdownOf) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (DropdownOf) SetOnFocusChanged ¶
func (n DropdownOf) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (DropdownOf) SetOnHoverWithin ¶
func (n DropdownOf) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (DropdownOf) SetOnPointer ¶
func (n DropdownOf) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (DropdownOf) SetOnScroll ¶
func (n DropdownOf) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (DropdownOf) SetSharedElement ¶
func (n DropdownOf) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (DropdownOf) SetSizeRequest ¶
func (n DropdownOf) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (DropdownOf) SetState ¶
func (n DropdownOf) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (DropdownOf) SetTooltip ¶
func (n DropdownOf) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (DropdownOf) SetTooltipMarkup ¶
func (n DropdownOf) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (DropdownOf) SetVAlign ¶
func (n DropdownOf) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (DropdownOf) SetVExpand ¶
func (n DropdownOf) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (DropdownOf) SetVisible ¶
func (n DropdownOf) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (DropdownOf) SharedElement ¶
func (n DropdownOf) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (DropdownOf) SizeRequest ¶
func (n DropdownOf) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (DropdownOf) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (DropdownOf) TooltipText ¶
func (n DropdownOf) TooltipText() string
TooltipText returns the hover text, empty when none is set.
func (DropdownOf) VAlign ¶
func (n DropdownOf) VAlign() Align
VAlign returns the vertical placement.
func (*DropdownOf[T]) Value ¶
func (d *DropdownOf[T]) Value() T
Value returns the picked row's value, the zero T when nothing is selected.
type DropdownRow ¶
DropdownRow is one row of a dropdown built with NewDropdownRows, GTK's DropDown with a row factory. Leading, when set, builds the row's leading widget, an icon or a ColorSwatch: it is called for the list row and for the face, so each owns its instance. A Header row is a group caption: listed, never selected, stepped onto, or matched by type-ahead.
type Dropper ¶
Dropper receives a drop: the accepted mime, its bytes, and the drop point in root coordinates.
type EditableLabel ¶
type EditableLabel struct {
*Entry
// OnChanged fires when an edit committed a different text.
OnChanged func(text string)
// contains filtered or unexported fields
}
EditableLabel is a label that edits in place (GTK EditableLabel): at rest it paints as plain text - the entry flat, read-only, caret hidden; a click or Enter starts editing with the text selected; Enter or losing focus commits, Escape reverts. It is the entry throughout, so editing inherits every Entry behavior (selection, undo, IME) and focus never has to move between two widgets.
func NewEditableLabel ¶
func NewEditableLabel(face render.Font, sizePx float64, color render.Color, s string) *EditableLabel
NewEditableLabel returns a resting label showing s.
func (EditableLabel) AccessibleName ¶
func (n EditableLabel) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (EditableLabel) AddClass ¶
func (n EditableLabel) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (EditableLabel) AttachStylesheet ¶
func (n EditableLabel) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (EditableLabel) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (EditableLabel) Classes ¶
func (n EditableLabel) Classes() []string
Classes returns a copy of the widget's classes.
func (*EditableLabel) ClickAt ¶
func (l *EditableLabel) ClickAt(p Point)
ClickAt starts editing at rest; while editing it places the caret.
func (*EditableLabel) CursorName ¶
func (l *EditableLabel) CursorName() string
CursorName is the text cursor only while editing; at rest the label keeps the node-level shape like any other widget.
func (EditableLabel) DebugName ¶
func (n EditableLabel) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (EditableLabel) DetachStylesheet ¶
func (n EditableLabel) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*EditableLabel) Editing ¶
func (l *EditableLabel) Editing() bool
Editing reports whether the label is in edit mode.
func (EditableLabel) Element ¶
func (n EditableLabel) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (EditableLabel) Enabled ¶
func (n EditableLabel) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (EditableLabel) HAlign ¶
func (n EditableLabel) HAlign() Align
HAlign returns the horizontal placement.
func (EditableLabel) HasState ¶
func (n EditableLabel) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (EditableLabel) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (EditableLabel) HoverWithin ¶
func (n EditableLabel) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (EditableLabel) ID ¶
func (n EditableLabel) ID() string
ID returns the style id, empty when none is set.
func (EditableLabel) InlineStyle ¶
func (n EditableLabel) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (EditableLabel) Invalidate ¶
func (n EditableLabel) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (EditableLabel) InvalidateLayout ¶
func (n EditableLabel) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (EditableLabel) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*EditableLabel) KeyAction ¶
func (l *EditableLabel) KeyAction(a KeyAction, mods Mods)
KeyAction starts editing on Enter at rest; while editing every key is the entry's.
func (EditableLabel) LayoutMotion ¶
func (n EditableLabel) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (EditableLabel) MaximumSize ¶
func (n EditableLabel) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (EditableLabel) Parent ¶
func (n EditableLabel) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (EditableLabel) RemoveAttr ¶
func (n EditableLabel) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (EditableLabel) RemoveClass ¶
func (n EditableLabel) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (EditableLabel) SetAccessibleName ¶
func (n EditableLabel) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (EditableLabel) SetAttr ¶
func (n EditableLabel) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (EditableLabel) SetClasses ¶
func (n EditableLabel) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (EditableLabel) SetCursorName ¶
func (n EditableLabel) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (EditableLabel) SetDebugName ¶
func (n EditableLabel) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (EditableLabel) SetElement ¶
func (n EditableLabel) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (EditableLabel) SetEnabled ¶
func (n EditableLabel) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (EditableLabel) SetFocusOnClick ¶
func (n EditableLabel) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (EditableLabel) SetHAlign ¶
func (n EditableLabel) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (EditableLabel) SetHExpand ¶
func (n EditableLabel) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (EditableLabel) SetID ¶
func (n EditableLabel) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (EditableLabel) SetInlineStyle ¶
func (n EditableLabel) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (EditableLabel) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (EditableLabel) SetLayoutMotion ¶
func (n EditableLabel) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (EditableLabel) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (EditableLabel) SetMaximumSize ¶
func (n EditableLabel) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (EditableLabel) SetOnClickWithin ¶
func (n EditableLabel) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (EditableLabel) SetOnFocusChanged ¶
func (n EditableLabel) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (EditableLabel) SetOnHoverWithin ¶
func (n EditableLabel) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (EditableLabel) SetOnPointer ¶
func (n EditableLabel) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (EditableLabel) SetOnScroll ¶
func (n EditableLabel) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (EditableLabel) SetSharedElement ¶
func (n EditableLabel) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (EditableLabel) SetSizeRequest ¶
func (n EditableLabel) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (EditableLabel) SetState ¶
func (n EditableLabel) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (EditableLabel) SetTooltip ¶
func (n EditableLabel) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (EditableLabel) SetTooltipMarkup ¶
func (n EditableLabel) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (EditableLabel) SetVAlign ¶
func (n EditableLabel) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (EditableLabel) SetVExpand ¶
func (n EditableLabel) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (EditableLabel) SetVisible ¶
func (n EditableLabel) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (EditableLabel) SharedElement ¶
func (n EditableLabel) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (EditableLabel) SizeRequest ¶
func (n EditableLabel) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*EditableLabel) StartEditing ¶
func (l *EditableLabel) StartEditing()
StartEditing enters edit mode with the whole text selected.
func (*EditableLabel) StopEditing ¶
func (l *EditableLabel) StopEditing(commit bool)
StopEditing leaves edit mode, keeping the edit when commit (firing OnChanged if the text differs) and restoring the old text otherwise.
func (EditableLabel) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (EditableLabel) TooltipText ¶
func (n EditableLabel) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type Elevation ¶
type Elevation struct {
// contains filtered or unexported fields
}
Elevation wraps a widget and paints the theme's box shadow around it — the widget-shaped half of the shared elevation helper, for floating cards whose content does not paint its own plate. WithPlate adds a rounded fill behind the child, so a bare content tree becomes a floating card: shadow, plate, content (the dialog's shape).
The wrapper claims exactly the child's rect: Measure and Arrange pass through untouched — the shadow lives outside the logical bounds — and HitTest resolves through the child alone, so a point in the gutter is never a hit.
func NewElevation ¶
NewElevation wraps child, rounding at the theme's corner radius.
func (*Elevation) AccessibleName ¶
func (n *Elevation) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Elevation) AddClass ¶
func (n *Elevation) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Elevation) Arrange ¶
Arrange records the rect, passes it to the child, and keeps the shadow ring's damage in step with the effective (stylesheet-aware) blur.
func (*Elevation) AttachStylesheet ¶
func (n *Elevation) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Elevation) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Elevation) Children ¶
Children exposes the child for the damage collector, focus traversal, and the accessibility walk.
func (*Elevation) Classes ¶
func (n *Elevation) Classes() []string
Classes returns a copy of the widget's classes.
func (*Elevation) DebugName ¶
func (n *Elevation) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Elevation) DetachStylesheet ¶
func (n *Elevation) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Elevation) Element ¶
func (n *Elevation) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Elevation) Enabled ¶
func (n *Elevation) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Elevation) HAlign ¶
func (n *Elevation) HAlign() Align
HAlign returns the horizontal placement.
func (*Elevation) HasState ¶
func (n *Elevation) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Elevation) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Elevation) HitTest ¶
HitTest resolves through the child alone: the shadow gutter is never a hit, so clicks just outside the card pass through.
func (*Elevation) HoverWithin ¶
func (n *Elevation) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Elevation) ID ¶
func (n *Elevation) ID() string
ID returns the style id, empty when none is set.
func (*Elevation) InlineStyle ¶
func (n *Elevation) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Elevation) Invalidate ¶
func (n *Elevation) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Elevation) InvalidateLayout ¶
func (n *Elevation) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Elevation) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Elevation) LayoutMotion ¶
func (n *Elevation) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Elevation) MaximumSize ¶
func (n *Elevation) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Elevation) Paint ¶
Paint draws shadow, optional plate and border, then the child. The stylesheet's box-shadow, background-color (the plate a bare content tree floats on), border and border-radius override the constructor and theme values — the dialog and popover cards style through this.
func (*Elevation) Parent ¶
func (n *Elevation) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Elevation) RemoveAttr ¶
func (n *Elevation) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Elevation) RemoveClass ¶
func (n *Elevation) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Elevation) SetAccessibleName ¶
func (n *Elevation) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Elevation) SetAttr ¶
func (n *Elevation) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Elevation) SetClasses ¶
func (n *Elevation) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Elevation) SetCursorName ¶
func (n *Elevation) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Elevation) SetDebugName ¶
func (n *Elevation) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Elevation) SetElement ¶
func (n *Elevation) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Elevation) SetEnabled ¶
SetEnabled turns the elevation's child on or off through the per-query enable walk, like Box.
func (*Elevation) SetFocusOnClick ¶
func (n *Elevation) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Elevation) SetHAlign ¶
func (n *Elevation) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Elevation) SetHExpand ¶
func (n *Elevation) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Elevation) SetID ¶
func (n *Elevation) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Elevation) SetInlineStyle ¶
func (n *Elevation) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Elevation) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Elevation) SetLayoutMotion ¶
func (n *Elevation) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Elevation) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Elevation) SetMaximumSize ¶
func (n *Elevation) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Elevation) SetOnClickWithin ¶
func (n *Elevation) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Elevation) SetOnFocusChanged ¶
func (n *Elevation) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Elevation) SetOnHoverWithin ¶
func (n *Elevation) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Elevation) SetOnPointer ¶
func (n *Elevation) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Elevation) SetOnScroll ¶
func (n *Elevation) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Elevation) SetSharedElement ¶
func (n *Elevation) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Elevation) SetSizeRequest ¶
func (n *Elevation) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Elevation) SetState ¶
func (n *Elevation) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Elevation) SetTooltip ¶
func (n *Elevation) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Elevation) SetTooltipMarkup ¶
func (n *Elevation) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Elevation) SetVAlign ¶
func (n *Elevation) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Elevation) SetVExpand ¶
func (n *Elevation) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Elevation) SetVisible ¶
func (n *Elevation) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Elevation) SharedElement ¶
func (n *Elevation) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Elevation) SizeRequest ¶
func (n *Elevation) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Elevation) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Elevation) TooltipText ¶
func (n *Elevation) TooltipText() string
TooltipText returns the hover text, empty when none is set.
func (*Elevation) VAlign ¶
func (n *Elevation) VAlign() Align
VAlign returns the vertical placement.
func (*Elevation) Visible ¶
func (n *Elevation) Visible() bool
Visible reports the widget's own visibility flag, not the effective state: a widget inside an invisible container still reads true. Layout, Paint, and HitTest paths consult widget.IsVisible, which folds the ancestors in.
func (*Elevation) WithPlate ¶
WithPlate sets a rounded fill painted between the shadow and the child; zero (the default) paints no plate.
func (*Elevation) WithRadius ¶
WithRadius sets the corner radius the shadow and plate round at.
type EllipsizeMode ¶
type EllipsizeMode = render.EllipsizeMode
EllipsizeMode names where an overflowing label truncates. It is render.EllipsizeMode; the alias lets label call sites read against the widget package.
type Entry ¶
type Entry struct {
// OnChanged fires after the contents change, whatever the
// source: typing, editing keys, clipboard, or SetText.
OnChanged func(string)
// OnActivate fires with the contents when the user presses Enter
// in the entry (GTK's activate): submit a password, run a search,
// move to the next field. A disabled entry never activates.
OnActivate func(string)
// Completion, when set, offers matches for the current text as an
// inline list below the field (#92): arrows move the highlight,
// Enter picks, Esc closes, a click picks. OnComplete fires with the
// picked match after OnChanged delivered the new text.
Completion func(prefix string) []string
OnComplete func(chosen string)
// OnEscape, when set, fires on Esc while no completion list is
// open; returning true consumes the key. SearchEntry clears the
// field with it.
OnEscape func() bool
// MaxWidth caps the natural width Measure reports: a long paste
// stops growing the layout at the cap and pans inside it instead —
// the text widgets' counterpart of Scroll's bounded natural size.
// Zero (the default) reports the content-hugging width. Set it
// before the first Measure, or follow with InvalidateLayout.
MaxWidth int
// contains filtered or unexported fields
}
Entry is a single-line text field. Its editing state machine (insert, delete, cursor motion) is input-agnostic: keyboard input in M4 calls these methods.
Example ¶
package main
import (
"fmt"
"log"
"github.com/stubbedev/lys-lib/render"
"golang.org/x/image/font/gofont/goregular"
"github.com/stubbedev/lys-ui/widget"
)
func face() *render.Typeface {
tf, err := render.LoadFont(goregular.TTF)
if err != nil {
log.Fatal(err)
}
return tf
}
func main() {
// An entry is an editing state machine: callbacks see every
// change, whatever produced it (typing, editing keys, clipboard,
// SetText).
name := widget.NewEntry(face(), 14, widget.Current().Text)
name.SetPlaceholder("who goes there?")
name.OnChanged = func(s string) { fmt.Println("changed:", s) }
name.InsertRune('h')
name.InsertRune('i')
fmt.Println("text:", name.Text())
}
Output: changed: h changed: hi text: hi
func NewEntry ¶
NewEntry returns an empty entry painted with face at sizePx. Face may be a render.Chain for mixed-script fallback. A nil face panics here (see requireFace) instead of failing later, in shaping.
func (*Entry) AccessibleName ¶
func (n *Entry) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Entry) AddClass ¶
func (n *Entry) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Entry) Arrange ¶
Arrange pins the field's rect and re-pans: a resize changes the visible width, so the caret may need pulling back into view. The resize itself already scheduled the layout damage. r is the margin box; Bounds records the field inside the stylesheet's margin.
func (*Entry) AttachStylesheet ¶
func (n *Entry) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Entry) Backspace ¶
func (e *Entry) Backspace()
Backspace deletes the selection, or the grapheme cluster before the cursor when nothing is selected — an emoji family, a flag, a base rune with its combining marks go as one whole (#57); one undo entry per call. Blocked while disabled or read-only.
func (*Entry) Baseline ¶
Baseline implements Baseliner: the text line inside the field's insets, under the margin.
func (*Entry) BindText ¶
BindText wires the binding two-way to the entry's text: changes write through, edits write back. Entry.OnChanged fires for every source, so the write-back of the binding's own value is the equal no-op that ends the loop.
func (*Entry) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Entry) CharExtents ¶
CharExtents implements TextGeometry.
func (*Entry) Classes ¶
func (n *Entry) Classes() []string
Classes returns a copy of the widget's classes.
func (*Entry) ClickAt ¶
ClickAt places the cursor (and the selection anchor) at the clicked text position, dropping the composing display. The mapping runs through the display shape's caret table — which follows the line visually — and the pan, so a click on a half-visible rune lands on that rune, snapped to the start of its grapheme cluster (#57). Masked modes keep the cursor a logical index. A press over the trailing icon goes to the icon's handler instead.
func (*Entry) Composing ¶
Composing reports whether composing (input-method preedit) text is on show.
func (*Entry) Cursor ¶
Cursor returns the cursor position as a rune index — the internal position representation stays rune-based (#57); cluster segmentation (internal/text) maps the editing steps, which move one grapheme cluster at a time, onto those indexes. Every position the widget itself produces is a cluster boundary.
func (*Entry) CursorName ¶
CursorName reports the text caret shape while hovered.
func (*Entry) DebugName ¶
func (n *Entry) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Entry) Delete ¶
func (e *Entry) Delete()
Delete deletes the selection, or the grapheme cluster at the cursor when nothing is selected (#57); one undo entry per call. This is the cut half of ctrl+x; blocked while disabled or read-only.
func (*Entry) DeleteWordBackward ¶
func (e *Entry) DeleteWordBackward()
DeleteWordBackward removes the word before the cursor — ctrl+ backspace, with alt+backspace as the macOS alias — or the selection when one is active; the whole word is one undo entry. Blocked while disabled or read-only.
func (*Entry) DeleteWordForward ¶
func (e *Entry) DeleteWordForward()
DeleteWordForward removes the word after the cursor — ctrl+delete — or the selection when one is active; the whole word is one undo entry. Blocked while disabled or read-only.
func (*Entry) DetachStylesheet ¶
func (n *Entry) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Entry) DoubleClickAt ¶
DoubleClickAt selects the run of same-class runes (word or whitespace) under the clicked position, over the shared word segmentation — the same words the ctrl+arrows steps land on. user-select: none keeps the click a caret placement.
func (*Entry) DragMove ¶
DragMove extends the selection while the pointer drags; the anchor stays where the press landed. A motion past either edge auto-pans one step so the drag can reach text outside the viewport. Drag edges snap to cluster starts like ClickAt. user-select: none keeps the drag a pure caret move: the anchor follows the cursor.
func (*Entry) EchoReveal ¶
EchoReveal shows the real contents regardless of the echo mode while on. The reveal toggle is the app's job — a peek button, a hold-to-reveal key — and the entry only renders what it is told.
func (*Entry) Element ¶
func (n *Entry) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Entry) Ellipsize ¶
func (e *Entry) Ellipsize() EllipsizeMode
Ellipsize returns the unfocused truncation mode.
func (*Entry) Enabled ¶
func (n *Entry) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Entry) HasState ¶
func (n *Entry) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Entry) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Entry) HitTest ¶
HitTest returns the entry when p is inside its bounds - the field or, while open, the completion list hanging under it.
func (*Entry) HoverWithin ¶
func (n *Entry) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Entry) IMECommit ¶
IMECommit implements IMEClient; the insertion inside is what actually honors the disabled and read-only gates.
func (*Entry) IMECursorRect ¶
IMECursorRect implements IMETracker: the caret band in root coordinates, for the input method's candidate window. Pan-aware, so the window tracks the caret inside a panning field, on either direction's reading edge.
func (*Entry) IMEDelete ¶
IMEDelete implements IMEClient: input-method deletion of up to before bytes before and after bytes after the caret. Blocked while disabled or read-only.
func (*Entry) IMEMultiline ¶
IMEMultiline implements IMETracker.
func (*Entry) IMEPreedit ¶
IMEPreedit implements IMEClient. A disabled or read-only entry never enters composing: the input method is told nothing back, so it stops sending preedit after the first empty commit.
func (*Entry) IMERevision ¶ added in v0.2.5
func (e *Entry) IMERevision() IMERevision
IMERevision implements IMETracker.
func (*Entry) IMESurrounding ¶
IMESurrounding implements IMETracker.
func (*Entry) InlineStyle ¶
func (n *Entry) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Entry) Insert ¶
Insert inserts s at the cursor. An active selection is replaced, and the whole insertion — a paste, a drop, a committed composition — is one undo entry. Blocked while disabled or read-only.
func (*Entry) InsertRune ¶
InsertRune implements RuneHandler. Typed runes coalesce into one undo entry until a word boundary, an idle gap, or a different edit breaks the run. Blocked while disabled or read-only.
func (*Entry) Invalidate ¶
func (n *Entry) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Entry) InvalidateLayout ¶
func (n *Entry) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Entry) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Entry) KeyAction ¶
KeyAction implements KeyActionHandler for editing keys. Shift-extended motion grows the selection from its anchor; ctrl turns arrows and backspace/delete word-wise, alt+backspace aliasing ctrl+backspace. The bare keys edit one grapheme cluster per press (#57), so emoji and accented pairs edit whole. Interaction order: while composing, the input method owns the text and the bare backspace unwinds the composing display one rune first — that is compose state (#54), orthogonal to committed text; after it, ctrl/alt make backspace and delete word-wise over the cluster-refined words (#56); the bare keys apply to the contents one cluster at a time. A disabled entry ignores keys outright; a read-only one keeps the motion and selection keys and drops only the mutating ones.
func (*Entry) LayoutMotion ¶
func (n *Entry) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Entry) LeadingIcon ¶
LeadingIcon returns the entry's leading icon, nil when unset.
func (*Entry) MaximumSize ¶
func (n *Entry) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Entry) Measure ¶
Measure wants the text advance (or the placeholder's) plus padding; an empty field keeps its padding so the box stays visible. Composing text counts toward the wanted width. SetTextWidth fixes the text's share instead. MaxWidth caps the wanted width — a 500-character paste then stops widening the layout at the cap and pans inside it instead. The field needs only its insets and the width-chars floor (GtkText's minimum without width-chars is no text at all), the text panning inside what it gets. The stylesheet's min-* floors hold on both, and its margin sits outside the field, as in every CSS box. The open completion list claims height below the field.
func (*Entry) MoveCursor ¶
MoveCursor moves the cursor by delta grapheme clusters, clamped to [0, len] (#57: one emoji, one step). An active selection collapses to the edge the motion points at first, without moving further - the standard first-press behavior.
func (*Entry) MoveCursorExtending ¶
MoveCursorExtending moves the cursor by delta grapheme clusters, growing or shrinking the selection from its anchor (shift+arrow behavior); selection edges land on cluster boundaries.
func (*Entry) MoveEnd ¶
func (e *Entry) MoveEnd()
MoveEnd puts the cursor after the last rune, dropping any selection, and pans the field so the tail is on show.
func (*Entry) MoveHome ¶
func (e *Entry) MoveHome()
MoveHome puts the cursor at the start, dropping any selection; the pan follows, back to zero.
func (*Entry) MoveWord ¶
MoveWord moves the cursor one visual word: the word edge the direction points at, gaps (whitespace, punctuation runs) skipped whole. An active selection collapses to the visually-directed edge first, without moving.
func (*Entry) MoveWordExtending ¶
MoveWordExtending is MoveWord with shift held: the selection extends from its anchor to the word edge.
func (*Entry) Paint ¶
Paint draws the field: placeholder when empty, text otherwise, the selection highlight, the composing text with its underline, and the cursor bar. Overflowing text pans: the content draws at -scrollX, clipped to the inner rect, so the caret never leaves the field. The placeholder only shows on an empty field and never pans. Zero color fields fall back to the theme.
State colors: a disabled field fills with the derived disabled surface and paints text at the shared disabled fade; a read-only field keeps the normal text and fades only the caret, so the two states read differently at a glance (muted text vs muted caret). The stylesheet layers between the programmatic color and the theme, and border-width rounds the fill down inside a border-color stroke.
func (*Entry) Parent ¶
func (n *Entry) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Entry) Placeholder ¶
Placeholder returns the text shown when the entry is empty.
func (*Entry) Redo ¶
Redo reapplies the most recently undone edit, reporting whether there was one. Like Undo it is a user edit and no-ops while disabled or read-only.
func (*Entry) RemoveAttr ¶
func (n *Entry) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Entry) RemoveClass ¶
func (n *Entry) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Entry) ScrollX ¶
ScrollX returns the horizontal pan: the display-space x of the first on-show pixel.
func (*Entry) SelectAll ¶
func (e *Entry) SelectAll()
SelectAll selects the entire contents; the pan follows the caret to the end.
func (*Entry) SelectedText ¶
SelectedText implements SelectedTexter.
func (*Entry) Selection ¶
Selection returns the selected rune range and whether a non-empty selection exists.
func (*Entry) SetAccessibleName ¶
func (n *Entry) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Entry) SetAttr ¶
func (n *Entry) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Entry) SetClasses ¶
func (n *Entry) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Entry) SetColor ¶
SetColor sets the programmatic text ink; zero hands the color back to the stylesheet (the text node's, else the entry's color), as a Label's does. A preset built on Entry (SearchEntry) starts from the theme's text ink, so a styled application clears it here.
func (*Entry) SetCursorName ¶
func (n *Entry) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Entry) SetDebugName ¶
func (n *Entry) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Entry) SetDirection ¶
SetDirection selects the base paragraph direction the contents resolve and lay out with. DirectionAuto (the default) reads it off the text's first strong character; DirectionRTL additionally hugs short text against the right edge, where its reading starts, and mirrors the pan. Arrow and word motion always move visually - the mapping runs through the same resolution (internal/text) the paint uses - while cursor, anchor, and selection stay logical rune indexes. Changing the direction re-pans and invalidates.
func (*Entry) SetEcho ¶
SetEcho sets the display mode. Contents and caret/selection math stay logical whatever the mode.
func (*Entry) SetElement ¶
func (n *Entry) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Entry) SetEllipsize ¶
func (e *Entry) SetEllipsize(mode EllipsizeMode)
SetEllipsize truncates the shown text where mode says, as a Label does, while the field is unfocused and too short for it: a path field reads "/home/me/…/file" at rest and shows its full text to edit once focused. The text itself, the selection and the caret are untouched. EllipsizeNone, the default, always shows the text panned.
func (*Entry) SetEnabled ¶
func (n *Entry) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Entry) SetFocusOnClick ¶
func (n *Entry) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Entry) SetHAlign ¶
func (n *Entry) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Entry) SetHExpand ¶
func (n *Entry) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Entry) SetID ¶
func (n *Entry) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Entry) SetInlineStyle ¶
func (n *Entry) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Entry) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Entry) SetLayoutMotion ¶
func (n *Entry) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Entry) SetLeadingIcon ¶
SetLeadingIcon shows a themed icon at the entry's start — GtkEntry's primary icon, cascade-painted like the secondary one; onClick fires on a press over it, nil keeps it display-only. An empty name clears it.
func (*Entry) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Entry) SetMaximumSize ¶
func (n *Entry) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Entry) SetOnClickWithin ¶
func (n *Entry) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Entry) SetOnFocusChanged ¶
func (n *Entry) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Entry) SetOnHoverWithin ¶
func (n *Entry) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Entry) SetOnPointer ¶
func (n *Entry) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Entry) SetOnScroll ¶
func (n *Entry) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Entry) SetPlaceholder ¶
SetPlaceholder sets the text shown when the entry is empty.
func (*Entry) SetReadOnly ¶
SetReadOnly toggles the read-only mode for copy-only fields (a generated API key, a resolved config value). The contract:
- blocked: typing, paste, drop, composition, Backspace/Delete (cut), Undo/Redo, and — because they are user edits — new undo entries. A history built before SetReadOnly(true) is untouched, not cleared: flipping read-only back off resumes backing out the very same edits.
- still working: selection (click, drag, double-click, SelectAll), copy through SelectedText, caret motion, and pan.
- visual: the text keeps its normal color; only the caret fades to the disabled fade. A disabled entry is the mirror image — muted text — so the two states never look alike.
SetText remains programmatic and applies regardless.
func (*Entry) SetSharedElement ¶
func (n *Entry) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Entry) SetSizeRequest ¶
func (n *Entry) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Entry) SetState ¶
func (n *Entry) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Entry) SetText ¶
SetText replaces the contents, moves the cursor to the end, and invalidates the field.
func (*Entry) SetTextWidth ¶
SetTextWidth fixes the text area's natural width at px, padding aside, the way GtkEntry sizes a field: what is typed pans inside it instead of resizing the layout, and an empty field keeps its width. Zero (the default) hugs the content.
func (*Entry) SetTooltip ¶
func (n *Entry) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Entry) SetTooltipMarkup ¶
func (n *Entry) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Entry) SetTrailingIcon ¶
SetTrailingIcon shows a themed icon at the entry's end — the entry > image node, GtkEntry's secondary icon: a password field's peek toggle, a search's clear button. The icon paints from the cascade like any image (entry.network-password-input > image colors the peek); onClick fires on a press over it, and nil keeps it display-only. An empty name clears it.
func (*Entry) SetVAlign ¶
func (n *Entry) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Entry) SetVExpand ¶
func (n *Entry) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Entry) SetVisible ¶
func (n *Entry) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Entry) SetWidthChars ¶
SetWidthChars sizes the field in characters, GtkEntry's width-chars and max-width-chars: the text never narrows below minChars, and naturally takes maxChars (GTKTextWidth while maxChars is 0), at least minChars. Both 0 restores SetTextWidth's sizing.
func (*Entry) SharedElement ¶
func (n *Entry) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Entry) SizeRequest ¶
func (n *Entry) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Entry) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Entry) TooltipText ¶
func (n *Entry) TooltipText() string
TooltipText returns the hover text, empty when none is set.
func (*Entry) TrailingIcon ¶
TrailingIcon returns the entry's trailing icon, nil when unset.
func (*Entry) Undo ¶
Undo restores the state before the most recent edit — contents, caret, and selection included — reporting whether there was anything to undo. Composing text drops first, like before any other edit. Undo is a user edit: disabled or read-only, it no-ops and returns false while the history waits untouched.
func (*Entry) Visible ¶
func (n *Entry) Visible() bool
Visible reports the widget's own visibility flag, not the effective state: a widget inside an invisible container still reads true. Layout, Paint, and HitTest paths consult widget.IsVisible, which folds the ancestors in.
func (*Entry) WidthChars ¶
WidthChars reports SetWidthChars.
type EntryRow ¶
type EntryRow struct {
*ActionRow
// contains filtered or unexported fields
}
EntryRow is the adw signature: the entry IS the row - title label to the leading side, the free-text field filling the rest.
func NewEntryRow ¶
NewEntryRow returns the row with the field's text starting at initial.
func (EntryRow) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (EntryRow) Children ¶
func (c EntryRow) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (EntryRow) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (EntryRow) PackStart ¶
func (p EntryRow) PackStart(w Widget)
PackStart adds w to the leading slot.
type Expander ¶
type Expander struct {
// OnToggled fires after every open-state change, including
// programmatic ones.
OnToggled func(open bool)
// contains filtered or unexported fields
}
Expander is a collapsible section: a header row (the title, and a chevron at the end turning from down to up) toggles the child beneath it. Toggling animates the height over the animation clock, with the chevron turning on the same progress, and the open state is remembered — a collapsed expander reopens to where it was, and state survives being hidden by a parent. Children exposes the child only while open, so focus traversal never lands inside a closed section.
func NewExpander ¶
NewExpander returns a collapsed section titled title wrapping child, painted with face at the theme's text size. Face may be a render.Chain for mixed-script fallback. A nil face panics here (see requireFace) instead of failing later, in shaping.
func (*Expander) AccessibleName ¶
func (n *Expander) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Expander) AddClass ¶
func (n *Expander) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Expander) Arrange ¶
Arrange records the rect, positions the child under the header at the animated height, and stops the reveal cold when the expander went off screen (a hidden widget holds no timer; the state keeps whatever it reached).
func (*Expander) AttachStylesheet ¶
func (n *Expander) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Expander) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Expander) Children ¶
Children exposes the child only while open, so keyboard traversal and tree walks skip a closed section's content.
func (*Expander) Classes ¶
func (n *Expander) Classes() []string
Classes returns a copy of the widget's classes.
func (*Expander) DebugName ¶
func (n *Expander) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Expander) DetachStylesheet ¶
func (n *Expander) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Expander) Element ¶
func (n *Expander) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Expander) Enabled ¶
func (n *Expander) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Expander) HAlign ¶
func (n *Expander) HAlign() Align
HAlign returns the horizontal placement.
func (*Expander) HasState ¶
func (n *Expander) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Expander) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Expander) HitTest ¶
HitTest resolves the header into the expander (clicks toggle) and otherwise delegates to the revealed child.
func (*Expander) HoverWithin ¶
func (n *Expander) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Expander) ID ¶
func (n *Expander) ID() string
ID returns the style id, empty when none is set.
func (*Expander) InlineStyle ¶
func (n *Expander) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Expander) InsertRune ¶
InsertRune implements RuneHandler: Space toggles, the other half of the GTK activation pair.
func (*Expander) Invalidate ¶
func (n *Expander) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Expander) InvalidateLayout ¶
func (n *Expander) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Expander) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Expander) KeyAction ¶
KeyAction implements KeyActionHandler: Enter toggles when focused, which makes the section reachable and operable by keyboard only.
func (*Expander) LayoutMotion ¶
func (n *Expander) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Expander) MaximumSize ¶
func (n *Expander) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Expander) Open ¶
Open reports the toggle state (the settled layout, not the animated progress).
func (*Expander) Paint ¶
Paint draws the header — hover shade, title, chevron at the reveal angle — then the child, clipped to the revealed strip.
func (*Expander) Parent ¶
func (n *Expander) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Expander) RemoveAttr ¶
func (n *Expander) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Expander) RemoveClass ¶
func (n *Expander) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Expander) SetAccessibleName ¶
func (n *Expander) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Expander) SetAttr ¶
func (n *Expander) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Expander) SetClasses ¶
func (n *Expander) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Expander) SetCursorName ¶
func (n *Expander) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Expander) SetDebugName ¶
func (n *Expander) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Expander) SetElement ¶
func (n *Expander) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Expander) SetEnabled ¶
SetEnabled turns the expander and its content on or off through the per-query enable walk, like Box.
func (*Expander) SetFocusOnClick ¶
func (n *Expander) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Expander) SetHAlign ¶
func (n *Expander) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Expander) SetHExpand ¶
func (n *Expander) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Expander) SetHovered ¶
SetHovered implements HoverSetter; the header shade repaints.
func (*Expander) SetID ¶
func (n *Expander) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Expander) SetInlineStyle ¶
func (n *Expander) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Expander) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Expander) SetLayoutMotion ¶
func (n *Expander) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Expander) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Expander) SetMaximumSize ¶
func (n *Expander) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Expander) SetOnClickWithin ¶
func (n *Expander) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Expander) SetOnFocusChanged ¶
func (n *Expander) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Expander) SetOnHoverWithin ¶
func (n *Expander) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Expander) SetOnPointer ¶
func (n *Expander) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Expander) SetOnScroll ¶
func (n *Expander) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Expander) SetOpen ¶
SetOpen opens or closes the section, animating the height. Fires OnToggled when the state flipped.
func (*Expander) SetSharedElement ¶
func (n *Expander) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Expander) SetSizeRequest ¶
func (n *Expander) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Expander) SetState ¶
func (n *Expander) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Expander) SetTooltip ¶
func (n *Expander) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Expander) SetTooltipMarkup ¶
func (n *Expander) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Expander) SetVAlign ¶
func (n *Expander) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Expander) SetVExpand ¶
func (n *Expander) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Expander) SetVisible ¶
func (n *Expander) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Expander) SharedElement ¶
func (n *Expander) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Expander) SizeRequest ¶
func (n *Expander) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Expander) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Expander) TooltipText ¶
func (n *Expander) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type ExpanderRow ¶
type ExpanderRow struct {
*ActionRow
// contains filtered or unexported fields
}
ExpanderRow is an ActionRow whose activation discloses sub-rows: any widget (more rows, a group) inside the row's own disclosure, with the chevron's direction tracking it.
func NewExpanderRow ¶
func NewExpanderRow(face render.Font, sizePx float64, title, subtitle string) *ExpanderRow
NewExpanderRow returns a collapsed expander; Add appends into its content.
func (*ExpanderRow) Add ¶
func (r *ExpanderRow) Add(w Widget)
Add appends a sub-row (or any widget) to the disclosed content.
func (ExpanderRow) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (ExpanderRow) Children ¶
func (c ExpanderRow) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*ExpanderRow) Expanded ¶
func (r *ExpanderRow) Expanded() bool
Expanded reports the disclosure state.
func (ExpanderRow) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
type Fader ¶
type Fader struct {
Opacity
// contains filtered or unexported fields
}
Fader modulates one child's whole subtree: every color the child and its descendants paint is scaled by the fader's opacity — fills, borders, text, and image blits alike — without threading an alpha through their colors. It is the one-off shape of Opacity: wrap a child, tween SetOpacity from the animation clock (anim.Animate(dur, f.SetOpacity)), and discard it with the subtree.
Layout is a pass-through — the fader claims and paints exactly the child's rect — so its invalidation covers everything the fade changes. The subtree still hit-tests at zero opacity: the factor is visual, and a mid-fade menu must keep taking clicks.
func (*Fader) AccessibleName ¶
func (n *Fader) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Fader) AddClass ¶
func (n *Fader) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Fader) ArrangeRoot ¶
ArrangeRoot records the fader's own rect.
func (*Fader) AttachStylesheet ¶
func (n *Fader) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Fader) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Fader) Children ¶
Children exposes the child for the damage collector, focus traversal, and the accessibility walk.
func (*Fader) Classes ¶
func (n *Fader) Classes() []string
Classes returns a copy of the widget's classes.
func (*Fader) DebugName ¶
func (n *Fader) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Fader) DetachStylesheet ¶
func (n *Fader) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Fader) Element ¶
func (n *Fader) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Fader) Enabled ¶
func (n *Fader) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Fader) HasState ¶
func (n *Fader) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Fader) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Fader) HitTest ¶
HitTest returns the deepest widget under p: the child's pick, or the fader itself over its own padding-less bounds — opacity never empties the hit region.
func (*Fader) HoverWithin ¶
func (n *Fader) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Fader) InlineStyle ¶
func (n *Fader) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Fader) Invalidate ¶
func (n *Fader) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Fader) InvalidateLayout ¶
func (n *Fader) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Fader) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Fader) LayoutMotion ¶
func (n *Fader) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Fader) MaximumSize ¶
func (n *Fader) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Fader) Paint ¶
Paint paints the child under the fader's opacity; see Opacity.paintChild for the zero/one fast paths.
func (*Fader) Parent ¶
func (n *Fader) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Fader) RemoveAttr ¶
func (n *Fader) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Fader) RemoveClass ¶
func (n *Fader) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Fader) SetAccessibleName ¶
func (n *Fader) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Fader) SetAttr ¶
func (n *Fader) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Fader) SetClasses ¶
func (n *Fader) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Fader) SetCursorName ¶
func (n *Fader) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Fader) SetDebugName ¶
func (n *Fader) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Fader) SetElement ¶
func (n *Fader) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Fader) SetEnabled ¶
SetEnabled turns the fader's child on or off through the per-query enable walk, like Box.
func (*Fader) SetFocusOnClick ¶
func (n *Fader) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Fader) SetHAlign ¶
func (n *Fader) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Fader) SetHExpand ¶
func (n *Fader) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Fader) SetID ¶
func (n *Fader) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Fader) SetInlineStyle ¶
func (n *Fader) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Fader) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Fader) SetLayoutMotion ¶
func (n *Fader) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Fader) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Fader) SetMaximumSize ¶
func (n *Fader) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Fader) SetOnClickWithin ¶
func (n *Fader) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Fader) SetOnFocusChanged ¶
func (n *Fader) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Fader) SetOnHoverWithin ¶
func (n *Fader) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Fader) SetOnPointer ¶
func (n *Fader) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Fader) SetOnScroll ¶
func (n *Fader) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Fader) SetSharedElement ¶
func (n *Fader) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Fader) SetSizeRequest ¶
func (n *Fader) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Fader) SetState ¶
func (n *Fader) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Fader) SetTooltip ¶
func (n *Fader) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Fader) SetTooltipMarkup ¶
func (n *Fader) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Fader) SetVAlign ¶
func (n *Fader) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Fader) SetVExpand ¶
func (n *Fader) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Fader) SetVisible ¶
func (n *Fader) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Fader) SharedElement ¶
func (n *Fader) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Fader) SizeRequest ¶
func (n *Fader) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Fader) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Fader) TooltipText ¶
func (n *Fader) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
Field is a labeled form control: a label, the control, an optional description and an error message, which turns the field invalid - the control takes the .error class and the label the destructive color. The label also names the control for assistive technology unless it was named already. It styles as the `field` element (.invalid while it shows an error) with .title, .description and .error labels.
func (*Field) Arrange ¶
Arrange evaluates the responsive breakpoint against the width, then lays the parts out.
func (*Field) Children ¶
func (c *Field) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Field) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*Field) Orientation ¶
func (f *Field) Orientation() FieldOrientation
Orientation returns the layout.
func (*Field) SetDescription ¶
SetDescription sets the help text under the label; empty hides it.
func (*Field) SetOrientation ¶
func (f *Field) SetOrientation(o FieldOrientation)
SetOrientation switches the layout.
type FieldOrientation ¶
type FieldOrientation uint8
FieldOrientation is how a Field lays its label out against its control.
const ( // FieldVertical stacks the label, the control, the description and // the error. FieldVertical FieldOrientation = iota // FieldHorizontal puts the label, description and error beside the // control: a switch or a checkbox with its text. FieldHorizontal // FieldResponsive is horizontal from fieldResponsiveMin wide, and // vertical below. FieldResponsive )
The field orientations.
type FieldSet ¶
type FieldSet struct {
// contains filtered or unexported fields
}
FieldSet groups related fields under a legend: the legend, an optional description, and the fields. It styles as the `fieldset` element with a .legend label.
func NewFieldSet ¶
NewFieldSet returns an empty set under legend.
func (*FieldSet) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*FieldSet) Children ¶
func (c *FieldSet) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*FieldSet) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*FieldSet) SetDescription ¶
SetDescription sets the text under the legend; empty hides it.
type FileChooser ¶
type FileChooser struct {
// OnApply, when set, receives every validated apply: the chosen
// absolute paths (one in save and single-open mode, the selection
// in multiple mode, a directory in folder mode).
OnApply func(paths []string)
// contains filtered or unexported fields
}
FileChooser is the pure-Go file picker behind app.OpenFileDialog and app.SaveFileDialog (#82): a places row, the current directory's listing, filters, a name row in save mode, and Apply validation. It is the whole picker lys-ui needs - List, Entry, Dropdown, and Button are the parts - so it works on any compositor with no portal in sight; the directory listing comes from an injected source, the seam tests and any future portal backend plug into.
Navigation: Up climbs one directory, the place buttons jump home, to the filesystem root, or into the recents view, and activating a row enters a directory or applies a file. Apply validates: an empty selection, an empty name, or a name carrying a path separator sets the status line and applies nothing.
Listing a directory waits on the disk, so it runs off the loop: the view clears at once and fills when the answer comes, and an answer to a view left since is dropped. Without an invoker (no loop to answer on, the state before an Application exists) it runs inline.
func NewFileChooser ¶
func NewFileChooser(face render.Font, sizePx float64, mode FileMode, startDir string, filters []FileFilter) *FileChooser
NewFileChooser returns a chooser in mode starting at startDir (the home directory when empty), filtered by filters (a nil or empty list accepts everything; more than one shows a dropdown).
func (*FileChooser) Apply ¶
func (c *FileChooser) Apply() ([]string, bool)
Apply validates and applies the current selection: in open modes the selected files, in folder mode the selected or current directory, in save mode the name row joined onto the directory. It returns the absolute paths and reports whether the apply was valid; an invalid apply sets the status line instead.
func (*FileChooser) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*FileChooser) Children ¶
func (c *FileChooser) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*FileChooser) Dir ¶
func (c *FileChooser) Dir() string
Dir reports the directory being browsed ("" in the recents view).
func (*FileChooser) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*FileChooser) SetRecentsSource ¶
func (c *FileChooser) SetRecentsSource(paths func() []string)
SetRecentsSource wires the recents view: paths lists the recent files (most recent first) and the Recent place appears; without it the picker is a plain browser. Like a DirSource, paths runs off the loop goroutine and must touch no widget.
func (*FileChooser) SetSaveName ¶
func (c *FileChooser) SetSaveName(name string)
SetSaveName pre-fills the save name row (save mode only).
func (*FileChooser) SetSource ¶
func (c *FileChooser) SetSource(src DirSource)
SetSource replaces the directory listing source (tests, portals).
func (*FileChooser) SetStatus ¶
func (c *FileChooser) SetStatus(text string)
SetStatus shows or clears the status line.
type FileFilter ¶
FileFilter names one set of acceptable files: Patterns are shell globs matched against the base name, case-insensitively ("*.png", "Makefile"). Directories always pass; an empty pattern list accepts every file.
type FileMode ¶
type FileMode uint8
FileMode is what a FileChooser is picking.
const ( // FileModeOpen picks one existing file. FileModeOpen FileMode = iota // FileModeOpenMultiple picks any set of existing files. FileModeOpenMultiple // FileModeOpenFolder picks one directory (the current one when no // row is selected). FileModeOpenFolder // FileModeSave names a file in the current directory; overwrite // confirmation is the caller's policy on the absolute path Apply // returned. FileModeSave )
type Fixed ¶
type Fixed struct {
// contains filtered or unexported fields
}
Fixed places its children at explicit coordinates, GTK's Fixed: there are no tracks and no negotiation - a child sits at the (x, y) it was put at, negative coordinates included, at its natural size, and children may overlap freely, later puts painting and hitting on top of earlier ones.
The container measures to the union of its children's extents: from the leftmost child's left edge to the rightmost child's right edge, likewise vertically, so children at negative coordinates grow the request in that direction while still arranging at their negative offset - the painter's clip decides visibility, exactly like a squeezed Box child overflowing its cell. An empty Fixed measures as nothing.
func (*Fixed) AccessibleName ¶
func (n *Fixed) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Fixed) AddClass ¶
func (n *Fixed) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Fixed) Arrange ¶
Arrange places every child at its coordinates at its natural size, relative to the container's origin.
func (*Fixed) ArrangeRoot ¶
ArrangeRoot records the container's own rect.
func (*Fixed) AttachStylesheet ¶
func (n *Fixed) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Fixed) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Fixed) Children ¶
Children exposes the children in put order, the order focus traversal and painting follow.
func (*Fixed) Classes ¶
func (n *Fixed) Classes() []string
Classes returns a copy of the widget's classes.
func (*Fixed) DebugName ¶
func (n *Fixed) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Fixed) DetachStylesheet ¶
func (n *Fixed) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Fixed) Element ¶
func (n *Fixed) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Fixed) Enabled ¶
func (n *Fixed) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Fixed) HasState ¶
func (n *Fixed) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Fixed) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Fixed) HitTest ¶
HitTest returns the topmost child under p (later puts sit on top), or the fixed itself when p is inside its bounds but over no child.
func (*Fixed) HoverWithin ¶
func (n *Fixed) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Fixed) InlineStyle ¶
func (n *Fixed) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Fixed) Invalidate ¶
func (n *Fixed) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Fixed) InvalidateLayout ¶
func (n *Fixed) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Fixed) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Fixed) LayoutMotion ¶
func (n *Fixed) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Fixed) MaximumSize ¶
func (n *Fixed) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Fixed) Measure ¶
Measure measures every child at its natural size and reports the union of their extents from their coordinates. The result is cached until an InvalidateLayout anywhere in the subtree.
func (*Fixed) Move ¶
Move moves an attached child to (x, y) in place, without detaching it, so its focus and state survive; the old and new pixels both repaint. Unknown widgets are ignored.
func (*Fixed) Paint ¶
Paint draws the children in put order, so overlapping children composite bottom to top.
func (*Fixed) Parent ¶
func (n *Fixed) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Fixed) Put ¶
Put adds w at (x, y) and returns the fixed for chaining. Putting a widget that is already in the container moves it to the new coordinates (a widget sits in the fixed once). The measure cache drops so the next frame reflows.
func (*Fixed) Remove ¶
Remove detaches w and reports whether it was attached. The removed widget's parent link clears and the removal hook fires, like every tree mutation; the measure cache drops so the next frame reflows without it.
func (*Fixed) RemoveAttr ¶
func (n *Fixed) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Fixed) RemoveClass ¶
func (n *Fixed) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Fixed) SetAccessibleName ¶
func (n *Fixed) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Fixed) SetAttr ¶
func (n *Fixed) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Fixed) SetClasses ¶
func (n *Fixed) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Fixed) SetCursorName ¶
func (n *Fixed) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Fixed) SetDebugName ¶
func (n *Fixed) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Fixed) SetElement ¶
func (n *Fixed) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Fixed) SetEnabled ¶
SetEnabled turns the fixed's subtree on or off through the per-query enable walk, like Box.
func (*Fixed) SetFocusOnClick ¶
func (n *Fixed) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Fixed) SetHAlign ¶
func (n *Fixed) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Fixed) SetHExpand ¶
func (n *Fixed) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Fixed) SetID ¶
func (n *Fixed) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Fixed) SetInlineStyle ¶
func (n *Fixed) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Fixed) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Fixed) SetLayoutMotion ¶
func (n *Fixed) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Fixed) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Fixed) SetMaximumSize ¶
func (n *Fixed) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Fixed) SetOnClickWithin ¶
func (n *Fixed) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Fixed) SetOnFocusChanged ¶
func (n *Fixed) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Fixed) SetOnHoverWithin ¶
func (n *Fixed) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Fixed) SetOnPointer ¶
func (n *Fixed) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Fixed) SetOnScroll ¶
func (n *Fixed) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Fixed) SetSharedElement ¶
func (n *Fixed) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Fixed) SetSizeRequest ¶
func (n *Fixed) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Fixed) SetState ¶
func (n *Fixed) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Fixed) SetTooltip ¶
func (n *Fixed) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Fixed) SetTooltipMarkup ¶
func (n *Fixed) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Fixed) SetVAlign ¶
func (n *Fixed) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Fixed) SetVExpand ¶
func (n *Fixed) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Fixed) SetVisible ¶
func (n *Fixed) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Fixed) SharedElement ¶
func (n *Fixed) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Fixed) SizeRequest ¶
func (n *Fixed) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Fixed) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Fixed) TooltipText ¶
func (n *Fixed) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type FlatRow ¶
FlatRow is one visible tree row: its visible index, its depth, its value, whether it can expand, and whether it currently is.
type FlatTree ¶
type FlatTree[T any] struct { // contains filtered or unexported fields }
FlatTree flattens a TreeRow forest into visible rows and owns the expansion state. It implements ColumnModel[FlatRow[T]] directly:
tree := widget.NewFlatTree(roots)
view := widget.NewColumnView(face, 14, tree, []widget.TableColumn[widget.FlatRow[item]]{{
Title: "Name", Expand: true,
Cell: widget.TreeCell(tree, 14, func(it item) Widget {
return widget.NewLabel(face, 14, it.Name, 0)
}),
}})
func NewFlatTree ¶
NewFlatTree flattens roots with every collapsible row expanded.
func (*FlatTree[T]) SetRefresh ¶
func (f *FlatTree[T]) SetRefresh(fn func())
SetRefresh installs the hook TreeCell's toggle runs after a collapse or expand (a ColumnView's owner wires it to the view's List().Reset).
type FloatingPanel ¶
type FloatingPanel struct {
// OnOutside runs on a click outside the panel; nil passes those
// through.
OnOutside func()
// OnGeometryChanged hears the panel's rect, in the area's
// coordinates, once a move or resize gesture ended and the panel
// was laid out there.
OnGeometryChanged func(r render.Rect)
// contains filtered or unexported fields
}
FloatingPanel is a movable, resizable panel over an area, an overlay or layer surface: a card centered until moved, dragged by its header (whose own controls keep their presses), resized from its bottom right corner within its size limits, and kept inside the area. A press outside the panel runs OnOutside; without it, as a window's root, the panel takes input only over itself (InputRegioner) and the rest passes through. The area is the floatingpanel element and the card its panel child, with the theme's card surface and a shadow.
func NewFloatingPanel ¶
func NewFloatingPanel(header, body Widget) *FloatingPanel
NewFloatingPanel returns a panel of header over body; a nil header leaves the panel without a drag region.
func (*FloatingPanel) AccessibleName ¶
func (n *FloatingPanel) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*FloatingPanel) AddClass ¶
func (n *FloatingPanel) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*FloatingPanel) Arrange ¶
func (f *FloatingPanel) Arrange(r render.Rect)
Arrange sizes the panel (its chosen size, else its natural one, within the limits), centers it until placed, keeps it inside the area, and pins the grip to its corner.
func (*FloatingPanel) AttachStylesheet ¶
func (n *FloatingPanel) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*FloatingPanel) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*FloatingPanel) Children ¶
func (f *FloatingPanel) Children() []Widget
Children are the panel and its grip.
func (*FloatingPanel) Classes ¶
func (n *FloatingPanel) Classes() []string
Classes returns a copy of the widget's classes.
func (*FloatingPanel) ClickAt ¶
func (f *FloatingPanel) ClickAt(Point)
ClickAt is a click outside the panel.
func (*FloatingPanel) DebugName ¶
func (n *FloatingPanel) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*FloatingPanel) DetachStylesheet ¶
func (n *FloatingPanel) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*FloatingPanel) Element ¶
func (n *FloatingPanel) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*FloatingPanel) Enabled ¶
func (n *FloatingPanel) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*FloatingPanel) HAlign ¶
func (n *FloatingPanel) HAlign() Align
HAlign returns the horizontal placement.
func (*FloatingPanel) HasState ¶
func (n *FloatingPanel) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*FloatingPanel) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*FloatingPanel) HitTest ¶
func (f *FloatingPanel) HitTest(p Point) Widget
HitTest is the grip, then the panel; outside it the area itself when OnOutside takes those presses, else nothing.
func (*FloatingPanel) HoverWithin ¶
func (n *FloatingPanel) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*FloatingPanel) ID ¶
func (n *FloatingPanel) ID() string
ID returns the style id, empty when none is set.
func (*FloatingPanel) InlineStyle ¶
func (n *FloatingPanel) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*FloatingPanel) InputRegion ¶
func (f *FloatingPanel) InputRegion() []render.Rect
InputRegion implements InputRegioner: the panel alone when presses outside pass through, everywhere when OnOutside takes them.
func (*FloatingPanel) Invalidate ¶
func (n *FloatingPanel) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*FloatingPanel) InvalidateLayout ¶
func (n *FloatingPanel) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*FloatingPanel) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*FloatingPanel) LayoutMotion ¶
func (n *FloatingPanel) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*FloatingPanel) MaximumSize ¶
func (n *FloatingPanel) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*FloatingPanel) Measure ¶
func (f *FloatingPanel) Measure(axis Axis, forSize int) Sizes
Measure asks for the panel's natural size and needs none: the area takes whatever it is given and keeps the panel inside it.
func (*FloatingPanel) Paint ¶
func (f *FloatingPanel) Paint(cv *render.Canvas)
Paint draws the panel, then its grip.
func (*FloatingPanel) PanelRect ¶
func (f *FloatingPanel) PanelRect() render.Rect
PanelRect is the panel's last arranged rect, in the area's coordinates.
func (*FloatingPanel) Parent ¶
func (n *FloatingPanel) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*FloatingPanel) Recenter ¶
func (f *FloatingPanel) Recenter()
Recenter centers the panel again, as before it was first moved.
func (*FloatingPanel) RemoveAttr ¶
func (n *FloatingPanel) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*FloatingPanel) RemoveClass ¶
func (n *FloatingPanel) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*FloatingPanel) SetAccessibleName ¶
func (n *FloatingPanel) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*FloatingPanel) SetAttr ¶
func (n *FloatingPanel) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*FloatingPanel) SetClasses ¶
func (n *FloatingPanel) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*FloatingPanel) SetCursorName ¶
func (n *FloatingPanel) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*FloatingPanel) SetDebugName ¶
func (n *FloatingPanel) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*FloatingPanel) SetElement ¶
func (n *FloatingPanel) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*FloatingPanel) SetEnabled ¶
func (n *FloatingPanel) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*FloatingPanel) SetFocusOnClick ¶
func (n *FloatingPanel) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*FloatingPanel) SetHAlign ¶
func (n *FloatingPanel) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*FloatingPanel) SetHExpand ¶
func (n *FloatingPanel) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*FloatingPanel) SetID ¶
func (n *FloatingPanel) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*FloatingPanel) SetInlineStyle ¶
func (n *FloatingPanel) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*FloatingPanel) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*FloatingPanel) SetLayoutMotion ¶
func (n *FloatingPanel) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*FloatingPanel) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*FloatingPanel) SetMaximumSize ¶
func (n *FloatingPanel) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*FloatingPanel) SetOnClickWithin ¶
func (n *FloatingPanel) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*FloatingPanel) SetOnFocusChanged ¶
func (n *FloatingPanel) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*FloatingPanel) SetOnHoverWithin ¶
func (n *FloatingPanel) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*FloatingPanel) SetOnPointer ¶
func (n *FloatingPanel) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*FloatingPanel) SetOnScroll ¶
func (n *FloatingPanel) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*FloatingPanel) SetPanelSize ¶
func (f *FloatingPanel) SetPanelSize(w, h int)
SetPanelSize sizes the panel w x h, within its limits; zero on an axis returns it to the content's natural size.
func (*FloatingPanel) SetPosition ¶
func (f *FloatingPanel) SetPosition(p Point)
SetPosition places the panel's top left at p in the area, kept inside it.
func (*FloatingPanel) SetSharedElement ¶
func (n *FloatingPanel) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*FloatingPanel) SetSizeLimits ¶
func (f *FloatingPanel) SetSizeLimits(min, max Size)
SetSizeLimits bounds the panel's size: never below min, nor above max on an axis where it is not zero, nor beyond the area.
func (*FloatingPanel) SetSizeRequest ¶
func (n *FloatingPanel) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*FloatingPanel) SetState ¶
func (n *FloatingPanel) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*FloatingPanel) SetTooltip ¶
func (n *FloatingPanel) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*FloatingPanel) SetTooltipMarkup ¶
func (n *FloatingPanel) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*FloatingPanel) SetVAlign ¶
func (n *FloatingPanel) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*FloatingPanel) SetVExpand ¶
func (n *FloatingPanel) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*FloatingPanel) SetVisible ¶
func (n *FloatingPanel) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*FloatingPanel) SharedElement ¶
func (n *FloatingPanel) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*FloatingPanel) SizeRequest ¶
func (n *FloatingPanel) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*FloatingPanel) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*FloatingPanel) TooltipText ¶
func (n *FloatingPanel) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type FlowBox ¶
type FlowBox struct {
// OnSelectionChanged fires with the selected indices once per
// gesture; OnActivate fires for an activated child.
OnSelectionChanged func(children []int)
OnActivate func(i int)
// contains filtered or unexported fields
}
FlowBox lays its children out in lines, starting a new line when the next child would not fit or the line holds its maximum (GtkFlowBox, horizontal and non-homogeneous). It selects like a List - SetSelectionMode, single by default (GTK's), with clicks, rubber bands, and the keyboard moving by item and by line - and a click activates (OnActivate) unless SetSingleClickActivate(false) leaves activation to a double click. Controls inside a child keep their own clicks. Each child sits in a FlowBoxChild, the `flowboxchild` node a stylesheet addresses (`flowbox > flowboxchild.drop-before`). Its natural width is the widest line at the maximum per line; given less, it wraps and grows taller.
func NewFlowBox ¶
NewFlowBox returns an empty flow box with colSpacing between the children of a line and rowSpacing between lines.
func NewWrapBox ¶
NewWrapBox returns the adw WrapBox: a FlowBox wrapping at childSpacing/lineSpacing with justify deciding each line's leftover width - one wrapping layout, not two.
func (*FlowBox) AccessibleName ¶
func (n *FlowBox) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*FlowBox) AddClass ¶
func (n *FlowBox) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*FlowBox) Append ¶
func (f *FlowBox) Append(w Widget) *FlowBoxChild
Append adds w at the end, returning its FlowBoxChild.
func (*FlowBox) Arrange ¶
Arrange places each line under the last, its children at their natural widths from the start edge, as tall as the line.
func (*FlowBox) AttachStylesheet ¶
func (n *FlowBox) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*FlowBox) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*FlowBox) ChildAt ¶
func (f *FlowBox) ChildAt(i int) *FlowBoxChild
ChildAt is the FlowBoxChild at index i, nil out of range (gtk_flow_box_get_child_at_index).
func (*FlowBox) Classes ¶
func (n *FlowBox) Classes() []string
Classes returns a copy of the widget's classes.
func (*FlowBox) DebugName ¶
func (n *FlowBox) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*FlowBox) DetachStylesheet ¶
func (n *FlowBox) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*FlowBox) Element ¶
func (n *FlowBox) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*FlowBox) Enabled ¶
func (n *FlowBox) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*FlowBox) HasState ¶
func (n *FlowBox) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*FlowBox) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*FlowBox) HoverWithin ¶
func (n *FlowBox) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*FlowBox) IndexAt ¶
IndexAt is the index of the child under p, -1 over none (gtk_flow_box_get_child_at_pos).
func (*FlowBox) InlineStyle ¶
func (n *FlowBox) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*FlowBox) Insert ¶
func (f *FlowBox) Insert(i int, w Widget) *FlowBoxChild
Insert adds w at index i (clamped), returning its FlowBoxChild.
func (*FlowBox) Invalidate ¶
func (n *FlowBox) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*FlowBox) InvalidateLayout ¶
func (n *FlowBox) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*FlowBox) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*FlowBox) KeyAction ¶
KeyAction moves and extends the selection: left and right by a child, up and down to the nearest child of the neighboring line.
func (*FlowBox) LayoutMotion ¶
func (n *FlowBox) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*FlowBox) MaximumSize ¶
func (n *FlowBox) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*FlowBox) Measure ¶
Measure needs its widest child, wrapping (GtkFlowBox's minimum width), and wants its widest line unwrapped; down, it is as tall as its lines at the width given.
func (*FlowBox) Move ¶
Move moves the child at index from to index to (both clamped), in place: the child stays attached and its selection follows it.
func (*FlowBox) Parent ¶
func (n *FlowBox) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*FlowBox) RemoveAttr ¶
func (n *FlowBox) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*FlowBox) RemoveClass ¶
func (n *FlowBox) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*FlowBox) Select ¶
func (s *FlowBox) Select(i int)
Select moves the selection to item i (clamped, -1 clears). In multiple mode it collapses the set to the one item (-1 clears it); in none mode it does nothing.
func (*FlowBox) SelectAll ¶
func (s *FlowBox) SelectAll()
SelectAll selects every item. It is the ctrl+a target through Router.SelectAll and does nothing outside multiple mode, where "all" is not a representable selection.
func (*FlowBox) SelectRows ¶
func (s *FlowBox) SelectRows(rows ...int)
SelectRows makes rows the multiple-mode selection (out-of-range rows are dropped) and notifies; outside multiple mode it does nothing.
func (*FlowBox) Selected ¶
func (s *FlowBox) Selected() int
Selected returns the selected item in single and browse mode; in multiple mode the anchor the last gesture or Select settled on, -1 when the set is empty. Selection reports the whole set.
func (*FlowBox) Selection ¶
func (s *FlowBox) Selection() []int
Selection returns the whole selected set, ascending; empty when nothing is selected.
func (*FlowBox) SelectionMode ¶
func (s *FlowBox) SelectionMode() SelectionMode
SelectionMode returns the current selection model.
func (*FlowBox) SetAccessibleName ¶
func (n *FlowBox) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*FlowBox) SetAttr ¶
func (n *FlowBox) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*FlowBox) SetClasses ¶
func (n *FlowBox) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*FlowBox) SetCursorName ¶
func (n *FlowBox) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*FlowBox) SetDebugName ¶
func (n *FlowBox) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*FlowBox) SetElement ¶
func (n *FlowBox) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*FlowBox) SetEnabled ¶
func (n *FlowBox) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*FlowBox) SetFocusOnClick ¶
func (n *FlowBox) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*FlowBox) SetHAlign ¶
func (n *FlowBox) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*FlowBox) SetHExpand ¶
func (n *FlowBox) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*FlowBox) SetID ¶
func (n *FlowBox) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*FlowBox) SetInlineStyle ¶
func (n *FlowBox) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*FlowBox) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*FlowBox) SetJustify ¶
SetJustify sets how each line's leftover width is used.
func (*FlowBox) SetLayoutMotion ¶
func (n *FlowBox) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*FlowBox) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*FlowBox) SetMaxChildrenPerLine ¶
SetMaxChildrenPerLine caps a line's children (GTK's max-children-per-line, 7 by default); below 1 it acts as 1.
func (*FlowBox) SetMaximumSize ¶
func (n *FlowBox) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*FlowBox) SetOnClickWithin ¶
func (n *FlowBox) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*FlowBox) SetOnFocusChanged ¶
func (n *FlowBox) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*FlowBox) SetOnHoverWithin ¶
func (n *FlowBox) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*FlowBox) SetOnPointer ¶
func (n *FlowBox) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*FlowBox) SetOnScroll ¶
func (n *FlowBox) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*FlowBox) SetSelectionMode ¶
func (s *FlowBox) SetSelectionMode(mode SelectionMode)
SetSelectionMode switches the selection model. Leaving multiple mode keeps the lowest selected item as the single selection (or clears it when the set was empty); entering it seeds the set with the current selection and anchors there. The change notification fires when the switch changes the set.
func (*FlowBox) SetSharedElement ¶
func (n *FlowBox) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*FlowBox) SetSingleClickActivate ¶
SetSingleClickActivate makes a plain click activate (on, GTK's default) or leaves activation to a double click.
func (*FlowBox) SetSizeRequest ¶
func (n *FlowBox) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*FlowBox) SetState ¶
func (n *FlowBox) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*FlowBox) SetTooltip ¶
func (n *FlowBox) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*FlowBox) SetTooltipMarkup ¶
func (n *FlowBox) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*FlowBox) SetVAlign ¶
func (n *FlowBox) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*FlowBox) SetVExpand ¶
func (n *FlowBox) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*FlowBox) SetVisible ¶
func (n *FlowBox) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*FlowBox) SharedElement ¶
func (n *FlowBox) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*FlowBox) SizeRequest ¶
func (n *FlowBox) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*FlowBox) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*FlowBox) TooltipText ¶
func (n *FlowBox) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type FlowBoxChild ¶
type FlowBoxChild struct {
// contains filtered or unexported fields
}
FlowBoxChild wraps one child of a FlowBox: a CSS box around it.
func (*FlowBoxChild) AccessibleName ¶
func (n *FlowBoxChild) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*FlowBoxChild) AddClass ¶
func (n *FlowBoxChild) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*FlowBoxChild) Arrange ¶
func (c *FlowBoxChild) Arrange(r render.Rect)
Arrange gives the child the content box.
func (*FlowBoxChild) AttachStylesheet ¶
func (n *FlowBoxChild) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*FlowBoxChild) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*FlowBoxChild) Children ¶
func (c *FlowBoxChild) Children() []Widget
Children is the wrapped widget.
func (*FlowBoxChild) Classes ¶
func (n *FlowBoxChild) Classes() []string
Classes returns a copy of the widget's classes.
func (*FlowBoxChild) ClickAt ¶
func (c *FlowBoxChild) ClickAt(Point)
ClickAt selects (and maybe activates) the child.
func (*FlowBoxChild) DebugName ¶
func (n *FlowBoxChild) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*FlowBoxChild) DetachStylesheet ¶
func (n *FlowBoxChild) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*FlowBoxChild) DoubleClickAt ¶
func (c *FlowBoxChild) DoubleClickAt(Point)
DoubleClickAt activates the child when a single click does not.
func (*FlowBoxChild) DragMove ¶
func (c *FlowBoxChild) DragMove(p Point)
DragMove rubber-bands (multiple) or motion-selects from the anchor.
func (*FlowBoxChild) Element ¶
func (n *FlowBoxChild) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*FlowBoxChild) Enabled ¶
func (n *FlowBoxChild) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*FlowBoxChild) HAlign ¶
func (n *FlowBoxChild) HAlign() Align
HAlign returns the horizontal placement.
func (*FlowBoxChild) HasState ¶
func (n *FlowBoxChild) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*FlowBoxChild) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*FlowBoxChild) HitTest ¶
func (c *FlowBoxChild) HitTest(p Point) Widget
HitTest resolves through the child; in a selectable box the wrapper takes every press but those a control inside the child consumes.
func (*FlowBoxChild) HoverWithin ¶
func (n *FlowBoxChild) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*FlowBoxChild) ID ¶
func (n *FlowBoxChild) ID() string
ID returns the style id, empty when none is set.
func (*FlowBoxChild) Index ¶
func (c *FlowBoxChild) Index() int
Index is the child's position in its FlowBox, -1 when detached.
func (*FlowBoxChild) InlineStyle ¶
func (n *FlowBoxChild) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*FlowBoxChild) Invalidate ¶
func (n *FlowBoxChild) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*FlowBoxChild) InvalidateLayout ¶
func (n *FlowBoxChild) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*FlowBoxChild) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*FlowBoxChild) KeyAction ¶
func (c *FlowBoxChild) KeyAction(a KeyAction, mods Mods)
KeyAction is the box's: a focused child steers the selection.
func (*FlowBoxChild) LayoutMotion ¶
func (n *FlowBoxChild) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*FlowBoxChild) MaximumSize ¶
func (n *FlowBoxChild) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*FlowBoxChild) Measure ¶
func (c *FlowBoxChild) Measure(axis Axis, forSize int) Sizes
Measure is the child inside the wrapper's CSS box.
func (*FlowBoxChild) Paint ¶
func (c *FlowBoxChild) Paint(cv *render.Canvas)
Paint draws the wrapper's CSS layers - a selected child over the theme's selection tint where the stylesheet names no background - and the child.
func (*FlowBoxChild) Parent ¶
func (n *FlowBoxChild) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*FlowBoxChild) PressEnd ¶
func (c *FlowBoxChild) PressEnd()
PressEnd closes the gesture, landing its one notification.
func (*FlowBoxChild) RemoveAttr ¶
func (n *FlowBoxChild) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*FlowBoxChild) RemoveClass ¶
func (n *FlowBoxChild) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*FlowBoxChild) SelectAll ¶
func (c *FlowBoxChild) SelectAll()
SelectAll is the box's (ctrl+a on a focused child).
func (*FlowBoxChild) SetAccessibleName ¶
func (n *FlowBoxChild) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*FlowBoxChild) SetAttr ¶
func (n *FlowBoxChild) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*FlowBoxChild) SetClasses ¶
func (n *FlowBoxChild) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*FlowBoxChild) SetCursorName ¶
func (n *FlowBoxChild) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*FlowBoxChild) SetDebugName ¶
func (n *FlowBoxChild) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*FlowBoxChild) SetElement ¶
func (n *FlowBoxChild) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*FlowBoxChild) SetEnabled ¶
func (n *FlowBoxChild) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*FlowBoxChild) SetFocusOnClick ¶
func (n *FlowBoxChild) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*FlowBoxChild) SetHAlign ¶
func (n *FlowBoxChild) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*FlowBoxChild) SetHExpand ¶
func (n *FlowBoxChild) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*FlowBoxChild) SetID ¶
func (n *FlowBoxChild) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*FlowBoxChild) SetInlineStyle ¶
func (n *FlowBoxChild) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*FlowBoxChild) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*FlowBoxChild) SetLayoutMotion ¶
func (n *FlowBoxChild) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*FlowBoxChild) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*FlowBoxChild) SetMaximumSize ¶
func (n *FlowBoxChild) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*FlowBoxChild) SetOnClickWithin ¶
func (n *FlowBoxChild) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*FlowBoxChild) SetOnFocusChanged ¶
func (n *FlowBoxChild) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*FlowBoxChild) SetOnHoverWithin ¶
func (n *FlowBoxChild) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*FlowBoxChild) SetOnPointer ¶
func (n *FlowBoxChild) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*FlowBoxChild) SetOnScroll ¶
func (n *FlowBoxChild) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*FlowBoxChild) SetPressed ¶
func (c *FlowBoxChild) SetPressed(on bool)
SetPressed opens a pointer gesture anchored on the child.
func (*FlowBoxChild) SetSharedElement ¶
func (n *FlowBoxChild) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*FlowBoxChild) SetSizeRequest ¶
func (n *FlowBoxChild) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*FlowBoxChild) SetState ¶
func (n *FlowBoxChild) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*FlowBoxChild) SetTooltip ¶
func (n *FlowBoxChild) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*FlowBoxChild) SetTooltipMarkup ¶
func (n *FlowBoxChild) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*FlowBoxChild) SetVAlign ¶
func (n *FlowBoxChild) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*FlowBoxChild) SetVExpand ¶
func (n *FlowBoxChild) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*FlowBoxChild) SetVisible ¶
func (n *FlowBoxChild) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*FlowBoxChild) SharedElement ¶
func (n *FlowBoxChild) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*FlowBoxChild) SizeRequest ¶
func (n *FlowBoxChild) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*FlowBoxChild) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*FlowBoxChild) TooltipText ¶
func (n *FlowBoxChild) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type FocusNavigator ¶
type FocusNavigator interface {
}
FocusNavigator is an ancestor that moves focus among its own focusable descendants on navigation keys: the roving focus of an accordion's triggers. NavigateFocus returns the widget to focus for action a headed for target, or nil to let the action through.
type FocusObserver ¶
type FocusObserver interface {
FocusMoved(from, to Widget)
}
FocusObserver is an ancestor that hears the keyboard focus move into, out of or within its subtree: a form validating the field the focus just left.
type FocusTrapper ¶
type FocusTrapper interface {
FocusTrap() Widget
}
FocusTrapper is a widget that can hold Tab traversal inside a part of itself: a modal sheet over the content. FocusTrap returns that part while it traps, nil otherwise.
type FontButton ¶
type FontButton struct {
Button
// OnOpen runs on click to show a chooser starting at the choice.
OnOpen func(current FontChoice)
// OnFontSet runs when the user picked a font (Choose), not on
// SetFont.
OnFontSet func(f FontChoice)
// contains filtered or unexported fields
}
FontButton is GTK's FontDialogButton: a button naming the current family and size that opens a font chooser on click. OnOpen is the opening hook (app.Application.AttachFontButton installs the chooser dialog); Choose applies the user's pick and fires OnFontSet.
func NewFontButton ¶
func NewFontButton(face render.Font, sizePx float64, initial FontChoice) *FontButton
NewFontButton returns a button naming initial, its label in face at sizePx.
func (*FontButton) AccessibleName ¶
func (n *FontButton) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*FontButton) AddClass ¶
func (n *FontButton) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*FontButton) AttachStylesheet ¶
func (n *FontButton) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*FontButton) BindFont ¶
func (b *FontButton) BindFont(binding *Binding[FontChoice]) (unbind func())
BindFont wires the binding two-way to the shown choice.
func (*FontButton) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*FontButton) Choose ¶
func (b *FontButton) Choose(f FontChoice)
Choose applies a font the user picked: it shows it and fires OnFontSet.
func (*FontButton) Classes ¶
func (n *FontButton) Classes() []string
Classes returns a copy of the widget's classes.
func (*FontButton) DebugName ¶
func (n *FontButton) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*FontButton) DetachStylesheet ¶
func (n *FontButton) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*FontButton) Element ¶
func (n *FontButton) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*FontButton) Enabled ¶
func (n *FontButton) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*FontButton) HAlign ¶
func (n *FontButton) HAlign() Align
HAlign returns the horizontal placement.
func (*FontButton) HasState ¶
func (n *FontButton) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*FontButton) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*FontButton) HoverWithin ¶
func (n *FontButton) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*FontButton) ID ¶
func (n *FontButton) ID() string
ID returns the style id, empty when none is set.
func (*FontButton) InlineStyle ¶
func (n *FontButton) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*FontButton) Invalidate ¶
func (n *FontButton) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*FontButton) InvalidateLayout ¶
func (n *FontButton) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*FontButton) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*FontButton) LayoutMotion ¶
func (n *FontButton) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*FontButton) MaximumSize ¶
func (n *FontButton) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*FontButton) Parent ¶
func (n *FontButton) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*FontButton) RemoveAttr ¶
func (n *FontButton) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*FontButton) RemoveClass ¶
func (n *FontButton) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*FontButton) SetAccessibleName ¶
func (n *FontButton) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*FontButton) SetAttr ¶
func (n *FontButton) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*FontButton) SetClasses ¶
func (n *FontButton) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*FontButton) SetCursorName ¶
func (n *FontButton) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*FontButton) SetDebugName ¶
func (n *FontButton) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*FontButton) SetElement ¶
func (n *FontButton) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*FontButton) SetEnabled ¶
func (n *FontButton) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*FontButton) SetFocusOnClick ¶
func (n *FontButton) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*FontButton) SetFont ¶
func (b *FontButton) SetFont(f FontChoice)
SetFont shows f without firing OnFontSet.
func (*FontButton) SetHAlign ¶
func (n *FontButton) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*FontButton) SetHExpand ¶
func (n *FontButton) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*FontButton) SetID ¶
func (n *FontButton) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*FontButton) SetInlineStyle ¶
func (n *FontButton) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*FontButton) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*FontButton) SetLayoutMotion ¶
func (n *FontButton) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*FontButton) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*FontButton) SetMaximumSize ¶
func (n *FontButton) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*FontButton) SetOnClickWithin ¶
func (n *FontButton) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*FontButton) SetOnFocusChanged ¶
func (n *FontButton) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*FontButton) SetOnHoverWithin ¶
func (n *FontButton) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*FontButton) SetOnPointer ¶
func (n *FontButton) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*FontButton) SetOnScroll ¶
func (n *FontButton) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*FontButton) SetSharedElement ¶
func (n *FontButton) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*FontButton) SetSizeRequest ¶
func (n *FontButton) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*FontButton) SetState ¶
func (n *FontButton) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*FontButton) SetTooltip ¶
func (n *FontButton) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*FontButton) SetTooltipMarkup ¶
func (n *FontButton) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*FontButton) SetVAlign ¶
func (n *FontButton) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*FontButton) SetVExpand ¶
func (n *FontButton) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*FontButton) SetVisible ¶
func (n *FontButton) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*FontButton) SharedElement ¶
func (n *FontButton) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*FontButton) SizeRequest ¶
func (n *FontButton) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*FontButton) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*FontButton) TooltipText ¶
func (n *FontButton) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type FontChoice ¶
FontChoice is a font family and size, the FontButton's value.
func (FontChoice) String ¶
func (f FontChoice) String() string
String renders the choice as the button shows it: "Inter 13".
type Form ¶
type Form struct {
// OnSubmit runs when Submit finds every field valid.
OnSubmit func()
// contains filtered or unexported fields
}
Form validates a column of fields: each field added with a validator - a closure that reads its control's value and returns the error message, or "" while it is valid. A field shows its error once the focus leaves it, and Submit validates every field, moves the focus to the first invalid one, and runs OnSubmit only when all are valid. Enter in a text entry of the form submits. It styles as the `form` element.
func (*Form) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*Form) Children ¶
func (c *Form) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Form) FocusMoved ¶
FocusMoved implements FocusObserver: the field the focus left shows its validation.
func (*Form) InterceptKey ¶
InterceptKey implements KeyInterceptor: Enter in a text entry of the form submits it.
func (*Form) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
type Frame ¶
type Frame struct {
// contains filtered or unexported fields
}
Frame is a labeled outline around a child (GTK Frame): the optional label sits above a rounded, bordered box holding the child. The outline is the frame's `border` node, so a stylesheet restyles it like any surface; with no label the frame is the outline alone.
func NewFrame ¶
NewFrame returns a frame around child titled label ("" for none), the label painted with face.
func (*Frame) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*Frame) Children ¶
func (c *Frame) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Frame) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
type GPUArea ¶
type GPUArea struct {
// OnFrame asks for a frame; it runs on the loop.
OnFrame func(f GPUFrame)
// contains filtered or unexported fields
}
GPUArea is GTK's GLArea without cgo: the application renders with whatever GPU stack it links (GL, Vulkan, a compute library) into dmabufs, or into CPU images, and the area presents them on its own compositor surface at its bounds, dmabufs with no copy. The surface sits below the window and shows through the area's bounds, so widgets drawn over the area stay on top of it. OnFrame paces the application: it runs once the area is on screen, after each presented frame reaches the screen, after a resize, and on QueueFrame. It styles as `gpuarea`.
func NewGPUArea ¶
func NewGPUArea() *GPUArea
NewGPUArea returns an empty area; give it a size through the layout (expand, a minimum size in CSS).
func (*GPUArea) AccessibleName ¶
func (n *GPUArea) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*GPUArea) AddClass ¶
func (n *GPUArea) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*GPUArea) Arrange ¶
Arrange places the area's surface over its bounds, creating it the first time the area lands on screen.
func (*GPUArea) AttachStylesheet ¶
func (n *GPUArea) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*GPUArea) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*GPUArea) Classes ¶
func (n *GPUArea) Classes() []string
Classes returns a copy of the widget's classes.
func (*GPUArea) DebugName ¶
func (n *GPUArea) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*GPUArea) DetachStylesheet ¶
func (n *GPUArea) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*GPUArea) Element ¶
func (n *GPUArea) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*GPUArea) Enabled ¶
func (n *GPUArea) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*GPUArea) Err ¶
Err returns why the area has no surface: the compositor lacks subsurfaces, or the area is not in a window.
func (*GPUArea) HasState ¶
func (n *GPUArea) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*GPUArea) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*GPUArea) HoverWithin ¶
func (n *GPUArea) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*GPUArea) Import ¶
Import imports a dmabuf for presenting. The import completes asynchronously; Present of a buffer still importing shows it once it is ready.
func (*GPUArea) InlineStyle ¶
func (n *GPUArea) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*GPUArea) Invalidate ¶
func (n *GPUArea) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*GPUArea) InvalidateLayout ¶
func (n *GPUArea) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*GPUArea) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*GPUArea) LayoutMotion ¶
func (n *GPUArea) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*GPUArea) MaximumSize ¶
func (n *GPUArea) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*GPUArea) Paint ¶
Paint clears the bounds to transparent, the window through which the surface below shows.
func (*GPUArea) Parent ¶
func (n *GPUArea) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*GPUArea) PresentImage ¶
PresentImage shows a CPU-rendered frame (premultiplied, as image.RGBA is), copied into a shared-memory buffer.
func (*GPUArea) QueueFrame ¶
func (a *GPUArea) QueueFrame()
QueueFrame asks for an OnFrame at the next frame, for an application that skipped presenting and wants to resume.
func (*GPUArea) RemoveAttr ¶
func (n *GPUArea) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*GPUArea) RemoveClass ¶
func (n *GPUArea) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*GPUArea) SetAccessibleName ¶
func (n *GPUArea) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*GPUArea) SetAttr ¶
func (n *GPUArea) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*GPUArea) SetClasses ¶
func (n *GPUArea) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*GPUArea) SetCursorName ¶
func (n *GPUArea) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*GPUArea) SetDebugName ¶
func (n *GPUArea) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*GPUArea) SetElement ¶
func (n *GPUArea) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*GPUArea) SetEnabled ¶
func (n *GPUArea) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*GPUArea) SetFocusOnClick ¶
func (n *GPUArea) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*GPUArea) SetHAlign ¶
func (n *GPUArea) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*GPUArea) SetHExpand ¶
func (n *GPUArea) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*GPUArea) SetID ¶
func (n *GPUArea) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*GPUArea) SetInlineStyle ¶
func (n *GPUArea) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*GPUArea) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*GPUArea) SetLayoutMotion ¶
func (n *GPUArea) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*GPUArea) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*GPUArea) SetMaximumSize ¶
func (n *GPUArea) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*GPUArea) SetOnClickWithin ¶
func (n *GPUArea) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*GPUArea) SetOnFocusChanged ¶
func (n *GPUArea) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*GPUArea) SetOnHoverWithin ¶
func (n *GPUArea) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*GPUArea) SetOnPointer ¶
func (n *GPUArea) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*GPUArea) SetOnScroll ¶
func (n *GPUArea) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*GPUArea) SetSharedElement ¶
func (n *GPUArea) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*GPUArea) SetSizeRequest ¶
func (n *GPUArea) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*GPUArea) SetState ¶
func (n *GPUArea) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*GPUArea) SetTooltip ¶
func (n *GPUArea) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*GPUArea) SetTooltipMarkup ¶
func (n *GPUArea) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*GPUArea) SetVAlign ¶
func (n *GPUArea) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*GPUArea) SetVExpand ¶
func (n *GPUArea) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*GPUArea) SetVisible ¶
func (n *GPUArea) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*GPUArea) SharedElement ¶
func (n *GPUArea) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*GPUArea) SizeRequest ¶
func (n *GPUArea) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*GPUArea) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*GPUArea) TooltipText ¶
func (n *GPUArea) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type GPUBuffer ¶
type GPUBuffer interface {
// Ready reports whether the import finished; Present waits for it.
Ready() bool
// Busy reports whether the compositor still reads the buffer: do
// not render into it until it is free.
Busy() bool
// Err reports a rejected import, or that the area left the screen
// and the buffer must be imported again.
Err() error
// Destroy releases the compositor-side buffer; the dmabuf's fds
// stay the caller's.
Destroy()
}
GPUBuffer is a dmabuf the compositor imported for a GPUArea.
type GPUFrame ¶
type GPUFrame struct {
// Size is the area in device pixels: a frame this size shows one
// to one, any other size is scaled to the area.
Size Size
}
GPUFrame is a GPUArea's request for a frame.
type GPUSurface ¶
type GPUSurface interface {
Place(bounds render.Rect)
Import(b dmabuf.Buffer) (GPUBuffer, error)
Present(b GPUBuffer) error
PresentImage(img *image.RGBA) error
RequestFrame()
Close()
}
GPUSurface is the presentation surface package app gives a GPUArea on screen. Applications use GPUArea's methods instead.
type Gesture ¶
type Gesture struct {
Kind GestureKind
Phase GesturePhase
At Point
Fingers int
DX, DY float64
Scale float64
Rotation float64
}
Gesture is one gesture event. At is where it happens (the centroid for a multi-contact gesture); DX/DY the motion since the last event; Scale and Rotation (degrees, clockwise) the pinch relative to its start.
type GestureHandler ¶
GestureHandler takes gestures: returning true from a Begin (or a long press) claims the gesture, and its Update/End/Cancel then go to the same widget.
type GestureKind ¶
type GestureKind uint8
GestureKind is a recognized gesture's kind.
const ( // GestureSwipe is a multi-finger swipe (a touchpad's three // fingers): DX/DY carry the motion. GestureSwipe GestureKind = iota // GesturePinch is a pinch-zoom and rotation (two fingers on a // touchscreen, or a touchpad pinch): Scale and Rotation are // relative to the gesture's start. GesturePinch // GestureHold is fingers resting on a touchpad. GestureHold // GestureLongPress is a contact held still past the long-press // delay; consuming it cancels the press's click. GestureLongPress )
Gestures.
type GesturePhase ¶
type GesturePhase uint8
GesturePhase is where a gesture is in its life.
const ( GestureBegin GesturePhase = iota GestureUpdate GestureEnd GestureCancel )
Gesture phases. A long press arrives as one GestureEnd.
type Grid ¶
type Grid struct {
// contains filtered or unexported fields
}
Grid is a rows-and-columns container. Children are attached to cells - optionally spanning several - and the grid derives its tracks from the children: a column or row is as wide or tall as the tallest child claiming it alone, plus what spanning children need.
Sizing per axis: natural mode keeps every track at its own maximum; homogeneous mode gives every track the largest track's extent.
When the arranged rect is larger than the natural size, the surplus is split equally among the tracks (earlier tracks take the remainder), so a spanning child grows by the share of the tracks it spans. When it is smaller, the deficit is negotiated — the reason a grid exists where a Box only overflows: tracks shrink in proportion to their extents down to per-track floors, and only when every floor is reached does the content overflow and the painter's clip decide visibility. A floor is the largest minimum among the track's single-cell children (spanning children are not floor sources — their need spreads, it does not pin), and the grid itself reports the sum of its floors as its minimum so nested grids squeeze coherently.
Children carry no expand flags: surplus and deficit both spread uniformly over the tracks (earlier tracks take the remainder), the one deterministic rule — a child that must claim the extra belongs in a Box, whose expand flag is that negotiation.
A child smaller than its shrunken span keeps its natural size under AlignStart/Center/End (overflowing the span, exactly like a squeezed Box child keeps its natural size); AlignFill takes the shrunken span as given, so the two containers agree visually.
Children paint in attach order, so a later attach overlapping an earlier span paints on top.
func NewGrid ¶
NewGrid returns an empty grid with the given spacing between columns and between rows.
func NewNavigationLinks ¶
func NewNavigationLinks(face render.Font, cols int, links ...NavigationLink) *Grid
NewNavigationLinks is a navigation panel: a grid of cols columns of links, each its title over a muted description.
func (*Grid) AccessibleName ¶
func (n *Grid) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Grid) AddClass ¶
func (n *Grid) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Grid) Arrange ¶
Arrange assigns every child its spanned run, sized by the fitted tracks, aligned inside it per its Align. The surplus beyond the natural size splits equally among the tracks (earlier tracks take the remainder); a smaller rect squeezes the tracks in proportion to their extents down to their floors, overflowing only once every floor is reached.
func (*Grid) ArrangeRoot ¶
ArrangeRoot records the grid's own rect.
func (*Grid) Attach ¶
Attach puts w at (col, row) with the given spans and returns the grid for chaining. Spans below one and negative coordinates clamp to one and zero respectively.
Two conflict rules, both last-wins:
- attaching a widget that is already attached moves it to the new cell (a widget sits in the grid once);
- after the dust settles, whoever occupies the target cell that is not the attached widget is detached - including a widget the move lands on top of.
Overlapping a span without sharing its origin cell is not a conflict: both children stay, the later attach paints and hits on top. Every attach drops the measure cache.
func (*Grid) AttachStylesheet ¶
func (n *Grid) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Grid) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Grid) Children ¶
Children exposes the children in row-major order - the visual order focus traversal follows, so Tab reads the grid left-to-right down the rows, a spanning child visited at its origin cell - regardless of the order attachments arrived in.
func (*Grid) Classes ¶
func (n *Grid) Classes() []string
Classes returns a copy of the widget's classes.
func (*Grid) ColumnHomogeneous ¶
ColumnHomogeneous reports whether every column takes the widest column's extent.
func (*Grid) ColumnSpacing ¶
ColumnSpacing returns the gap between columns.
func (*Grid) DebugName ¶
func (n *Grid) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Grid) DetachStylesheet ¶
func (n *Grid) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Grid) Element ¶
func (n *Grid) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Grid) Enabled ¶
func (n *Grid) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Grid) HasState ¶
func (n *Grid) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Grid) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Grid) HitTest ¶
HitTest returns the topmost child under p (later attaches sit on top), or the grid itself when p is inside its bounds but over no child.
func (*Grid) HoverWithin ¶
func (n *Grid) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Grid) InlineStyle ¶
func (n *Grid) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Grid) Invalidate ¶
func (n *Grid) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Grid) InvalidateLayout ¶
func (n *Grid) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Grid) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Grid) LayoutMotion ¶
func (n *Grid) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Grid) MaximumSize ¶
func (n *Grid) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Grid) Measure ¶
Measure derives the tracks from the children's requests: across, the columns' naturals and floors; down, the rows' at the width given, the columns fitted into it first (at their naturals for none).
func (*Grid) Paint ¶
Paint paints the children in attach order, so overlapping spans composite bottom to top.
func (*Grid) Parent ¶
func (n *Grid) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Grid) Place ¶
Place moves an attached child to a new cell in place, without displacing whoever sits there, so a batch of moves can pass through overlapping states: the widget stays attached and keeps its focus. Unknown widgets are ignored.
func (*Grid) Remove ¶
Remove detaches w and reports whether it was attached. The removed widget's parent link clears and the removal hook fires, like every tree mutation; the measure cache drops so the next frame reflows without it.
func (*Grid) RemoveAttr ¶
func (n *Grid) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Grid) RemoveClass ¶
func (n *Grid) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Grid) RowHomogeneous ¶
RowHomogeneous reports whether every row takes the tallest row's extent.
func (*Grid) SetAccessibleName ¶
func (n *Grid) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Grid) SetAlign ¶
SetAlign selects how w sits inside its spanned run along each axis. Unknown widgets are ignored.
func (*Grid) SetAttr ¶
func (n *Grid) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Grid) SetClasses ¶
func (n *Grid) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Grid) SetColumnHomogeneous ¶
SetColumnHomogeneous toggles whether every column takes the widest column's extent (true) or its own maximum (false, the default).
func (*Grid) SetColumnSpacing ¶
SetColumnSpacing sets the gap between columns and returns the grid for chaining. The measure cache drops so the next frame reflows.
func (*Grid) SetCursorName ¶
func (n *Grid) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Grid) SetDebugName ¶
func (n *Grid) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Grid) SetElement ¶
func (n *Grid) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Grid) SetEnabled ¶
SetEnabled turns the grid's subtree on or off through the per-query enable walk, like Box.
func (*Grid) SetFocusOnClick ¶
func (n *Grid) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Grid) SetHAlign ¶
func (n *Grid) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Grid) SetHExpand ¶
func (n *Grid) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Grid) SetID ¶
func (n *Grid) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Grid) SetInlineStyle ¶
func (n *Grid) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Grid) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Grid) SetLayoutMotion ¶
func (n *Grid) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Grid) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Grid) SetMaximumSize ¶
func (n *Grid) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Grid) SetOnClickWithin ¶
func (n *Grid) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Grid) SetOnFocusChanged ¶
func (n *Grid) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Grid) SetOnHoverWithin ¶
func (n *Grid) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Grid) SetOnPointer ¶
func (n *Grid) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Grid) SetOnScroll ¶
func (n *Grid) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Grid) SetRowHomogeneous ¶
SetRowHomogeneous toggles whether every row takes the tallest row's extent (true) or its own maximum (false, the default).
func (*Grid) SetRowSpacing ¶
SetRowSpacing sets the gap between rows and returns the grid for chaining.
func (*Grid) SetSharedElement ¶
func (n *Grid) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Grid) SetSizeRequest ¶
func (n *Grid) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Grid) SetState ¶
func (n *Grid) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Grid) SetTooltip ¶
func (n *Grid) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Grid) SetTooltipMarkup ¶
func (n *Grid) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Grid) SetVAlign ¶
func (n *Grid) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Grid) SetVExpand ¶
func (n *Grid) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Grid) SetVisible ¶
func (n *Grid) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Grid) SharedElement ¶
func (n *Grid) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Grid) SizeRequest ¶
func (n *Grid) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Grid) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Grid) TooltipText ¶
func (n *Grid) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type GridView ¶
type GridView struct {
List
}
GridView is a virtualized grid over a model, GTK's GridView: cells of one size flow left to right in as many columns as the width fits (between the minimum and maximum column counts), only the visible lines exist as widgets, and selection, rubber band, keyboard motion in two dimensions and activation work as in List. It styles as `gridview` with `child` cells.
func NewGridView ¶
NewGridView returns a grid over model with cells of at least cellWidth by cellHeight pixels, between 1 and 7 columns (GTK's defaults).
func (*GridView) AccessibleName ¶
func (n *GridView) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*GridView) AddClass ¶
func (n *GridView) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*GridView) AttachStylesheet ¶
func (n *GridView) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*GridView) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*GridView) Classes ¶
func (n *GridView) Classes() []string
Classes returns a copy of the widget's classes.
func (*GridView) ColumnSpacing ¶
ColumnSpacing returns the programmatic gap between columns.
func (*GridView) DebugName ¶
func (n *GridView) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*GridView) DetachStylesheet ¶
func (n *GridView) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*GridView) Element ¶
func (n *GridView) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*GridView) Enabled ¶
func (n *GridView) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*GridView) HAlign ¶
func (n *GridView) HAlign() Align
HAlign returns the horizontal placement.
func (*GridView) HasState ¶
func (n *GridView) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*GridView) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*GridView) HoverWithin ¶
func (n *GridView) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*GridView) ID ¶
func (n *GridView) ID() string
ID returns the style id, empty when none is set.
func (*GridView) InlineStyle ¶
func (n *GridView) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*GridView) Invalidate ¶
func (n *GridView) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*GridView) InvalidateLayout ¶
func (n *GridView) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*GridView) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*GridView) LayoutMotion ¶
func (n *GridView) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*GridView) MaxColumns ¶
MaxColumns returns the column cap, zero for none.
func (*GridView) MaximumSize ¶
func (n *GridView) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*GridView) MinColumns ¶
MinColumns returns the column floor.
func (*GridView) Parent ¶
func (n *GridView) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*GridView) RemoveAttr ¶
func (n *GridView) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*GridView) RemoveClass ¶
func (n *GridView) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*GridView) RowSpacing ¶
RowSpacing returns the programmatic gap between lines.
func (*GridView) Select ¶
func (s *GridView) Select(i int)
Select moves the selection to item i (clamped, -1 clears). In multiple mode it collapses the set to the one item (-1 clears it); in none mode it does nothing.
func (*GridView) SelectAll ¶
func (s *GridView) SelectAll()
SelectAll selects every item. It is the ctrl+a target through Router.SelectAll and does nothing outside multiple mode, where "all" is not a representable selection.
func (*GridView) SelectRows ¶
func (s *GridView) SelectRows(rows ...int)
SelectRows makes rows the multiple-mode selection (out-of-range rows are dropped) and notifies; outside multiple mode it does nothing.
func (*GridView) Selected ¶
func (s *GridView) Selected() int
Selected returns the selected item in single and browse mode; in multiple mode the anchor the last gesture or Select settled on, -1 when the set is empty. Selection reports the whole set.
func (*GridView) Selection ¶
func (s *GridView) Selection() []int
Selection returns the whole selected set, ascending; empty when nothing is selected.
func (*GridView) SelectionMode ¶
func (s *GridView) SelectionMode() SelectionMode
SelectionMode returns the current selection model.
func (*GridView) SetAccessibleName ¶
func (n *GridView) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*GridView) SetAttr ¶
func (n *GridView) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*GridView) SetClasses ¶
func (n *GridView) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*GridView) SetColumnSpacing ¶
SetColumnSpacing sets the gap between columns; the stylesheet's horizontal border-spacing adds to it. A point in a gap hits no cell.
func (*GridView) SetCursorName ¶
func (n *GridView) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*GridView) SetDebugName ¶
func (n *GridView) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*GridView) SetElement ¶
func (n *GridView) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*GridView) SetEnabled ¶
func (n *GridView) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*GridView) SetFocusOnClick ¶
func (n *GridView) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*GridView) SetHAlign ¶
func (n *GridView) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*GridView) SetHExpand ¶
func (n *GridView) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*GridView) SetID ¶
func (n *GridView) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*GridView) SetInlineStyle ¶
func (n *GridView) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*GridView) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*GridView) SetLayoutMotion ¶
func (n *GridView) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*GridView) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*GridView) SetMaxColumns ¶
SetMaxColumns sets the most columns the grid lays out; zero lifts the cap.
func (*GridView) SetMaximumSize ¶
func (n *GridView) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*GridView) SetMinColumns ¶
SetMinColumns sets the fewest columns the grid lays out, even when cells end up narrower than their width.
func (*GridView) SetOnClickWithin ¶
func (n *GridView) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*GridView) SetOnFocusChanged ¶
func (n *GridView) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*GridView) SetOnHoverWithin ¶
func (n *GridView) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*GridView) SetOnPointer ¶
func (n *GridView) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*GridView) SetOnScroll ¶
func (n *GridView) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*GridView) SetRowSpacing ¶
SetRowSpacing sets the gap between lines; the stylesheet's vertical border-spacing adds to it.
func (*GridView) SetSelectionMode ¶
func (s *GridView) SetSelectionMode(mode SelectionMode)
SetSelectionMode switches the selection model. Leaving multiple mode keeps the lowest selected item as the single selection (or clears it when the set was empty); entering it seeds the set with the current selection and anchors there. The change notification fires when the switch changes the set.
func (*GridView) SetSharedElement ¶
func (n *GridView) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*GridView) SetSizeRequest ¶
func (n *GridView) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*GridView) SetState ¶
func (n *GridView) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*GridView) SetTooltip ¶
func (n *GridView) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*GridView) SetTooltipMarkup ¶
func (n *GridView) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*GridView) SetVAlign ¶
func (n *GridView) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*GridView) SetVExpand ¶
func (n *GridView) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*GridView) SetVisible ¶
func (n *GridView) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*GridView) SharedElement ¶
func (n *GridView) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*GridView) SizeRequest ¶
func (n *GridView) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*GridView) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*GridView) TooltipText ¶
func (n *GridView) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type HeaderBar ¶
type HeaderBar struct {
// OnDoubleClick fires on a second press inside the grab interval -
// the app wires it to maximize/restore.
OnDoubleClick func()
// contains filtered or unexported fields
}
HeaderBar is the CSD title bar: a start pack (left), the window title and subtitle (center), and an end pack with the window controls (right). Pressing the bar's own background moves the window (the app routes it to xdg_toplevel.move); a double press maximizes - both delivered through the WindowMover contract, so the bar works in any host that honors it. Styled as the `headerbar` element, its title as `headerbar title` (docs/css.md).
func NewHeaderBar ¶
NewHeaderBar returns a bar sized for face/sizePx content.
func (*HeaderBar) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*HeaderBar) Children ¶
func (c *HeaderBar) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*HeaderBar) Controls ¶
func (h *HeaderBar) Controls() *WindowControls
Controls returns the window controls, wiring them is the app's job:
bar.Controls().ShowClose(true) bar.Controls().OnClose = window.Close
func (*HeaderBar) HitTest ¶
HitTest resolves into the composed row with the CSD rule applied: a press that lands on a button stays a button press; anything else on the bar - background, title, spacers - is the move surface and resolves to the bar itself.
func (*HeaderBar) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*HeaderBar) PackEnd ¶
func (p *HeaderBar) PackEnd(w Widget)
PackEnd adds w to the trailing slot.
func (*HeaderBar) PackStart ¶
func (p *HeaderBar) PackStart(w Widget)
PackStart adds w to the leading slot.
func (*HeaderBar) SetSubtitle ¶
SetSubtitle sets the subtitle; empty hides it.
func (*HeaderBar) SetTitle ¶
SetTitle sets the window title; SetSubtitle the line under it (an empty subtitle hides the row).
func (*HeaderBar) WindowDoubleClick ¶
func (h *HeaderBar) WindowDoubleClick()
WindowDoubleClick implements WindowDoubleClickable: the second press fires the app-wired hook (maximize/restore).
func (*HeaderBar) WindowMoveGrab ¶
WindowMoveGrab implements WindowMover: presses on the bar's own chrome move the window.
type Highlighter ¶
Highlighter splits lines into styled spans (a GtkSourceView language). Highlight styles line given the state the line before it ended in (0 before the first line) and returns the state this one ends in, so a construct spanning lines — a multi-line string — carries on. Spans are rune ranges of the line, in order, not overlapping.
type HoverCard ¶
type HoverCard struct {
// contains filtered or unexported fields
}
HoverCard previews content beside a trigger: resting the pointer on the trigger opens the card after a delay, and it stays open while the pointer is on the trigger or the card, closing a moment after it leaves both. Keyboard focus on the trigger opens it the same way. The card takes no input grab: what the user points at keeps the keyboard. It styles as the `hovercard` element; the card's content as a .hovercard-content box.
func NewHoverCard ¶
NewHoverCard wraps trigger with a card showing content.
func (*HoverCard) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*HoverCard) Children ¶
func (c *HoverCard) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*HoverCard) FocusMoved ¶
FocusMoved implements FocusObserver: visible keyboard focus inside the trigger opens the card as the pointer does.
type HoverMover ¶
type HoverMover interface {
HoverMove(p Point)
}
HoverMover receives pointer motion while the widget is hovered, even without a press: menus highlight rows with it.
type HoverSetter ¶
type HoverSetter interface {
SetHovered(on bool)
}
HoverSetter receives hover tracking from the Router.
type IMEClient ¶
type IMEClient interface {
// IMEPreedit shows composing text at the caret; cursorBegin and
// cursorEnd are byte offsets into text marking the composing
// caret (both -1 hide it). Empty text ends composing. The
// composing text is display-only: Text and OnChanged stay
// untouched until a commit lands.
IMEPreedit(text string, cursorBegin, cursorEnd int)
// IMEDelete removes up to before bytes before the caret and
// after bytes after it, replacing any composing display.
IMEDelete(before, after int)
// IMECommit inserts committed text at the caret, replacing any
// composing display.
IMECommit(text string)
}
IMEClient is the widget side of an input method: an editable widget that shows composing (preedit) text and receives committed text. The methods are named after the zwp_text_input_v3 events they apply, and the host calls them in the done event's order.
type IMERevision ¶ added in v0.2.5
type IMERevision struct {
// contains filtered or unexported fields
}
IMERevision is a comparable stamp of one editable widget's text and caret; see IMETracker.IMERevision.
type IMETracker ¶
type IMETracker interface {
// IMERevision names the text and caret state IMESurrounding reports:
// while it stays equal, IMESurrounding would answer the same, so a
// host compares it instead of building the text.
IMERevision() IMERevision
// IMESurrounding returns at most limit bytes of text around the
// caret, on rune boundaries, with the cursor and anchor as byte
// offsets into it (an anchor outside the text sits at its edge),
// composing text excluded.
IMESurrounding(limit int) (text string, cursor, anchor int)
// IMECursorRect returns the caret rectangle in root coordinates,
// for the input method's candidate window.
IMECursorRect() render.Rect
// IMEMultiline reports multi-line content.
IMEMultiline() bool
}
IMETracker exposes an editable widget's text-input state for the set_surrounding_text and set_cursor_rectangle requests.
type Icon ¶
type Icon struct {
// contains filtered or unexported fields
}
Icon paints an icon at its natural size. The pixels come from one of four sources:
- NewIcon: a raster the caller already made (render.LoadSVG and friends); the widget draws it as is.
- NewThemeIcon: an icon theme name, resolved through the shared icons.Cache at the canvas device scale and re-resolved when the theme or the accent moves.
- NewFileIcon: an image file (png, svg, svgz).
- NewSVGIcon: embedded SVG bytes, for apps that ship their own glyphs.
A dynamic icon never reads or decodes on the UI loop: a paint draws what is decoded and otherwise asks for the decode off the loop, keeping the raster it has (nothing at first) until the result invalidates it. Without a running Application the decode runs inline at the paint.
Symbolic sources - -symbolic theme files and SVGs painting with currentColor - recolor to the theme Accent so glyphs follow the palette; SetTint pins a different color. The recoloring is a mask pass (render.Icon.Tint): alpha is kept, ink takes the tint, so gradients collapse to their alpha ramp - the symbolic contract.
func NewFileIcon ¶
NewFileIcon returns an icon widget that loads an image file (png, svg, svgz) and draws it at size logical pixels.
func NewSVGIcon ¶
NewSVGIcon returns an icon widget that rasterizes embedded SVG bytes at size logical pixels.
func NewThemeIcon ¶
NewThemeIcon returns an icon widget that resolves name from the icon theme at size logical pixels, rasterized at the canvas device scale. Symbolic icons recolor to the theme Accent. Resolution failures paint nothing and surface through Err.
func NewThemeIconFallback ¶
NewThemeIconFallback is NewThemeIcon with GTK's default fallbacks for app icons (GThemedIcon): a missing name resolves to its dash-shortened forms in turn, preferences-system-network to preferences-system, then preferences. A desktop entry's Icon= names a specific icon a theme may lack; the fallback re-resolves when the theme changes.
func (*Icon) AccessibleName ¶
func (n *Icon) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Icon) AddClass ¶
func (n *Icon) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Icon) AttachStylesheet ¶
func (n *Icon) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Icon) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Icon) Classes ¶
func (n *Icon) Classes() []string
Classes returns a copy of the widget's classes.
func (*Icon) DebugName ¶
func (n *Icon) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Icon) DetachStylesheet ¶
func (n *Icon) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Icon) Element ¶
func (n *Icon) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Icon) Enabled ¶
func (n *Icon) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Icon) Err ¶
Err returns the resolution failure of a dynamic icon: an unknown theme name, a missing file, or undecodable data. Nil until a decode a paint asked for has failed.
func (*Icon) HasState ¶
func (n *Icon) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Icon) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Icon) HoverWithin ¶
func (n *Icon) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Icon) InlineStyle ¶
func (n *Icon) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Icon) Invalidate ¶
func (n *Icon) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Icon) InvalidateLayout ¶
func (n *Icon) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Icon) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Icon) LayoutMotion ¶
func (n *Icon) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Icon) MaximumSize ¶
func (n *Icon) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Icon) Paint ¶
Paint draws the icon centered in the content box, as GtkImage centers its paintable (the CSS box layers first, when the stylesheet gives the icon any). Dynamic icons resolve first, re-rasterizing when the canvas device scale, the tint, the stylesheet's size, or the icon theme cache moved on since the last frame, with what is already decoded.
func (*Icon) Parent ¶
func (n *Icon) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Icon) RemoveAttr ¶
func (n *Icon) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Icon) RemoveClass ¶
func (n *Icon) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Icon) SetAccessibleName ¶
func (n *Icon) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Icon) SetAttr ¶
func (n *Icon) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Icon) SetClasses ¶
func (n *Icon) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Icon) SetCursorName ¶
func (n *Icon) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Icon) SetDebugName ¶
func (n *Icon) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Icon) SetElement ¶
func (n *Icon) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Icon) SetEnabled ¶
func (n *Icon) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Icon) SetFocusOnClick ¶
func (n *Icon) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Icon) SetHAlign ¶
func (n *Icon) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Icon) SetHExpand ¶
func (n *Icon) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Icon) SetID ¶
func (n *Icon) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Icon) SetInlineStyle ¶
func (n *Icon) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Icon) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Icon) SetLayoutMotion ¶
func (n *Icon) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Icon) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Icon) SetMaximumSize ¶
func (n *Icon) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Icon) SetOnClickWithin ¶
func (n *Icon) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Icon) SetOnFocusChanged ¶
func (n *Icon) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Icon) SetOnHoverWithin ¶
func (n *Icon) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Icon) SetOnPointer ¶
func (n *Icon) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Icon) SetOnScroll ¶
func (n *Icon) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Icon) SetSharedElement ¶
func (n *Icon) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Icon) SetSizeRequest ¶
func (n *Icon) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Icon) SetState ¶
func (n *Icon) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Icon) SetThemeName ¶
SetThemeName swaps a theme-resolved icon's name - the state-icon pattern (battery, volume, network): one widget, the glyph follows the state. A non-theme icon ignores the call; the next paint rasterizes the new glyph.
func (*Icon) SetTint ¶
SetTint pins the symbolic recolor color; the zero color (the default) follows the theme Accent. On a static icon the raster is already final, so the tint is applied once, immediately, and cannot be undone.
func (*Icon) SetTooltip ¶
func (n *Icon) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Icon) SetTooltipMarkup ¶
func (n *Icon) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Icon) SetVAlign ¶
func (n *Icon) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Icon) SetVExpand ¶
func (n *Icon) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Icon) SetVisible ¶
func (n *Icon) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Icon) SharedElement ¶
func (n *Icon) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Icon) SizeRequest ¶
func (n *Icon) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Icon) Tint ¶
Tint returns the pinned recolor color; the zero color (the default) follows the theme Accent.
func (*Icon) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Icon) TooltipText ¶
func (n *Icon) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type IconPosition ¶
type IconPosition uint8
IconPosition is which side of a BarButton's label its icon sits on.
const ( IconStart IconPosition = iota IconEnd )
The icon positions.
type Image ¶
type Image struct {
// OnLoaded fires on the loop goroutine once per settled
// asynchronous load, with the settled widget; check Err. It does
// not fire for synchronous sources, which are ready at
// construction.
OnLoaded func(img *Image)
// OnPasteImage fires on the loop goroutine when a pasted image
// (the ctrl+v payload it takes as a ContentPaster) finished decoding:
// the widget has already taken it as its source. The Image is the
// paste surface — Entry and TextArea are text-only by design.
OnPasteImage func(img image.Image)
// contains filtered or unexported fields
}
Image paints a raster image - album art, an avatar, a rendered snapshot - into its arranged box. It is the raster counterpart of Icon, which covers the SVG side.
Sources come in two decoding flavors:
- Synchronous: NewImage (a decoded image.Image) and NewBytesImage decode where they are constructed and simply paint from the first frame on.
- Asynchronous: NewFileImage and NewURLImage fetch and decode on a goroutine the first time they paint. Until the load settles they paint their placeholder color (transparent by default), and the result lands back on the loop goroutine through the invoker - Application.Invoke, the only sanctioned bridge (see docs/threading.md). OnLoaded then fires exactly once for that load, success or failure; check Err when it fires. Sources settle synchronously when no invoker is installed (no application running), and still fire OnLoaded - inline, on the goroutine that painted.
Pixels are resampled with the CatmullRom kernel to the device rect the policy places them in, so fractional scales stay crisp (stubbedev/lys-ui#14). Resamples are cached per (source, source rect, device size) in a shared LRU with a byte budget (internal/imgcache): painting the same image at the same size hits the cache and never rescales, and SetImage drops the old source's entries. A policy of ImageNone skips the cache entirely - nothing resamples. A file or URL source decodes divided by a power of two down to what its box shows, so a 96 px cover tile keeps no 3000 px picture, and decodes finer if the box outgrows that; it still measures at its natural size.
func NewBytesImage ¶
NewBytesImage returns an image widget around encoded image bytes (png, jpeg, gif), decoded synchronously from the cache when possible. name only labels decode errors.
func NewFileImage ¶
NewFileImage returns an image widget that loads an image file (png, jpeg, gif) on a goroutine at its first paint and draws it scaled by the widget's policy.
func NewImage ¶
NewImage returns an image widget around a decoded image. The widget keeps the reference; treat it as read-only after handoff. To show changed pixels, SetImage the raster again, as a render.VersionedImage at its next version and with the ID it keeps for the raster (render.NewImageID), so a GPU renderer updates its texture in place. A nil img paints nothing.
func NewURLImage ¶
NewURLImage returns an image widget that fetches an image over http(s) on a goroutine at its first paint and draws it scaled by the widget's policy.
func (*Image) AccessibleName ¶
func (n *Image) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Image) AddClass ¶
func (n *Image) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Image) AttachStylesheet ¶
func (n *Image) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Image) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Image) Classes ¶
func (n *Image) Classes() []string
Classes returns a copy of the widget's classes.
func (*Image) DebugName ¶
func (n *Image) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Image) DetachStylesheet ¶
func (n *Image) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Image) Element ¶
func (n *Image) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Image) Enabled ¶
func (n *Image) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Image) Err ¶
Err returns the load failure of the current source: a missing or undecodable file, a failed fetch, or undecodable bytes. Nil until a load tried and failed, and sticky until SetImage or friends replace the source.
func (*Image) HasState ¶
func (n *Image) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Image) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Image) HoverWithin ¶
func (n *Image) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Image) InlineStyle ¶
func (n *Image) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Image) Invalidate ¶
func (n *Image) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Image) InvalidateLayout ¶
func (n *Image) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Image) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Image) KeyAction ¶
KeyAction implements KeyActionHandler: an Image with an OnPasteImage hook is a paste target, so it joins focus traversal — the actions themselves are none of its own.
func (*Image) LayoutMotion ¶
func (n *Image) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Image) Loaded ¶
Loaded reports whether the current source has settled. Synchronous sources are loaded from construction on.
func (*Image) MaximumSize ¶
func (n *Image) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Image) Measure ¶
Measure is the decoded image's pictureRequest. An unsettled source measures 0 x 0; when the load lands, InvalidateLayout drops this cache so the next frame remeasures.
func (*Image) Paint ¶
Paint settles the source if needed, then draws: the placeholder while an async load is in flight, nothing after a failure, and otherwise the cached resample for the device rect the policy picked.
func (*Image) Parent ¶
func (n *Image) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Image) PasteContent ¶
PasteContent implements ContentPaster through PasteImage.
func (*Image) PasteImage ¶
PasteImage is the ctrl+v image path: the pasted encoded bytes (with the mime they arrived as, for error messages) become the widget's source, decoded off the loop goroutine through the same invoker bridge as file loads — a large PNG never stalls the loop — and then handed to OnPasteImage. Without an invoker the decode settles synchronously, like every other source.
func (*Image) PasteMimes ¶
PasteMimes implements ContentPaster: the image types, best first.
func (*Image) PlaceholderColor ¶
PlaceholderColor returns what fills the bounds while an asynchronous load is in flight; the zero color paints nothing.
func (*Image) RemoveAttr ¶
func (n *Image) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Image) RemoveClass ¶
func (n *Image) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Image) SetAccessibleName ¶
func (n *Image) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Image) SetAttr ¶
func (n *Image) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Image) SetClasses ¶
func (n *Image) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Image) SetCursorName ¶
func (n *Image) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Image) SetDebugName ¶
func (n *Image) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Image) SetElement ¶
func (n *Image) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Image) SetEnabled ¶
func (n *Image) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Image) SetFile ¶
SetFile swaps the source for a file path, reloaded asynchronously at the next paint.
func (*Image) SetFocusOnClick ¶
func (n *Image) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Image) SetHAlign ¶
func (n *Image) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Image) SetHExpand ¶
func (n *Image) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Image) SetID ¶
func (n *Image) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Image) SetImage ¶
SetImage swaps the source for a decoded image, dropping the previous source's cache entries and the measure caches that still describe the old size. The image is handed over as to NewImage.
func (*Image) SetInlineStyle ¶
func (n *Image) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Image) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Image) SetLayoutMotion ¶
func (n *Image) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Image) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Image) SetMaximumSize ¶
func (n *Image) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Image) SetOnClickWithin ¶
func (n *Image) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Image) SetOnFocusChanged ¶
func (n *Image) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Image) SetOnHoverWithin ¶
func (n *Image) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Image) SetOnPointer ¶
func (n *Image) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Image) SetOnScroll ¶
func (n *Image) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Image) SetPlaceholderColor ¶
SetPlaceholderColor sets what fills the bounds while an asynchronous load is in flight; the zero color (the default) paints nothing.
func (*Image) SetScale ¶
func (im *Image) SetScale(s ImageScale)
SetScale selects how the image fills its box: ImageFit (the default), ImageCover, or ImageNone.
func (*Image) SetSharedElement ¶
func (n *Image) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Image) SetSizeRequest ¶
func (n *Image) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Image) SetState ¶
func (n *Image) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Image) SetTooltip ¶
func (n *Image) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Image) SetTooltipMarkup ¶
func (n *Image) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Image) SetVAlign ¶
func (n *Image) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Image) SetVExpand ¶
func (n *Image) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Image) SetVisible ¶
func (n *Image) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Image) SharedElement ¶
func (n *Image) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Image) SizeRequest ¶
func (n *Image) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Image) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Image) TooltipText ¶
func (n *Image) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type ImageScale ¶
type ImageScale = render.ImageScale
ImageScale picks how an Image fills its arranged box. It aliases the render type so call sites never need render just for the constant.
type InputGroup ¶
type InputGroup struct {
// contains filtered or unexported fields
}
InputGroup is an entry with addons before and after it - icons, text, buttons - inside one shared border and one focus ring: the group draws the input's border, ring-colored while its entry has the focus, and the keyboard focus ring goes around the whole group. It styles as the `inputgroup` element; addon text and icons take the muted color.
func NewInputGroup ¶
func NewInputGroup(entry *Entry) *InputGroup
NewInputGroup returns a group around entry with no addons yet.
func (*InputGroup) Append ¶
func (g *InputGroup) Append(w Widget)
Append adds w as the last addon, after the entry.
func (*InputGroup) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*InputGroup) Children ¶
func (c *InputGroup) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*InputGroup) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*InputGroup) Prepend ¶
func (g *InputGroup) Prepend(w Widget)
Prepend adds w as the first addon, before the entry.
type InputOTP ¶
type InputOTP struct {
// OnChanged fires with the code after every edit; OnComplete when
// an edit fills the last empty slot.
OnChanged func(code string)
OnComplete func(code string)
// contains filtered or unexported fields
}
InputOTP is a one-time-code input: a fixed number of slots in groups, one character each, the groups split by a dash. It takes the focus as one field: typing fills the active slot and advances, Backspace and Delete clear, Left, Right, Home and End move, a paste fills from the active slot, and a click picks a slot. The focus ring goes around the active slot. It styles as the `inputotp` element with .slot boxes (the active one :checked) and .separator dashes.
func NewInputOTP ¶
func NewInputOTP(face render.Font, charset OTPCharset, groups ...int) *InputOTP
NewInputOTP returns an empty code input of the groups' slot counts: NewInputOTP(face, OTPDigits, 3, 3) is two groups of three. Every group holds at least one slot, or the call panics.
func (*InputOTP) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*InputOTP) Children ¶
func (c *InputOTP) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*InputOTP) ClickAt ¶
ClickAt implements Clicker: a click picks the slot under it, or the first empty one past the code.
func (*InputOTP) HitTest ¶
HitTest takes every press inside the bounds, so a click on a slot focuses the input.
func (*InputOTP) InsertRune ¶
InsertRune implements RuneHandler: an accepted character fills the active slot and advances; in a full code it overwrites the active slot.
func (*InputOTP) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*InputOTP) Paint ¶
Paint draws the slots, then the caret in an empty active slot while the input has the focus.
type InputRegioner ¶
InputRegioner is a window's content that takes input only inside its region: outside it, pointer input passes through the surface to whatever is beneath, as on an overlay layer. An empty region takes input everywhere. The window applies it after every layout, found through InputRegionOf.
type Inscription ¶
type Inscription struct {
// contains filtered or unexported fields
}
Inscription is GTK's Inscription: text sized by character and line counts instead of by its content, for cells in big lists and grids. Measure shapes nothing but one reference glyph: the minimum and natural widths are MinChars and NatChars of the face's average advance, the heights MinLines and NatLines of its line height. Paint draws as many lines as fit, each ellipsized at the end.
func NewInscription ¶
NewInscription returns an inscription of text: 3 characters minimum, 10 natural, one line.
func (*Inscription) AccessibleName ¶
func (n *Inscription) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Inscription) AddClass ¶
func (n *Inscription) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Inscription) Arrange ¶
func (in *Inscription) Arrange(r render.Rect)
Arrange records the bounds.
func (*Inscription) AttachStylesheet ¶
func (n *Inscription) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Inscription) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Inscription) Classes ¶
func (n *Inscription) Classes() []string
Classes returns a copy of the widget's classes.
func (*Inscription) DebugName ¶
func (n *Inscription) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Inscription) DetachStylesheet ¶
func (n *Inscription) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Inscription) Element ¶
func (n *Inscription) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Inscription) Enabled ¶
func (n *Inscription) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Inscription) HAlign ¶
func (n *Inscription) HAlign() Align
HAlign returns the horizontal placement.
func (*Inscription) HasState ¶
func (n *Inscription) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Inscription) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Inscription) HitTest ¶
func (in *Inscription) HitTest(p Point) Widget
HitTest returns the inscription when p is inside it.
func (*Inscription) HoverWithin ¶
func (n *Inscription) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Inscription) ID ¶
func (n *Inscription) ID() string
ID returns the style id, empty when none is set.
func (*Inscription) InlineStyle ¶
func (n *Inscription) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Inscription) Invalidate ¶
func (n *Inscription) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Inscription) InvalidateLayout ¶
func (n *Inscription) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Inscription) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Inscription) LayoutMotion ¶
func (n *Inscription) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Inscription) MaximumSize ¶
func (n *Inscription) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Inscription) Measure ¶
func (in *Inscription) Measure(axis Axis, forSize int) Sizes
Measure claims the natural character and line counts' extent, never below the minimum.
func (*Inscription) Paint ¶
func (in *Inscription) Paint(cv *render.Canvas)
Paint draws the lines that fit, each ellipsized to the width.
func (*Inscription) Parent ¶
func (n *Inscription) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Inscription) RemoveAttr ¶
func (n *Inscription) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Inscription) RemoveClass ¶
func (n *Inscription) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Inscription) SetAccessibleName ¶
func (n *Inscription) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Inscription) SetAlignment ¶
func (in *Inscription) SetAlignment(a render.Alignment)
SetAlignment sets the horizontal text alignment.
func (*Inscription) SetAttr ¶
func (n *Inscription) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Inscription) SetClasses ¶
func (n *Inscription) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Inscription) SetColor ¶
func (in *Inscription) SetColor(c render.Color)
SetColor sets the ink.
func (*Inscription) SetCursorName ¶
func (n *Inscription) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Inscription) SetDebugName ¶
func (n *Inscription) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Inscription) SetElement ¶
func (n *Inscription) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Inscription) SetEnabled ¶
func (n *Inscription) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Inscription) SetFocusOnClick ¶
func (n *Inscription) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Inscription) SetHAlign ¶
func (n *Inscription) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Inscription) SetHExpand ¶
func (n *Inscription) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Inscription) SetID ¶
func (n *Inscription) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Inscription) SetInlineStyle ¶
func (n *Inscription) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Inscription) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Inscription) SetLayoutMotion ¶
func (n *Inscription) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Inscription) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Inscription) SetMaximumSize ¶
func (n *Inscription) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Inscription) SetMinChars ¶
func (in *Inscription) SetMinChars(n int)
SetMinChars sets the minimum width in characters.
func (*Inscription) SetMinLines ¶
func (in *Inscription) SetMinLines(n int)
SetMinLines sets the minimum height in lines.
func (*Inscription) SetNatChars ¶
func (in *Inscription) SetNatChars(n int)
SetNatChars sets the natural width in characters.
func (*Inscription) SetNatLines ¶
func (in *Inscription) SetNatLines(n int)
SetNatLines sets the natural height in lines.
func (*Inscription) SetOnClickWithin ¶
func (n *Inscription) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Inscription) SetOnFocusChanged ¶
func (n *Inscription) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Inscription) SetOnHoverWithin ¶
func (n *Inscription) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Inscription) SetOnPointer ¶
func (n *Inscription) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Inscription) SetOnScroll ¶
func (n *Inscription) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Inscription) SetSharedElement ¶
func (n *Inscription) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Inscription) SetSizeRequest ¶
func (n *Inscription) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Inscription) SetState ¶
func (n *Inscription) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Inscription) SetText ¶
func (in *Inscription) SetText(s string)
SetText replaces the text. The size does not depend on it, so only a repaint follows.
func (*Inscription) SetTooltip ¶
func (n *Inscription) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Inscription) SetTooltipMarkup ¶
func (n *Inscription) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Inscription) SetVAlign ¶
func (n *Inscription) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Inscription) SetVExpand ¶
func (n *Inscription) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Inscription) SetVisible ¶
func (n *Inscription) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Inscription) SharedElement ¶
func (n *Inscription) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Inscription) SizeRequest ¶
func (n *Inscription) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Inscription) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Inscription) TooltipText ¶
func (n *Inscription) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item is a content row: media - an icon on a muted tile, an avatar - then a title over a description, then actions, for lists and cards. Its text and media update in place, so a live list reconciles rows instead of rebuilding them, and SetOnActivate makes the whole row a control (click, Enter, Space). It styles as the `item` element with the variant's class (.outline, .muted), .small for the small size, .activatable while it activates, its .media tile, .title and .description.
func (*Item) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*Item) Children ¶
func (c *Item) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Item) HitTest ¶
HitTest resolves an activatable item to itself, but for its action buttons; a plain item hits its parts.
func (*Item) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*Item) SetDescription ¶
SetDescription replaces the description; empty hides its line.
func (*Item) SetEllipsize ¶
SetEllipsize keeps the title and the description on one line each, ending in an ellipsis when the row is too narrow, instead of wrapping: a one-token name (a device's address) then no longer sets the row's minimum width and pushes its actions out.
func (*Item) SetMedia ¶
SetMedia leads the row with w on a muted 32px tile (an icon), or as it is when bare (an avatar, an image); nil removes it.
func (*Item) SetOnActivate ¶
func (it *Item) SetOnActivate(fn func())
SetOnActivate makes the whole row a control running fn on a click outside its actions, Enter or Space, with the hover fill and the focus ring; nil makes it a plain row again.
func (*Item) SetVariant ¶
func (it *Item) SetVariant(v ItemVariant)
SetVariant switches the item's look.
type ItemGroup ¶
type ItemGroup struct {
// contains filtered or unexported fields
}
ItemGroup stacks Items into one list, a separator between each item and the next. It styles as the `itemgroup` element.
func NewItemGroup ¶
NewItemGroup returns a group of items, in order.
func (*ItemGroup) Append ¶
Append adds w at the end, after a separator when the group already holds an item.
func (*ItemGroup) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*ItemGroup) Children ¶
func (c *ItemGroup) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*ItemGroup) Measure ¶
Measure shows a separator only between two shown items, as a GTK boxed list does, then measures the stack: a hidden item takes the separators beside it with it.
type ItemVariant ¶
type ItemVariant uint8
ItemVariant picks an Item's look.
const ( // ItemDefault is a plain row. ItemDefault ItemVariant = iota // ItemOutline draws a border around it. ItemOutline // ItemMuted gives it the muted fill. ItemMuted )
The item variants.
type Justify ¶
type Justify uint8
Justify is how a wrapping line uses the width its children leave over (adw WrapBox's justify, plus the alignment of the rest).
const ( // JustifyStart packs children at the start edge (the default). JustifyStart Justify = iota // JustifyCenter centers each line. JustifyCenter // JustifyEnd packs children at the end edge. JustifyEnd // JustifyFill grows every child of a line by an equal share. JustifyFill // JustifySpread widens the gaps between a line's children. JustifySpread )
Justifications.
type KeyAction ¶
type KeyAction uint8
KeyAction is an editing or activation action derived from a keyboard event.
const ( KeyBackspace KeyAction = iota KeyDelete KeyLeft KeyRight KeyUp KeyDown KeyHome KeyEnd KeyEnter KeyPriorPage KeyNextPage KeyDismiss KeySpace // KeyContextMenu opens the focused widget's context menu: the Menu // key, or Shift+F10. KeyContextMenu )
Editing and activation actions, derived from keysyms by KeyActionForSym. KeyBackspace is zero, so the zero KeyAction is the common delete-backward edit.
type KeyActionHandler ¶
KeyActionHandler receives editing and activation actions with the modifiers held at the time.
type KeyInterceptor ¶
KeyInterceptor is an ancestor that pre-empts a focused widget's key actions (GTK's KeyControllerKeyPressed on a parent). target is the focused widget the action was headed for; InterceptKey returns true when it consumed the action.
type Label ¶
type Label struct {
// contains filtered or unexported fields
}
Label paints text. It is passive: it hits as itself but has no interaction behavior.
The default is one line whose text overflows a narrow arrangement and clips. SetWrap turns on word wrapping at the width it is given - Measure then reports one line height per wrapped row - and SetEllipsize truncates with an ellipsis instead, at the start, middle, or end. With both on, wrapping fills rows and the ellipsis applies to the final row only (GTK's rule): a lone unbreakable token left overflowing there truncates rather than spilling. A label too small for its text is the classic tooltip case: keep the full text in SetTooltip and let the mode shorten what paints.
func NewLabel ¶
NewLabel returns a label that paints text with face at sizePx pixels in color. Face may be a render.Chain for mixed-script fallback. Constructor argument order is the toolkit-wide one: face, then sizePx, then the content, then colors. A nil face panics here (see requireFace) instead of failing later, in shaping.
func (*Label) AccessibleName ¶
func (n *Label) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Label) AddClass ¶
func (n *Label) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Label) AttachStylesheet ¶
func (n *Label) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Label) Baseline ¶
Baseline implements Baseliner: the first line inside the CSS box, raised or lowered by vertical-align (sub, super, a length, or a percentage resolved against the line-height at compute time).
func (*Label) BindText ¶
BindText wires the binding one-way to the label's text: a label never edits, so nothing writes back.
func (*Label) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Label) CharsWithin ¶
CharsWithin is how many approximate character widths fit in px, the max-width-chars that holds the label's natural width to px.
func (*Label) Classes ¶
func (n *Label) Classes() []string
Classes returns a copy of the widget's classes.
func (*Label) Color ¶
Color returns the label's current programmatic ink, or 0 when the label inherits.
func (*Label) DebugName ¶
func (n *Label) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Label) DetachStylesheet ¶
func (n *Label) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Label) Element ¶
func (n *Label) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Label) Ellipsize ¶
func (l *Label) Ellipsize() EllipsizeMode
Ellipsize returns the label's truncation mode.
func (*Label) Enabled ¶
func (n *Label) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Label) HasState ¶
func (n *Label) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Label) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Label) HoverWithin ¶
func (n *Label) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Label) InlineStyle ¶
func (n *Label) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Label) Invalidate ¶
func (n *Label) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Label) InvalidateLayout ¶
func (n *Label) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Label) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Label) LayoutMotion ¶
func (n *Label) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Label) MaxWidthChars ¶
MaxWidthChars returns the width cap in characters, 0 when uncapped.
func (*Label) MaximumSize ¶
func (n *Label) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Label) Measure ¶
Measure reports the text's request inside the CSS box (padding, border, margin, min sizes), GTK's label measure. Across: its natural width is the text unwrapped; its minimum is the ellipsis when it ellipsizes, else the widest word when it wraps, else the whole text, so it overflows rather than clip; max-width-chars holds the natural width of one that can narrow, and width-chars floors both. Down: the rows it lays out at the width it is given, or at its natural width before any. Widths round up: Paint ellipsizes (and wraps) against the raw advance, so a width rounded to nearest would truncate a text laid out at exactly its natural size.
func (*Label) Paint ¶
Paint draws the label's CSS layers (when the stylesheet gives it any), then the text inside the content box: the rows when the label is multiline, the single line ellipsized as configured otherwise.
func (*Label) Parent ¶
func (n *Label) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Label) RemoveAttr ¶
func (n *Label) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Label) RemoveClass ¶
func (n *Label) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Label) SetAccessibleName ¶
func (n *Label) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Label) SetAlignment ¶
SetAlignment selects horizontal placement when the arranged rect is wider than the text; wrapped rows align individually.
func (*Label) SetAttr ¶
func (n *Label) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Label) SetClasses ¶
func (n *Label) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Label) SetColor ¶
SetColor sets the label's programmatic ink, the dynamic counterpart of NewLabel's color argument: modules that restyle per state (battery thresholds, workspace focus) call it instead of rebuilding the label. A stylesheet color declaration still outranks it, per the cascade; 0 is the no-color value and falls through to the theme.
func (*Label) SetCursorName ¶
func (n *Label) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Label) SetDebugName ¶
func (n *Label) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Label) SetDirection ¶
SetDirection selects the base paragraph direction the text resolves and lays out with. DirectionAuto (the default) reads it off the text's first strong character, so a Hebrew- or Arabic-first label mirrors on its own; DirectionLTR and DirectionRTL force the base, and start/end alignment mirrors with it. Changing the direction re-resolves the text and drops the measure cache.
func (*Label) SetElement ¶
func (n *Label) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Label) SetEllipsize ¶
func (l *Label) SetEllipsize(mode EllipsizeMode)
SetEllipsize selects where an overflowing line truncates with an ellipsis: at the end, at the start, in the middle (paths and filenames), or not at all. With wrap on, the ellipsis applies to the final row only; otherwise it applies to the single line. The label's text is never rewritten - pair the mode with SetTooltip to keep the whole string reachable. Changing the mode drops the measure cache.
func (*Label) SetEnabled ¶
func (n *Label) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Label) SetFace ¶
SetFace swaps the shaping face (a fallback chain works here too); the shaped caches drop and the bounds invalidate.
func (*Label) SetFocusOnClick ¶
func (n *Label) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Label) SetHAlign ¶
func (n *Label) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Label) SetHExpand ¶
func (n *Label) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Label) SetID ¶
func (n *Label) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Label) SetInlineStyle ¶
func (n *Label) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Label) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Label) SetLayoutMotion ¶
func (n *Label) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Label) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Label) SetMaxLines ¶
SetMaxLines limits a wrapping, ellipsizing label to n rows (GTK's set_lines): the text past row n folds into the final row, which the ellipsize mode truncates. Like GTK it has no effect unless the label both wraps and ellipsizes. n <= 0 removes the limit.
func (*Label) SetMaxWidthChars ¶
SetMaxWidthChars caps the label's natural width at n approximate character widths (GTK's max-width-chars): longer text overflows the cap and truncates by the ellipsize mode. n <= 0 removes the cap.
func (*Label) SetMaximumSize ¶
func (n *Label) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Label) SetOnClickWithin ¶
func (n *Label) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Label) SetOnFocusChanged ¶
func (n *Label) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Label) SetOnHoverWithin ¶
func (n *Label) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Label) SetOnPointer ¶
func (n *Label) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Label) SetOnScroll ¶
func (n *Label) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Label) SetSharedElement ¶
func (n *Label) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Label) SetSizePx ¶
SetSizePx changes the shaping size; the shaped caches drop and the bounds invalidate.
func (*Label) SetSizeRequest ¶
func (n *Label) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Label) SetState ¶
func (n *Label) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Label) SetTooltip ¶
func (n *Label) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Label) SetTooltipMarkup ¶
func (n *Label) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Label) SetVAlign ¶
func (n *Label) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Label) SetVExpand ¶
func (n *Label) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Label) SetVisible ¶
func (n *Label) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Label) SetWidthChars ¶
SetWidthChars floors the label's natural width at n approximate character widths (GTK's width-chars): a shorter text still measures that wide, so labels of one row line up. n <= 0 restores the text's own width.
func (*Label) SetWrap ¶
SetWrap toggles word wrapping at the width the label is given. Measure then needs only the widest word and reports one line height per row at a width, breaking at Unicode UAX #14 opportunities (spaces, hyphens, CJK); a run with no opportunity before the width - an unbreakable token - keeps its own row and overflows, clipped, never disappearing. Changing the mode drops the measure cache.
func (*Label) SharedElement ¶
func (n *Label) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Label) SizeRequest ¶
func (n *Label) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Label) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Label) TooltipText ¶
func (n *Label) TooltipText() string
TooltipText returns the hover text, empty when none is set.
func (*Label) Visible ¶
func (n *Label) Visible() bool
Visible reports the widget's own visibility flag, not the effective state: a widget inside an invisible container still reads true. Layout, Paint, and HitTest paths consult widget.IsVisible, which folds the ancestors in.
func (*Label) WidthChars ¶
WidthChars returns the natural-width floor in characters, 0 when unset.
type LayoutMotion ¶
type LayoutMotion = style.LayoutMotion
LayoutMotion is how a widget animates a change of its laid-out rect: not at all, or on one of the named springs. The stylesheet's -lys-layout-motion outranks it, as it outranks every constructor default; containers opt their children in with a selector (`.list > * { -lys-layout-motion: smooth; }`).
type LevelBar ¶
type LevelBar struct {
// contains filtered or unexported fields
}
LevelBar is GTK's continuous level bar: the levelbar element over a trough and one filled block (levelbar > trough > block.filled), the node tree stylesheets target for gauges. Every part paints from its cascade - there is no programmatic color; the theme layer gives the trough the view color and the offsets their tints, and a stylesheet overrides either. Offsets classify the value: the block carries the name of the lowest offset at or above it, so `levelbar block.low` restyles a nearly empty gauge.
func NewLevelBar ¶
NewLevelBar returns a continuous level bar at value clamped to [0, 1], with GTK's default offsets (low 0.25, high 0.75, full 1).
func (*LevelBar) Arrange ¶
Arrange records the bar's border box and lays the trough across its content box at the trough's own height, centered, so a bar given more height than its trough keeps a thin trough.
func (*LevelBar) Block ¶
Block returns the filled block node (levelbar > trough > block.filled), the diagnostic view a paint test reads.
func (*LevelBar) Offsets ¶
func (b *LevelBar) Offsets() []LevelOffset
Offsets reports the thresholds, lowest first.
func (*LevelBar) RemoveOffset ¶
RemoveOffset drops the named threshold.
type LevelOffset ¶
LevelOffset is a named threshold: while the value is at or below it (and above every lower one), the block carries Name as a class.
type List ¶
type List struct {
OnSelect func(i int)
OnActivate func(i int)
OnSelectionChanged func(rows []int)
// OnPointer sees every button press on the list first, with the
// row under it (-1 below the last row); a true return consumes the
// press, so no selection, activation or drag follows.
OnPointer func(row int, e PointerEvent) bool
// OnScroll sees every wheel step over the list first, with the row
// under the pointer (-1 below the last row); a true return
// consumes the step instead of scrolling.
OnScroll func(row int, e ScrollEvent) bool
// DragContent, when set, lets the selection be dragged out to other
// applications, the way a file manager's is: a press on a selected
// row that moves past the drag threshold offers DragContent of the
// rows dragged - the whole selection in multiple mode, the pressed
// row otherwise - instead of moving the selection. A press on an
// unselected row still selects, rubber-bands and motion-selects;
// nil (or a nil return) drags nothing.
DragContent func(rows []int) *DragContent
// contains filtered or unexported fields
}
List is a virtualized list view: only the rows inside the viewport are requested from the model, measured, and painted, so ten thousand rows cost about the same as ten. Selection is pointer and keyboard driven, clamps at the ends, and Enter activates.
The selection model is SetSelectionMode: single (the default), none, browse, or multiple. Selection reports the whole selected set and OnSelectionChanged fires once per gesture with it; OnSelect keeps its single-row meaning in single and browse mode and stays silent in multiple mode.
Pointer gestures land on a row proxy the List keeps over every visible row: the proxy forwards what the row widget itself implements (clicks, hover and press tracking, tooltips, cursor names) while the List owns selection. In selectable modes the proxy's drag is the List's (rubber-band in multiple, motion-select in single and browse); rows that need their own drag behavior belong in a SelectionNone list. In multiple mode a row that contains a CheckButton cedes the check to the selection model: the check reflects row membership and clicking it toggles membership instead of the check's own state.
func NewList ¶
NewList wraps a model with a uniform row height in pixels; zero derives the height from measuring the first row.
func (*List) AccessibleName ¶
func (n *List) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*List) AddClass ¶
func (n *List) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*List) Arrange ¶
Arrange records the border box inside r and lays the viewport out in its content box.
func (*List) AttachStylesheet ¶
func (n *List) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*List) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*List) Changed ¶
func (l *List) Changed()
Changed re-queries the model after its data changed, keeping cached row widgets whose indices still exist.
func (*List) Children ¶
Children returns the realized rows in model order: the rows on screen, each the proxy around its model widget. Rows off screen do not exist.
func (*List) Classes ¶
func (n *List) Classes() []string
Classes returns a copy of the widget's classes.
func (*List) ClickAt ¶
ClickAt applies a press-and-release on the list itself: a row hit that no proxy covers (a partially visible last row, say) selects that row per the mode.
func (*List) DebugName ¶
func (n *List) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*List) DetachStylesheet ¶
func (n *List) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*List) DragMove ¶
DragMove implements DragMover for presses on the list itself; see dragApply.
func (*List) Element ¶
func (n *List) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*List) Enabled ¶
func (n *List) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*List) HasState ¶
func (n *List) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*List) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*List) HitTest ¶
HitTest returns the row proxy under p, or the list itself where no item is (see itemAt).
func (*List) HoverMove ¶
HoverMove implements HoverMover: tracks the hovered row for styling and per-row tooltips, none where no item is under the pointer. Browse mode selects the hovered row (focus follows the pointer). Disabled lists highlight nothing.
func (*List) HoverWithin ¶
func (n *List) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*List) InlineStyle ¶
func (n *List) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*List) Invalidate ¶
func (n *List) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*List) InvalidateLayout ¶
func (n *List) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*List) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*List) KeyAction ¶
KeyAction implements KeyActionHandler: selection motion clamps at the ends (pinned), PageUp/PageDown move a viewport of rows, and Enter activates exactly once per press. Multiple mode adds the cursor/anchor gestures; none mode ignores selection keys. Disabled lists ignore keys.
func (*List) LayoutMotion ¶
func (n *List) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*List) MaximumSize ¶
func (n *List) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*List) Measure ¶
Measure reports a cell's width (or 120 for rows) by the full content height at the width given, held to the max height, inside the list's CSS box: the list is the viewport, not the content. It needs one row: a short parent gets the rest back and the list scrolls it.
func (*List) Paint ¶
Paint draws the viewport background, the cursor ring, and exactly the visible rows; the rows paint their own hover and selection fills (the `row` node's CSS box).
func (*List) Parent ¶
func (n *List) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*List) PressEnd ¶
func (l *List) PressEnd()
PressEnd implements PressEnder: closes the gesture started by the press, landing the held selection notification.
func (*List) Refresh ¶
func (l *List) Refresh()
Refresh re-queries every row widget, keeping the selection and the scroll: the rows' data changed in place (a column resized, a thumbnail arrived), where Changed would keep showing the cached widgets.
func (*List) RemoveAttr ¶
func (n *List) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*List) RemoveClass ¶
func (n *List) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*List) Reset ¶
func (l *List) Reset()
Reset is for a model whose rows were replaced wholesale (a folder listing for another folder): every cached row widget, the selection and the scroll go, and OnSelectionChanged fires when a selection was dropped.
func (*List) ScrollEnd ¶
func (l *List) ScrollEnd()
ScrollEnd implements ScrollEnder: the list glides on from the gesture's velocity.
func (*List) ScrollPixels ¶
ScrollPixels implements PixelScroller: exact vertical deltas, the fraction kept for the next one.
func (*List) Select ¶
func (s *List) Select(i int)
Select moves the selection to item i (clamped, -1 clears). In multiple mode it collapses the set to the one item (-1 clears it); in none mode it does nothing.
func (*List) SelectAll ¶
func (s *List) SelectAll()
SelectAll selects every item. It is the ctrl+a target through Router.SelectAll and does nothing outside multiple mode, where "all" is not a representable selection.
func (*List) SelectRows ¶
func (s *List) SelectRows(rows ...int)
SelectRows makes rows the multiple-mode selection (out-of-range rows are dropped) and notifies; outside multiple mode it does nothing.
func (*List) Selected ¶
func (s *List) Selected() int
Selected returns the selected item in single and browse mode; in multiple mode the anchor the last gesture or Select settled on, -1 when the set is empty. Selection reports the whole set.
func (*List) Selection ¶
func (s *List) Selection() []int
Selection returns the whole selected set, ascending; empty when nothing is selected.
func (*List) SelectionMode ¶
func (s *List) SelectionMode() SelectionMode
SelectionMode returns the current selection model.
func (*List) SetAccessibleName ¶
func (n *List) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*List) SetAttr ¶
func (n *List) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*List) SetCellWidth ¶
SetCellWidth switches the list into a grid: items flow left to right in as many equal columns of at least w pixels as the width fits, every line the row height tall, still virtualized by line. Up and down move a line, left and right one item. Zero is a plain list.
func (*List) SetClasses ¶
func (n *List) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*List) SetCursorName ¶
func (n *List) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*List) SetDebugName ¶
func (n *List) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*List) SetElement ¶
func (n *List) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*List) SetEnabled ¶
func (n *List) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*List) SetFocusOnClick ¶
func (n *List) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*List) SetHAlign ¶
func (n *List) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*List) SetHExpand ¶
func (n *List) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*List) SetID ¶
func (n *List) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*List) SetInlineStyle ¶
func (n *List) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*List) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*List) SetLayoutMotion ¶
func (n *List) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*List) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*List) SetMaxHeight ¶
SetMaxHeight caps the list's natural height at h pixels (0 lifts the cap): a longer model scrolls inside it, still virtualized - GTK's list in a scrolled window with a max content height.
func (*List) SetMaximumSize ¶
func (n *List) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*List) SetOnClickWithin ¶
func (n *List) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*List) SetOnFocusChanged ¶
func (n *List) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*List) SetOnHoverWithin ¶
func (n *List) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*List) SetOnPointer ¶
func (n *List) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*List) SetOnScroll ¶
func (n *List) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*List) SetPressed ¶
SetPressed implements PressSetter: true begins a pointer gesture on the list itself, false only clears the row's own pressed tracking.
func (*List) SetSelectionMode ¶
func (s *List) SetSelectionMode(mode SelectionMode)
SetSelectionMode switches the selection model. Leaving multiple mode keeps the lowest selected item as the single selection (or clears it when the set was empty); entering it seeds the set with the current selection and anchors there. The change notification fires when the switch changes the set.
func (*List) SetSharedElement ¶
func (n *List) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*List) SetSingleClickActivate ¶
SetSingleClickActivate makes a plain click activate the row (OnActivate) as well as select it, GTK's single-click-activate: a picker's rows act on one click. Multiple-selection lists keep clicks for membership.
func (*List) SetSizeRequest ¶
func (n *List) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*List) SetState ¶
func (n *List) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*List) SetTooltip ¶
func (n *List) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*List) SetTooltipMarkup ¶
func (n *List) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*List) SetVAlign ¶
func (n *List) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*List) SetVExpand ¶
func (n *List) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*List) SetVisible ¶
func (n *List) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*List) SharedElement ¶
func (n *List) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*List) SizeRequest ¶
func (n *List) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*List) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*List) TooltipText ¶
func (n *List) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type ListBox ¶
type ListBox struct {
OnSelectionChanged func(rows []int)
OnActivate func(i int)
// contains filtered or unexported fields
}
ListBox is a non-virtualized list of rows: every row is a child widget kept in the tree, measured and painted in order, so it is for short lists where a List's viewport recycling would be overhead. Selection is pointer and keyboard driven through the embedded selection model; OnSelectionChanged fires once per gesture, OnActivate on row activation (a double-click or a single click when SetSingleClickActivate is on).
func NewListBox ¶
func NewListBox() *ListBox
NewListBox returns an empty single-select ListBox styled as a boxed list (CSS class boxedList).
func (*ListBox) AccessibleName ¶
func (n *ListBox) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*ListBox) AddClass ¶
func (n *ListBox) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*ListBox) Append ¶
func (l *ListBox) Append(w Widget) *ListBoxRow
Append adds w as a new row at the end and returns the row.
func (*ListBox) AttachStylesheet ¶
func (n *ListBox) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*ListBox) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*ListBox) Children ¶
Children returns the rows in order, then the placeholder: what tree walks (the restyle pass, focus traversal, the accessibility bridge) descend into, as for every container.
func (*ListBox) Classes ¶
func (n *ListBox) Classes() []string
Classes returns a copy of the widget's classes.
func (*ListBox) DebugName ¶
func (n *ListBox) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*ListBox) DetachStylesheet ¶
func (n *ListBox) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*ListBox) Element ¶
func (n *ListBox) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*ListBox) Enabled ¶
func (n *ListBox) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*ListBox) HasState ¶
func (n *ListBox) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*ListBox) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*ListBox) HitTest ¶
HitTest returns the topmost visible row under p, or the placeholder when it is shown, or the list itself.
func (*ListBox) HoverWithin ¶
func (n *ListBox) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*ListBox) InlineStyle ¶
func (n *ListBox) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*ListBox) Insert ¶
func (l *ListBox) Insert(i int, w Widget) *ListBoxRow
Insert adds w as a new row at position i (clamped to the ends) and returns the row.
func (*ListBox) Invalidate ¶
func (n *ListBox) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*ListBox) InvalidateFilter ¶
func (l *ListBox) InvalidateFilter()
InvalidateFilter re-runs the filter and relayouts.
func (*ListBox) InvalidateHeaders ¶
func (l *ListBox) InvalidateHeaders()
InvalidateHeaders reruns every row's header builder and relayouts.
func (*ListBox) InvalidateLayout ¶
func (n *ListBox) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*ListBox) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*ListBox) InvalidateSort ¶
func (l *ListBox) InvalidateSort()
InvalidateSort re-runs the sort and relayouts.
func (*ListBox) KeyAction ¶
KeyAction forwards a keyboard action to the selection model when the list is enabled.
func (*ListBox) LayoutMotion ¶
func (n *ListBox) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*ListBox) MaximumSize ¶
func (n *ListBox) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*ListBox) Measure ¶
Measure reports the widest visible row by their total height (or the placeholder's request), at least the minimum height.
func (*ListBox) Move ¶
Move relocates the row at from to position to (both clamped to the row range), adjusting the selection to follow.
func (*ListBox) Paint ¶
Paint draws the box background, the row separators, and the visible rows in order.
func (*ListBox) Parent ¶
func (n *ListBox) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*ListBox) RemoveAt ¶
RemoveAt removes the row at position i, doing nothing when i is out of range.
func (*ListBox) RemoveAttr ¶
func (n *ListBox) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*ListBox) RemoveClass ¶
func (n *ListBox) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*ListBox) RowAt ¶
func (l *ListBox) RowAt(i int) *ListBoxRow
RowAt returns the row at position i, or nil when i is out of range.
func (*ListBox) Select ¶
func (s *ListBox) Select(i int)
Select moves the selection to item i (clamped, -1 clears). In multiple mode it collapses the set to the one item (-1 clears it); in none mode it does nothing.
func (*ListBox) SelectAll ¶
func (s *ListBox) SelectAll()
SelectAll selects every item. It is the ctrl+a target through Router.SelectAll and does nothing outside multiple mode, where "all" is not a representable selection.
func (*ListBox) SelectRows ¶
func (s *ListBox) SelectRows(rows ...int)
SelectRows makes rows the multiple-mode selection (out-of-range rows are dropped) and notifies; outside multiple mode it does nothing.
func (*ListBox) Selected ¶
func (s *ListBox) Selected() int
Selected returns the selected item in single and browse mode; in multiple mode the anchor the last gesture or Select settled on, -1 when the set is empty. Selection reports the whole set.
func (*ListBox) Selection ¶
func (s *ListBox) Selection() []int
Selection returns the whole selected set, ascending; empty when nothing is selected.
func (*ListBox) SelectionMode ¶
func (s *ListBox) SelectionMode() SelectionMode
SelectionMode returns the current selection model.
func (*ListBox) SetAccessibleName ¶
func (n *ListBox) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*ListBox) SetAttr ¶
func (n *ListBox) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*ListBox) SetClasses ¶
func (n *ListBox) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*ListBox) SetCursorName ¶
func (n *ListBox) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*ListBox) SetDebugName ¶
func (n *ListBox) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*ListBox) SetElement ¶
func (n *ListBox) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*ListBox) SetEnabled ¶
func (n *ListBox) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*ListBox) SetFilterFunc ¶
func (l *ListBox) SetFilterFunc(keep func(*ListBoxRow) bool)
SetFilterFunc installs a filter: rows where keep returns false are hidden, and the list is recomputed. A nil keep clears the filter.
func (*ListBox) SetFocusOnClick ¶
func (n *ListBox) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*ListBox) SetHAlign ¶
func (n *ListBox) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*ListBox) SetHExpand ¶
func (n *ListBox) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*ListBox) SetHeaderFunc ¶
func (l *ListBox) SetHeaderFunc(fn func(*ListBoxRow) Widget)
SetHeaderFunc installs a header builder: fn is called per row to produce its header widget (nil for none), and the headers are rerun. A nil fn clears all headers.
func (*ListBox) SetID ¶
func (n *ListBox) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*ListBox) SetInlineStyle ¶
func (n *ListBox) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*ListBox) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*ListBox) SetLayoutMotion ¶
func (n *ListBox) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*ListBox) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*ListBox) SetMaximumSize ¶
func (n *ListBox) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*ListBox) SetMinHeight ¶
SetMinHeight floors the height the list measures to, in logical pixels: a filter that hides rows keeps the box's extent, so the layout around it never moves.
func (*ListBox) SetOnClickWithin ¶
func (n *ListBox) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*ListBox) SetOnFocusChanged ¶
func (n *ListBox) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*ListBox) SetOnHoverWithin ¶
func (n *ListBox) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*ListBox) SetOnPointer ¶
func (n *ListBox) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*ListBox) SetOnScroll ¶
func (n *ListBox) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*ListBox) SetPlaceholder ¶
SetPlaceholder sets a widget shown when no row is visible, replacing any previous placeholder.
func (*ListBox) SetSelectionMode ¶
func (s *ListBox) SetSelectionMode(mode SelectionMode)
SetSelectionMode switches the selection model. Leaving multiple mode keeps the lowest selected item as the single selection (or clears it when the set was empty); entering it seeds the set with the current selection and anchors there. The change notification fires when the switch changes the set.
func (*ListBox) SetSharedElement ¶
func (n *ListBox) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*ListBox) SetSingleClickActivate ¶
SetSingleClickActivate toggles whether a plain click activates a row (on by default); off means activation needs a double-click.
func (*ListBox) SetSizeRequest ¶
func (n *ListBox) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*ListBox) SetSortFunc ¶
func (l *ListBox) SetSortFunc(cmp func(a, b *ListBoxRow) int)
SetSortFunc installs a sort comparator and recomputes the row order. A nil cmp clears the sort, restoring insertion order.
func (*ListBox) SetState ¶
func (n *ListBox) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*ListBox) SetTooltip ¶
func (n *ListBox) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*ListBox) SetTooltipMarkup ¶
func (n *ListBox) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*ListBox) SetVAlign ¶
func (n *ListBox) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*ListBox) SetVExpand ¶
func (n *ListBox) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*ListBox) SetVisible ¶
func (n *ListBox) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*ListBox) SharedElement ¶
func (n *ListBox) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*ListBox) SizeRequest ¶
func (n *ListBox) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*ListBox) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*ListBox) TooltipText ¶
func (n *ListBox) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type ListBoxRow ¶
type ListBoxRow struct {
// contains filtered or unexported fields
}
ListBoxRow is one row in a ListBox: a child widget with an optional header, selectable and activatable flags, and the row's own CSS box.
func (*ListBoxRow) AccessibleName ¶
func (n *ListBoxRow) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*ListBoxRow) Activatable ¶
func (r *ListBoxRow) Activatable() bool
Activatable reports whether the row can be activated.
func (*ListBoxRow) AddClass ¶
func (n *ListBoxRow) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*ListBoxRow) Arrange ¶
func (r *ListBoxRow) Arrange(rct render.Rect)
Arrange lays out the header (if any) on top and the child below it.
func (*ListBoxRow) AttachStylesheet ¶
func (n *ListBoxRow) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*ListBoxRow) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*ListBoxRow) Child ¶
func (r *ListBoxRow) Child() Widget
Child returns the row's content widget.
func (*ListBoxRow) ChildVisible ¶
func (r *ListBoxRow) ChildVisible() bool
ChildVisible reports whether the list shows the row: false while its filter hides it (gtk_widget_get_child_visible), true when detached.
func (*ListBoxRow) Children ¶
func (r *ListBoxRow) Children() []Widget
Children returns the header (if any) and the child widget.
func (*ListBoxRow) Classes ¶
func (n *ListBoxRow) Classes() []string
Classes returns a copy of the widget's classes.
func (*ListBoxRow) ClickAt ¶
func (r *ListBoxRow) ClickAt(Point)
ClickAt forwards a click to the list's row click handler.
func (*ListBoxRow) DebugName ¶
func (n *ListBoxRow) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*ListBoxRow) DetachStylesheet ¶
func (n *ListBoxRow) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*ListBoxRow) DoubleClickAt ¶
func (r *ListBoxRow) DoubleClickAt(Point)
DoubleClickAt activates the row when single-click activation is off.
func (*ListBoxRow) DragMove ¶
func (r *ListBoxRow) DragMove(p Point)
DragMove moves the selection to the row under p in single and browse mode (pointer-follows-selection).
func (*ListBoxRow) Element ¶
func (n *ListBoxRow) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*ListBoxRow) Enabled ¶
func (n *ListBoxRow) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*ListBoxRow) HAlign ¶
func (n *ListBoxRow) HAlign() Align
HAlign returns the horizontal placement.
func (*ListBoxRow) HasState ¶
func (n *ListBoxRow) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*ListBoxRow) Header ¶
func (r *ListBoxRow) Header() Widget
Header returns the row's header widget, or nil when it has none.
func (*ListBoxRow) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*ListBoxRow) HitTest ¶
func (r *ListBoxRow) HitTest(p Point) Widget
HitTest returns the child or header widget under p when it can handle the hit, or the row itself.
func (*ListBoxRow) HoverWithin ¶
func (n *ListBoxRow) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*ListBoxRow) ID ¶
func (n *ListBoxRow) ID() string
ID returns the style id, empty when none is set.
func (*ListBoxRow) Index ¶
func (r *ListBoxRow) Index() int
Index returns the row's position in its ListBox, or -1 when detached.
func (*ListBoxRow) InlineStyle ¶
func (n *ListBoxRow) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*ListBoxRow) Invalidate ¶
func (n *ListBoxRow) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*ListBoxRow) InvalidateLayout ¶
func (n *ListBoxRow) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*ListBoxRow) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*ListBoxRow) KeyAction ¶
func (r *ListBoxRow) KeyAction(a KeyAction, mods Mods)
KeyAction forwards a keyboard action to the list's selection model.
func (*ListBoxRow) LayoutMotion ¶
func (n *ListBoxRow) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*ListBoxRow) MaximumSize ¶
func (n *ListBoxRow) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*ListBoxRow) Measure ¶
func (r *ListBoxRow) Measure(axis Axis, forSize int) Sizes
Measure reports the header (when shown) above the child: the wider of the two across, their heights summed.
func (*ListBoxRow) Paint ¶
func (r *ListBoxRow) Paint(cv *render.Canvas)
Paint draws the selected tint when the row is selected and the stylesheet did not set a background, then the box, header, and child.
func (*ListBoxRow) Parent ¶
func (n *ListBoxRow) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*ListBoxRow) PressEnd ¶
func (r *ListBoxRow) PressEnd()
PressEnd releases the list's selection press.
func (*ListBoxRow) RemoveAttr ¶
func (n *ListBoxRow) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*ListBoxRow) RemoveClass ¶
func (n *ListBoxRow) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*ListBoxRow) SelectAll ¶
func (r *ListBoxRow) SelectAll()
SelectAll selects every row through the list's selection model.
func (*ListBoxRow) Selectable ¶
func (r *ListBoxRow) Selectable() bool
Selectable reports whether the row responds to selection gestures.
func (*ListBoxRow) SetAccessibleName ¶
func (n *ListBoxRow) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*ListBoxRow) SetActivatable ¶
func (r *ListBoxRow) SetActivatable(on bool)
SetActivatable toggles whether the row can be activated (firing the list's OnActivate); it also sets the cursor and activatable CSS class accordingly.
func (*ListBoxRow) SetAttr ¶
func (n *ListBoxRow) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*ListBoxRow) SetClasses ¶
func (n *ListBoxRow) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*ListBoxRow) SetCursorName ¶
func (n *ListBoxRow) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*ListBoxRow) SetDebugName ¶
func (n *ListBoxRow) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*ListBoxRow) SetElement ¶
func (n *ListBoxRow) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*ListBoxRow) SetEnabled ¶
func (n *ListBoxRow) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*ListBoxRow) SetFocusOnClick ¶
func (n *ListBoxRow) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*ListBoxRow) SetHAlign ¶
func (n *ListBoxRow) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*ListBoxRow) SetHExpand ¶
func (n *ListBoxRow) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*ListBoxRow) SetID ¶
func (n *ListBoxRow) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*ListBoxRow) SetInlineStyle ¶
func (n *ListBoxRow) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*ListBoxRow) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*ListBoxRow) SetLayoutMotion ¶
func (n *ListBoxRow) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*ListBoxRow) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*ListBoxRow) SetMaximumSize ¶
func (n *ListBoxRow) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*ListBoxRow) SetOnClickWithin ¶
func (n *ListBoxRow) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*ListBoxRow) SetOnFocusChanged ¶
func (n *ListBoxRow) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*ListBoxRow) SetOnHoverWithin ¶
func (n *ListBoxRow) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*ListBoxRow) SetOnPointer ¶
func (n *ListBoxRow) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*ListBoxRow) SetOnScroll ¶
func (n *ListBoxRow) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*ListBoxRow) SetPressed ¶
func (r *ListBoxRow) SetPressed(on bool)
SetPressed holds the list's selection press while on.
func (*ListBoxRow) SetSelectable ¶
func (r *ListBoxRow) SetSelectable(on bool)
SetSelectable toggles whether the row responds to selection gestures.
func (*ListBoxRow) SetSharedElement ¶
func (n *ListBoxRow) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*ListBoxRow) SetSizeRequest ¶
func (n *ListBoxRow) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*ListBoxRow) SetState ¶
func (n *ListBoxRow) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*ListBoxRow) SetTooltip ¶
func (n *ListBoxRow) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*ListBoxRow) SetTooltipMarkup ¶
func (n *ListBoxRow) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*ListBoxRow) SetVAlign ¶
func (n *ListBoxRow) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*ListBoxRow) SetVExpand ¶
func (n *ListBoxRow) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*ListBoxRow) SetVisible ¶
func (n *ListBoxRow) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*ListBoxRow) SharedElement ¶
func (n *ListBoxRow) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*ListBoxRow) SizeRequest ¶
func (n *ListBoxRow) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*ListBoxRow) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*ListBoxRow) TooltipText ¶
func (n *ListBoxRow) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type ListModel ¶
ListModel supplies rows to a List. Row may return a fresh widget per call; the List caches the ones it is currently showing. Len and Row are re-queried on List.Changed.
type MarkupRun ¶
type MarkupRun struct {
// Text is the decoded plain UTF-8 text of the run. It never
// contains '<' or an undecoded entity.
Text string
// Style is the style the run paints with.
Style TextStyle
}
MarkupRun is a maximal stretch of text sharing one TextStyle.
func ParseMarkup ¶
ParseMarkup parses markup into styled runs. The accepted grammar is a strict allowlist, not HTML:
<b>bold</b> <i>italic</i> <u>underlined</u> <s>struck</s> <big> <small> <tt> <sub> <sup> <span weight="light" size="small" foreground="#rrggbb">…</span> <a href="https://example.com">link</a>
Tags nest and combine (bold italic, colors inheriting into nested tags, relative sizes compounding). Attribute values are single- or double-quoted. A span takes Pango's attributes: foreground (fgcolor, color), background (bgcolor), alpha (fgalpha), weight, style, size, font_family (face), underline, strikethrough, letter_spacing and font_features; colors are a CSS name or #rgb, #rrggbb, #rrggbbaa hex. Anything else - an unknown tag or attribute, a malformed value, a stray or mismatched close tag, an unclosed tag, self-closing syntax, uppercase tags - fails the parse.
Text and attribute values are escaped HTML-style: write < > & " ' for the literal characters. A bare '&' or '<', a numeric reference (&), and unknown names ( ) are outside the allowlist and fail the parse.
ParseMarkup never panics. When it reports false, callers render the input literally; RichLabel does exactly that.
type MediaControls ¶
type MediaControls struct {
// contains filtered or unexported fields
}
MediaControls is GTK's GtkMediaControls: a play/pause button, a seek bar over the stream's duration, the position and duration, and, when the stream has sound, a mute button and a volume slider. The seek bar is inert for a stream that cannot seek or does not know its length, and every control is inert once the stream closed or failed. It styles as `controls` with `.play`, `.seek`, `.time`, `.mute` and `.volume` parts.
func NewMediaControls ¶
NewMediaControls returns controls for stream, which may be nil.
func (*MediaControls) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*MediaControls) Baseline ¶
Baseline implements Baseliner: the root's, laid over the whole rect.
func (*MediaControls) Children ¶
func (c *MediaControls) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*MediaControls) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*MediaControls) SetStream ¶
func (m *MediaControls) SetStream(stream *media.Stream)
SetStream controls stream instead; nil leaves the controls inert.
func (*MediaControls) Stream ¶
func (m *MediaControls) Stream() *media.Stream
Stream returns the controlled stream.
type Menu ¶
type Menu struct {
OnDismiss func()
// host opens a child popup for it beside the parent row.
OnSubmenu func(index int, items []MenuItem)
// OnHover fires when the pointer moves onto another row, with its
// index: a nested menu opens the row's submenu, or closes the one
// a sibling had open, on hover as GTK's does.
OnHover func(index int)
// AccelLabel, when set, formats each row's Accel for display (a
// symbol form, a localized one); the binding itself is untouched.
AccelLabel func(accel string) string
// contains filtered or unexported fields
}
Menu is a vertical action list for popups and context menus: hovered row highlight, pointer or keyboard activation (arrows move, Enter activates, Esc dismisses, Right opens a submenu), check and radio rows, accelerator labels, per-row Alt-letter mnemonics, and nested submenus through OnSubmenu.
It styles as GTK's menu popup: the `popover.menu` card, a `contents` node padding the rows, and one `modelbutton` per row (a `separator` for ItemSeparator) — the hovered row :hover, inert rows :disabled, check and radio rows :checked while on.
Example ¶
package main
import (
"fmt"
"log"
"github.com/stubbedev/lys-lib/render"
"golang.org/x/image/font/gofont/goregular"
"github.com/stubbedev/lys-ui/widget"
)
func face() *render.Typeface {
tf, err := render.LoadFont(goregular.TTF)
if err != nil {
log.Fatal(err)
}
return tf
}
func main() {
// Menus are vertical action lists for popups: rows carry an
// accelerator label (display-only), check and radio state, and
// separators that keyboard motion skips.
wrap := false
menu := widget.NewMenu(face(), 13,
widget.MenuItem{Label: "Cut", Accel: "Ctrl+X", OnClick: func() { fmt.Println("cut") }},
widget.MenuItem{Label: "Copy", Accel: "Ctrl+C", OnClick: func() { fmt.Println("copy") }},
widget.MenuSeparator(),
widget.MenuItem{Label: "Word wrap", Kind: widget.ItemCheck, OnClick: func() { wrap = !wrap }},
)
// Keyboard: the first Down lands on the first selectable row, the
// second walks past the separator, Enter activates. The host
// closes the popup through OnDismiss; Esc maps to KeyDismiss.
menu.KeyAction(widget.KeyDown, 0)
menu.KeyAction(widget.KeyDown, 0)
menu.KeyAction(widget.KeyDown, 0)
menu.KeyAction(widget.KeyEnter, 0)
fmt.Println("wrap:", wrap)
}
Output: wrap: true
func NewMenu ¶
NewMenu returns a menu showing items, painted with face at sizePx. Face may be a render.Chain for mixed-script fallback. A nil face panics here (see requireFace) instead of failing later, in shaping.
func (*Menu) AccessibleName ¶
func (n *Menu) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Menu) ActivateMnemonic ¶
ActivateMnemonic activates the row whose mnemonic letter matches sym (case-insensitive) — the Alt+letter route while the menu is open — and reports whether one fired. A submenu row opens its submenu; arrow navigation and Esc are untouched (they arrive as KeyActions, never through here).
func (*Menu) AddClass ¶
func (n *Menu) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Menu) Arrange ¶
Arrange records the widget's rect. A rect that moved or resized from the previous frame also invalidates the old pixels, so partial damage does not leave the widget's old paint behind.
func (*Menu) AttachStylesheet ¶
func (n *Menu) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Menu) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Menu) Classes ¶
func (n *Menu) Classes() []string
Classes returns a copy of the widget's classes.
func (*Menu) ClickAt ¶
ClickAt activates the clicked row (or opens its submenu) and dismisses the menu. A disabled menu neither fires nor dismisses.
func (*Menu) DebugName ¶
func (n *Menu) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Menu) DetachStylesheet ¶
func (n *Menu) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Menu) DragMove ¶
DragMove keeps hover tracking during presses. Disabled menus highlight nothing.
func (*Menu) Element ¶
func (n *Menu) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Menu) Enabled ¶
func (n *Menu) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Menu) HasState ¶
func (n *Menu) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Menu) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Menu) HoverMove ¶
HoverMove tracks the hovered row as the pointer moves inside. Disabled menus highlight nothing.
func (*Menu) HoverWithin ¶
func (n *Menu) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Menu) InlineStyle ¶
func (n *Menu) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Menu) Invalidate ¶
func (n *Menu) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Menu) InvalidateLayout ¶
func (n *Menu) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Menu) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Menu) KeyAction ¶
KeyAction implements KeyActionHandler: arrows move the hovered row (clamped at the ends - pinned), Home/End jump, Enter activates, Esc and Left dismiss, Right opens a submenu. A disabled menu ignores keys outright.
func (*Menu) LayoutMotion ¶
func (n *Menu) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Menu) MaximumSize ¶
func (n *Menu) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Menu) Measure ¶
Measure wants the widest row (label plus indicator, accelerator, and submenu arrow) plus the row and contents padding, and one band per item — the bands sized by the styled modelbuttons, as the list sizes rows.
func (*Menu) Paint ¶
Paint draws the menu through its nodes — the `popover.menu` card, the `contents` inset, and each row (the hovered one :hover, its background and label color from the cascade), with item indicators, accelerator labels, and submenu arrows. Labels resolve under the menu's base direction: a right-to-left label shapes reordered and hugs the row's right edge; the check/radio indicators, accelerators, and submenu arrows keep their positions.
func (*Menu) Parent ¶
func (n *Menu) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Menu) RawKey ¶
RawKey implements RawKeyHandler: Alt+letter (no ctrl) activates the matching row mnemonic; every other raw key is not the menu's.
func (*Menu) RemoveAttr ¶
func (n *Menu) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Menu) RemoveClass ¶
func (n *Menu) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Menu) RowBounds ¶
RowBounds is row i's rect in the menu's coordinates: where a submenu anchors beside it. Empty for an index out of range.
func (*Menu) SetAccessibleName ¶
func (n *Menu) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Menu) SetAttr ¶
func (n *Menu) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Menu) SetClasses ¶
func (n *Menu) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Menu) SetCursorName ¶
func (n *Menu) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Menu) SetDebugName ¶
func (n *Menu) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Menu) SetDirection ¶
SetDirection selects the base paragraph direction the row labels resolve and lay out with: DirectionAuto (the default) reads it off each label's first strong character, and a right-to-left label hugs the row's right edge. Changing the direction invalidates.
func (*Menu) SetElement ¶
func (n *Menu) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Menu) SetEnabled ¶
func (n *Menu) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Menu) SetFocusOnClick ¶
func (n *Menu) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Menu) SetHAlign ¶
func (n *Menu) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Menu) SetHExpand ¶
func (n *Menu) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Menu) SetHovered ¶
SetHovered clears row hover when the pointer leaves the menu.
func (*Menu) SetID ¶
func (n *Menu) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Menu) SetInlineStyle ¶
func (n *Menu) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Menu) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Menu) SetItems ¶
SetItems replaces the rows in place - a live model update that keeps the menu (and its popover) open; the hovered row stays when it still exists.
func (*Menu) SetLayoutMotion ¶
func (n *Menu) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Menu) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Menu) SetMaximumSize ¶
func (n *Menu) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Menu) SetMnemonicsVisible ¶
SetMnemonicsVisible underlines the rows' Alt-letters, as a menu the keyboard opened shows them; a menu the pointer opened hides them until Alt is pressed.
func (*Menu) SetOnClickWithin ¶
func (n *Menu) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Menu) SetOnFocusChanged ¶
func (n *Menu) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Menu) SetOnHoverWithin ¶
func (n *Menu) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Menu) SetOnPointer ¶
func (n *Menu) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Menu) SetOnScroll ¶
func (n *Menu) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Menu) SetSharedElement ¶
func (n *Menu) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Menu) SetSizeRequest ¶
func (n *Menu) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Menu) SetState ¶
func (n *Menu) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Menu) SetTooltip ¶
func (n *Menu) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Menu) SetTooltipMarkup ¶
func (n *Menu) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Menu) SetVAlign ¶
func (n *Menu) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Menu) SetVExpand ¶
func (n *Menu) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Menu) SetVisible ¶
func (n *Menu) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Menu) SharedElement ¶
func (n *Menu) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Menu) SizeRequest ¶
func (n *Menu) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Menu) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Menu) TooltipText ¶
func (n *Menu) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type MenuBar ¶
type MenuBar struct {
// contains filtered or unexported fields
}
MenuBar is the in-window primary navigation (#91): a bordered, rounded strip of root buttons, each opening its menu below through the surface's host - the PopoverMenuBar shape. It styles as the `menubar` element, its roots as `menubar > box > button`, the root whose menu is open :checked.
Keyboard: F10 focuses the bar's first button when the app routes the key to it - MenuBar implements KeyActionHandler for exactly that handoff.
func NewMenuBar ¶
func NewMenuBar(face render.Font, sizePx float64, menus ...MenuBarMenu) *MenuBar
NewMenuBar returns a bar with one root button per menu.
func (*MenuBar) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*MenuBar) Children ¶
func (c *MenuBar) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*MenuBar) KeyAction ¶
KeyAction handles the F10 handoff: it activates the first root, the way GTK menu bars open on F10.
func (*MenuBar) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*MenuBar) SetFocused ¶
SetFocused paints the bar's focus state (F10 handoff).
type MenuBarMenu ¶
MenuBarMenu is one root of a MenuBar: its label and the menu it opens.
type MenuItem ¶
type MenuItem struct {
Label string
Action Activatable
OnClick func()
Kind ItemKind
Checked bool
Group string
Accel string
Mnemonic rune
Items []MenuItem
// OnOpen runs as the row's submenu opens, before it shows: a
// DBusMenu's AboutToShow.
OnOpen func()
Icon *Icon
Disabled bool
}
MenuItem is one row of a Menu.
Kind selects the row style: a plain action, a checkbox row (Checked toggles on activate), a radio row (Checked is exclusive within items sharing the same Group), or a separator (a real rule; skipped by keyboard motion - use MenuSeparator). Accel paints a right-aligned accelerator label, and — while the menu is open — a matching application accelerator fires the row's action through the popup key path (see RawKeyHandler). Items nests a submenu; activating such a row fires OnSubmenu so the host opens a child popup beside it.
Mnemonic is the row's Alt-letter shortcut while the menu is open: an explicit letter (case-insensitive), or zero to auto-resolve the first letter of the label no earlier row took. A letter claimed by an earlier row wins and the later one is dropped with a Debug log; the underline under the resolved letter is painted for free.
Icon paints at the row's leading edge, after any check or radio indicator, at the icon's natural size; once one row carries an icon every label shifts by the same slot so the column stays aligned. Disabled greys a row out whatever its action: it takes no hover, no keyboard motion, no mnemonic, and a click on it neither fires nor dismisses - the state an application toggles on a live row (a check item that cannot change right now) without dropping its OnClick.
Action binds the row to an action instead: activating the row activates it, a disabled action greys the row, and a Checkable action decides a check or radio row's state (ActionItem, CheckItem, RadioItem build such rows). OnClick, when also set, runs in its place.
func ActionItem ¶
func ActionItem(label string, a Activatable) MenuItem
ActionItem is a menu row activating a.
func (MenuItem) Enabled ¶
Enabled reports whether the row takes input: not Disabled, and its action, if any, enabled.
type MenuOptions ¶
type MenuOptions struct {
// OnClosed, when set, runs once the menu goes away.
OnClosed func()
// Gap is the distance between the anchor and the root menu.
Gap int
}
MenuOptions shape a widget-opened menu.
type MenuStack ¶
type MenuStack struct {
// OnDismiss runs when the stack as a whole should close.
OnDismiss func()
// contains filtered or unexported fields
}
MenuStack presents a Menu tree with sliding submenus: activating a row with nested Items replaces the visible level with that submenu, headed by a back row that returns to the parent (so does the Left arrow). This is GTK's default PopoverMenu presentation, and it fits a single popup surface: the stack measures to the largest level of the whole tree, so a popover sized at open never clips a submenu it slides to.
Every level is a real Menu, so rows keep all of Menu's behaviors (check/radio state, icons, disabled rows, accelerators, mnemonics). OnDismiss fires when a leaf row activates or a level asks to close (a click outside the rows, Esc); navigating between levels does not dismiss.
func NewMenuStack ¶
NewMenuStack returns a stack showing items at its root, painted with face at sizePx.
func (*MenuStack) AccessibleName ¶
func (n *MenuStack) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*MenuStack) ActivateMnemonic ¶
ActivateMnemonic fires a mnemonic of the visible level.
func (*MenuStack) AddClass ¶
func (n *MenuStack) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*MenuStack) AttachStylesheet ¶
func (n *MenuStack) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*MenuStack) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*MenuStack) Children ¶
Children exposes the visible level to the tree walks (damage, accessibility).
func (*MenuStack) Classes ¶
func (n *MenuStack) Classes() []string
Classes returns a copy of the widget's classes.
func (*MenuStack) DebugName ¶
func (n *MenuStack) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*MenuStack) DetachStylesheet ¶
func (n *MenuStack) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*MenuStack) Element ¶
func (n *MenuStack) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*MenuStack) Enabled ¶
func (n *MenuStack) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*MenuStack) HAlign ¶
func (n *MenuStack) HAlign() Align
HAlign returns the horizontal placement.
func (*MenuStack) HasState ¶
func (n *MenuStack) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*MenuStack) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*MenuStack) HitTest ¶
HitTest returns the stack itself inside its box: it is the input leaf and forwards to the visible level.
func (*MenuStack) HoverWithin ¶
func (n *MenuStack) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*MenuStack) ID ¶
func (n *MenuStack) ID() string
ID returns the style id, empty when none is set.
func (*MenuStack) InlineStyle ¶
func (n *MenuStack) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*MenuStack) Invalidate ¶
func (n *MenuStack) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*MenuStack) InvalidateLayout ¶
func (n *MenuStack) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*MenuStack) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*MenuStack) KeyAction ¶
KeyAction drives the visible level; Left in a submenu goes back a level instead of closing the stack.
func (*MenuStack) LayoutMotion ¶
func (n *MenuStack) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*MenuStack) MaximumSize ¶
func (n *MenuStack) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*MenuStack) Measure ¶
Measure wants the largest level of the tree, so the stack's box holds every submenu it can slide to.
func (*MenuStack) Parent ¶
func (n *MenuStack) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*MenuStack) RemoveAttr ¶
func (n *MenuStack) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*MenuStack) RemoveClass ¶
func (n *MenuStack) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*MenuStack) SetAccessibleName ¶
func (n *MenuStack) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*MenuStack) SetAttr ¶
func (n *MenuStack) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*MenuStack) SetClasses ¶
func (n *MenuStack) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*MenuStack) SetCursorName ¶
func (n *MenuStack) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*MenuStack) SetDebugName ¶
func (n *MenuStack) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*MenuStack) SetElement ¶
func (n *MenuStack) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*MenuStack) SetEnabled ¶
func (n *MenuStack) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*MenuStack) SetFocusOnClick ¶
func (n *MenuStack) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*MenuStack) SetHAlign ¶
func (n *MenuStack) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*MenuStack) SetHExpand ¶
func (n *MenuStack) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*MenuStack) SetHovered ¶
SetHovered forwards hover loss to the visible level.
func (*MenuStack) SetID ¶
func (n *MenuStack) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*MenuStack) SetInlineStyle ¶
func (n *MenuStack) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*MenuStack) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*MenuStack) SetItems ¶
SetItems replaces the whole tree and returns to its root level - the shape a live model update takes (a tray application re-publishing its menu while it is open).
func (*MenuStack) SetLayoutMotion ¶
func (n *MenuStack) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*MenuStack) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*MenuStack) SetMaximumSize ¶
func (n *MenuStack) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*MenuStack) SetOnClickWithin ¶
func (n *MenuStack) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*MenuStack) SetOnFocusChanged ¶
func (n *MenuStack) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*MenuStack) SetOnHoverWithin ¶
func (n *MenuStack) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*MenuStack) SetOnPointer ¶
func (n *MenuStack) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*MenuStack) SetOnScroll ¶
func (n *MenuStack) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*MenuStack) SetSharedElement ¶
func (n *MenuStack) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*MenuStack) SetSizeRequest ¶
func (n *MenuStack) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*MenuStack) SetState ¶
func (n *MenuStack) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*MenuStack) SetTooltip ¶
func (n *MenuStack) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*MenuStack) SetTooltipMarkup ¶
func (n *MenuStack) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*MenuStack) SetVAlign ¶
func (n *MenuStack) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*MenuStack) SetVExpand ¶
func (n *MenuStack) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*MenuStack) SetVisible ¶
func (n *MenuStack) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*MenuStack) SharedElement ¶
func (n *MenuStack) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*MenuStack) SizeRequest ¶
func (n *MenuStack) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*MenuStack) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*MenuStack) TooltipText ¶
func (n *MenuStack) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type MnemonicActivator ¶
MnemonicActivator is implemented by widgets whose rows carry Alt-letter mnemonics (Menu): ActivateMnemonic fires the row bound to sym, case-insensitively, and reports whether one fired.
type Morph ¶
type Morph struct {
// contains filtered or unexported fields
}
Morph is a transient surface's enter and exit visual: it grows its child out of an origin side - scaling up from 92% while a rounded clip unrolls from that side and the subtree fades in - and shrinks it back on the way out. A reveal past 1 (a spring's overshoot) swells the child a touch past its size. Without morphing it only fades. Layout and hit-testing pass straight through: the motion is visual, and a surface mid-enter takes clicks like one at rest. The paint never leaves the wrapper's bounds.
func (*Morph) AccessibleName ¶
func (n *Morph) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Morph) AddClass ¶
func (n *Morph) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Morph) ArrangeRoot ¶
ArrangeRoot records the wrapper's own rect.
func (*Morph) AttachStylesheet ¶
func (n *Morph) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Morph) BackdropRegion ¶ added in v0.2.0
BackdropRegion is the region behind the surface for the compositor to blur at the current reveal: the content's (widget.BackdropRegion, or the child's own report), cut by the unrolled clip and scaled as the paint is, so the blur never leads the shape it backs. Empty while hidden.
func (*Morph) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Morph) Children ¶
Children exposes the child for the damage collector, focus traversal, and the accessibility walk.
func (*Morph) Classes ¶
func (n *Morph) Classes() []string
Classes returns a copy of the widget's classes.
func (*Morph) DebugName ¶
func (n *Morph) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Morph) DetachStylesheet ¶
func (n *Morph) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Morph) Element ¶
func (n *Morph) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Morph) Enabled ¶
func (n *Morph) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Morph) HasState ¶
func (n *Morph) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Morph) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Morph) HoverWithin ¶
func (n *Morph) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Morph) InlineStyle ¶
func (n *Morph) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Morph) Invalidate ¶
func (n *Morph) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Morph) InvalidateLayout ¶
func (n *Morph) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Morph) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Morph) LayoutMotion ¶
func (n *Morph) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Morph) MaximumSize ¶
func (n *Morph) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Morph) Measure ¶
Measure reports the child's natural size plus the plate inset on every side.
func (*Morph) Parent ¶
func (n *Morph) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Morph) RemoveAttr ¶
func (n *Morph) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Morph) RemoveClass ¶
func (n *Morph) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Morph) SetAccessibleName ¶
func (n *Morph) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Morph) SetAttr ¶
func (n *Morph) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Morph) SetClasses ¶
func (n *Morph) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Morph) SetCompositorFade ¶ added in v0.2.0
SetCompositorFade makes the owner responsible for Fade, on the surface through the compositor, so the paint itself stays fully opaque. The compositor's blur behind the surface can then fade along with it, which no opacity painted into the buffer can do.
func (*Morph) SetCursorName ¶
func (n *Morph) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Morph) SetDebugName ¶
func (n *Morph) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Morph) SetElement ¶
func (n *Morph) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Morph) SetEnabled ¶
func (n *Morph) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Morph) SetFocusOnClick ¶
func (n *Morph) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Morph) SetHAlign ¶
func (n *Morph) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Morph) SetHExpand ¶
func (n *Morph) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Morph) SetID ¶
func (n *Morph) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Morph) SetInlineStyle ¶
func (n *Morph) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Morph) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Morph) SetLayoutMotion ¶
func (n *Morph) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Morph) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Morph) SetMaximumSize ¶
func (n *Morph) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Morph) SetOnClickWithin ¶
func (n *Morph) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Morph) SetOnFocusChanged ¶
func (n *Morph) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Morph) SetOnHoverWithin ¶
func (n *Morph) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Morph) SetOnPointer ¶
func (n *Morph) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Morph) SetOnScroll ¶
func (n *Morph) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Morph) SetOrigin ¶
SetOrigin sets the point the motion grows from, as fractions of the bounds: a popover below its anchor grows from (0.5, 0).
func (*Morph) SetPlate ¶
SetPlate gives the surface a margin of inset around its content and the painter of its backing for a content rect; see the field.
func (*Morph) SetReveal ¶
SetReveal applies one motion frame: the reveal fraction and whether the child grows (true) or only fades.
func (*Morph) SetSharedElement ¶
func (n *Morph) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Morph) SetSizeRequest ¶
func (n *Morph) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Morph) SetState ¶
func (n *Morph) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Morph) SetTooltip ¶
func (n *Morph) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Morph) SetTooltipMarkup ¶
func (n *Morph) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Morph) SetVAlign ¶
func (n *Morph) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Morph) SetVExpand ¶
func (n *Morph) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Morph) SetVisible ¶
func (n *Morph) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Morph) SharedElement ¶
func (n *Morph) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Morph) SizeRequest ¶
func (n *Morph) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Morph) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Morph) TooltipText ¶
func (n *Morph) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type NavigationLink ¶
type NavigationLink struct {
NavigationLink is one link of a navigation panel's grid.
type NavigationMenu ¶
type NavigationMenu struct {
// contains filtered or unexported fields
}
NavigationMenu is a site's top navigation: a row of triggers whose panels open in one shared viewport under the menu, so moving between triggers swaps the panel in place and the viewport resizes to it, while a caret under the open trigger slides along. Resting the pointer on a trigger opens its panel, and it stays open while the pointer is on the menu or the panel; Enter, Space or Down on a focused trigger opens it with the keyboard in the panel, Left and Right step between the triggers, and Escape closes. It styles as the `navigationmenu` element: button.trigger rows (:checked while open), the .viewport panel box, and the panels' button.link entries.
func NewNavigationMenu ¶
func NewNavigationMenu(face render.Font, items ...NavigationMenuItem) *NavigationMenu
NewNavigationMenu returns a menu of items.
func (*NavigationMenu) Active ¶
func (m *NavigationMenu) Active() int
Active is the open panel's item, -1 for none.
func (*NavigationMenu) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*NavigationMenu) Baseline ¶
Baseline implements Baseliner: the root's, laid over the whole rect.
func (*NavigationMenu) Children ¶
func (c *NavigationMenu) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*NavigationMenu) InterceptKey ¶
func (m *NavigationMenu) InterceptKey(target Widget, a KeyAction, _ Mods) bool
InterceptKey implements KeyInterceptor: on a focused trigger, Enter, Space and Down open its panel with the keyboard in it, and Escape closes.
func (*NavigationMenu) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*NavigationMenu) NavigateFocus ¶
func (m *NavigationMenu) NavigateFocus(target Widget, a KeyAction) Widget
NavigateFocus implements FocusNavigator: Left and Right step between the triggers that can take focus.
func (*NavigationMenu) Paint ¶
func (m *NavigationMenu) Paint(cv *render.Canvas)
Paint draws the triggers, then the caret under the open one.
type NavigationMenuItem ¶
type NavigationMenuItem struct {
}
NavigationMenuItem is one entry of a NavigationMenu: a trigger opening Content, or - without Content - a link running OnActivate.
type NavigationPage ¶
type NavigationPage struct {
}
NavigationPage is one page: its title and its widget.
type NavigationSplitView ¶
type NavigationSplitView struct {
// contains filtered or unexported fields
}
NavigationSplitView puts a sidebar beside content above a breakpoint and collapses to a NavigationView below it: the sidebar becomes the root page, content the pushed page - the mobile shape. ShowContent is the sidebar's activation hook; the back button and back keys return to the sidebar through the same view.
func NewNavigationSplitView ¶
func NewNavigationSplitView(face render.Font, sizePx float64, sidebar, content *NavigationPage, collapseWidth int) *NavigationSplitView
NewNavigationSplitView returns the split over sidebar and content, collapsing at or below collapseWidth (420 when not positive).
func (*NavigationSplitView) Arrange ¶
Arrange evaluates the breakpoint against the allocated width, then lays out whichever layout it picked - in the same pass, so a collapse never paints one frame of the old layout.
func (*NavigationSplitView) Collapsed ¶
func (c *NavigationSplitView) Collapsed() bool
Collapsed reports which layout the last width chose.
func (*NavigationSplitView) KeyAction ¶
func (s *NavigationSplitView) KeyAction(a KeyAction, mods Mods)
KeyAction forwards the back keys to the collapsed view.
func (*NavigationSplitView) Navigation ¶
func (s *NavigationSplitView) Navigation() *NavigationView
Navigation returns the collapsed layout's view (its depth, pop hook and back keys).
func (*NavigationSplitView) ShowContent ¶
func (s *NavigationSplitView) ShowContent()
ShowContent pushes the content page in the collapsed view; above the breakpoint the content is already showing and this is a no-op.
type NavigationView ¶
type NavigationView struct {
// root).
OnPop func(popped, now *NavigationPage)
// contains filtered or unexported fields
}
NavigationView is the push/pop shell: a header (back button when depth allows, the current page's title) over a Stack that slides pages in from the right on push and back on pop - the Stack's own transition doing the animating.
func NewNavigationView ¶
func NewNavigationView(face render.Font, sizePx float64, root *NavigationPage) *NavigationView
NewNavigationView returns a view showing root.
func (*NavigationView) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*NavigationView) Baseline ¶
Baseline implements Baseliner: the root's, laid over the whole rect.
func (*NavigationView) Children ¶
func (c *NavigationView) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*NavigationView) Depth ¶
func (v *NavigationView) Depth() int
Depth reports the pushed page count (the root included).
func (*NavigationView) KeyAction ¶
func (v *NavigationView) KeyAction(a KeyAction, mods Mods)
KeyAction implements the back keys: Alt+Left and Backspace pop.
func (*NavigationView) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*NavigationView) Page ¶
func (v *NavigationView) Page() *NavigationPage
Page returns the top page.
func (*NavigationView) Paint ¶
func (v *NavigationView) Paint(cv *render.Canvas)
Paint draws the bar's surface then the column.
func (*NavigationView) Pop ¶
func (v *NavigationView) Pop() bool
Pop drops the top page (true when something popped) and slides back.
func (*NavigationView) PopToRoot ¶
func (v *NavigationView) PopToRoot()
PopToRoot unwinds to the root page.
func (*NavigationView) Push ¶
func (v *NavigationView) Push(p *NavigationPage)
Push shows page over the current one, sliding in from the right.
type NodeInfo ¶
type NodeInfo struct {
A11yState
// TypeName is the widget's Go type, as %T prints it.
TypeName string
// DebugName is the SetDebugName label, empty when unnamed.
DebugName string
// Depth is the nesting level; the root is 0.
Depth int
// Focused, Hovered, and Pressed report that this widget is the
// router's current focus, hover, or press target. All false when
// the snapshot was taken without a Router.
Focused, Hovered, Pressed bool
}
NodeInfo is one live snapshot row of the widget tree: identity (type, debug name), the accessibility summary (role, tooltip name, bounds, value), and the router-driven input state. Unlike the a11y snapshot (Describe), the flags here are the live input state, which is what a layout bug report needs.
func InspectTree ¶
InspectTree snapshots root and every descendant in paint order with nesting depth, the live-state counterpart of DescribeTree. Router may be nil, which leaves the input flags false.
type Notebook ¶
type Notebook struct {
OnSelect func(name string)
OnTabClose func(name string)
OnReorder func(name string, index int)
Closable bool
Reorderable bool
// contains filtered or unexported fields
}
Notebook is a tabbed container: a tab bar on top and exactly one visible page beneath it, the GtkNotebook model. Tabs carry a name, painted as the tab's label unless SetTabLabel gave it a widget; the header, the tab row, and each tab are CSS boxes. Selecting a tab shows its page and fires OnSelect. With Closable set, each tab paints a close box and a click on it fires OnTabClose instead of selecting - hosts remove the page themselves. With Reorderable set, dragging a tab along the strip moves it (OnReorder reports the new index). Tabs that overflow the strip scroll: arrows appear at its ends, the wheel over it scrolls, and the selected tab is kept in view.
func NewNotebook ¶
NewNotebook returns an empty notebook with tab labels painted in the given face; a render.Chain adds mixed-script fallback. A nil face panics here (see requireFace) instead of failing later, in shaping.
func (*Notebook) AccessibleName ¶
func (n *Notebook) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Notebook) AddClass ¶
func (n *Notebook) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Notebook) AppendTab ¶
AppendTab adds a page under name; the first page added becomes the selected one.
func (*Notebook) AttachStylesheet ¶
func (n *Notebook) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Notebook) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Notebook) Children ¶
Children exposes only the visible page, so keyboard traversal skips hidden pages.
func (*Notebook) Classes ¶
func (n *Notebook) Classes() []string
Classes returns a copy of the widget's classes.
func (*Notebook) ClickAt ¶
ClickAt selects the tab under the point, or fires OnTabClose when the close box of a tab was pressed.
func (*Notebook) CloseTab ¶
CloseTab removes the page under name; the following page becomes visible. Unknown names are a no-op. Reports whether a page was removed. The closed page detaches like every tree mutation: parent link cleared, removal hook fired.
func (*Notebook) CloseTabAt ¶
CloseTabAt removes the page at index i, like CloseTab; an index out of range is a no-op.
func (*Notebook) CursorName ¶
CursorName is the hovered tab label's cursor (GTK resolves it on the label itself), else the notebook's own.
func (*Notebook) DebugName ¶
func (n *Notebook) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Notebook) DetachStylesheet ¶
func (n *Notebook) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Notebook) DragMove ¶
DragMove moves the dragged tab into the slot under the pointer, so the strip reorders live as the pointer crosses its neighbors.
func (*Notebook) Element ¶
func (n *Notebook) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Notebook) Enabled ¶
func (n *Notebook) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Notebook) HAlign ¶
func (n *Notebook) HAlign() Align
HAlign returns the horizontal placement.
func (*Notebook) HasState ¶
func (n *Notebook) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Notebook) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Notebook) HitTest ¶
HitTest resolves the tab strip into the notebook itself (clicks select or close) and otherwise delegates to the visible page.
func (*Notebook) HoverMove ¶
HoverMove tracks whether the pointer is over the tab strip, and the tab under it (its :hover).
func (*Notebook) HoverWithin ¶
func (n *Notebook) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Notebook) ID ¶
func (n *Notebook) ID() string
ID returns the style id, empty when none is set.
func (*Notebook) InlineStyle ¶
func (n *Notebook) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Notebook) InsertTab ¶
InsertTab adds a page under name at index i (clamped); the selected page stays selected.
func (*Notebook) Invalidate ¶
func (n *Notebook) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Notebook) InvalidateLayout ¶
func (n *Notebook) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Notebook) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Notebook) KeyAction ¶
KeyAction implements KeyActionHandler: ctrl+PageUp/PageDown cycle through tabs. Other actions are ignored.
func (*Notebook) LayoutMotion ¶
func (n *Notebook) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Notebook) MaximumSize ¶
func (n *Notebook) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Notebook) Measure ¶
Measure reports the widest page's request, wanting the whole tab strip across (it scrolls when narrower) and its height on top.
func (*Notebook) MoveTab ¶
MoveTab moves tab from to index to, the selection following its page. It is the programmatic move: OnReorder reports only the user's drags, so a handler that mirrors them into a model cannot loop.
func (*Notebook) Paint ¶
Paint draws the tab bar through its nodes — the notebook's box, the header and tab-row boxes, and each tab (the selected one :checked: its own background and label color, the accent fill and underline as the theme's fallback where the stylesheet paints none) — and the visible page.
func (*Notebook) Parent ¶
func (n *Notebook) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Notebook) RemoveAttr ¶
func (n *Notebook) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Notebook) RemoveClass ¶
func (n *Notebook) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Notebook) SelectedTab ¶
SelectedTab returns the visible page's name, empty when none.
func (*Notebook) SetAccessibleName ¶
func (n *Notebook) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Notebook) SetAttr ¶
func (n *Notebook) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Notebook) SetClasses ¶
func (n *Notebook) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Notebook) SetCursorName ¶
func (n *Notebook) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Notebook) SetDebugName ¶
func (n *Notebook) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Notebook) SetElement ¶
func (n *Notebook) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Notebook) SetEnabled ¶
SetEnabled turns the notebook's subtree on or off through the per-query enable walk, like Box. Like Stack, hidden pages stay untouched: they are not painted, so they need no repaint.
func (*Notebook) SetFocusOnClick ¶
func (n *Notebook) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Notebook) SetHAlign ¶
func (n *Notebook) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Notebook) SetHExpand ¶
func (n *Notebook) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Notebook) SetHovered ¶
SetHovered forgets the strip when the pointer leaves the notebook itself (into a page, or away).
func (*Notebook) SetID ¶
func (n *Notebook) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Notebook) SetInlineStyle ¶
func (n *Notebook) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Notebook) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Notebook) SetLayoutMotion ¶
func (n *Notebook) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Notebook) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Notebook) SetMaximumSize ¶
func (n *Notebook) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Notebook) SetOnClickWithin ¶
func (n *Notebook) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Notebook) SetOnFocusChanged ¶
func (n *Notebook) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Notebook) SetOnHoverWithin ¶
func (n *Notebook) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Notebook) SetOnPointer ¶
func (n *Notebook) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Notebook) SetOnScroll ¶
func (n *Notebook) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Notebook) SetSharedElement ¶
func (n *Notebook) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Notebook) SetSizeRequest ¶
func (n *Notebook) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Notebook) SetState ¶
func (n *Notebook) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Notebook) SetTabExpand ¶
SetTabExpand makes the named tab share the strip's leftover width with the other expanding tabs (gtk_notebook_set_tab_expand); a tab whose label wants horizontal space expands without it.
func (*Notebook) SetTabLabel ¶
SetTabLabel shows w in the tab of the page under name instead of its painted name (gtk_notebook_set_tab_label); nil restores the name. The label styles as the tab's child (`tab > label`) and fills the tab's content box. Unknown names are a no-op.
func (*Notebook) SetTooltip ¶
func (n *Notebook) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Notebook) SetTooltipMarkup ¶
func (n *Notebook) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Notebook) SetVAlign ¶
func (n *Notebook) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Notebook) SetVExpand ¶
func (n *Notebook) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Notebook) SetVisible ¶
func (n *Notebook) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Notebook) SharedElement ¶
func (n *Notebook) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Notebook) SizeRequest ¶
func (n *Notebook) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Notebook) TabLabel ¶
TabLabel is the label widget SetTabLabel gave the page under name (gtk_notebook_get_tab_label); nil for a painted name or an unknown page.
func (*Notebook) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Notebook) TooltipText ¶
func (n *Notebook) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type OTPCharset ¶
type OTPCharset uint8
OTPCharset is what an InputOTP accepts.
const ( // OTPDigits accepts 0-9. OTPDigits OTPCharset = iota // OTPAlphanumeric accepts letters and digits, uppercased. OTPAlphanumeric )
The code character sets.
type Opacity ¶
type Opacity struct {
// contains filtered or unexported fields
}
Opacity carries a widget's subtree opacity: a factor in [0, 1] the widget applies around its children's paint. Widgets that wrap children embed it beside node, call bindOpacity from their constructor, and route child painting through paintChild. The factor lands on the canvas's PushAlpha stack, so nested carriers compose multiplicatively and the modulation reaches every blended primitive by construction.
The type has no Opacity getter on purpose: an accessor named like the embedded field would shadow the embedding itself (toast.Opacity() would collide with the promoted Opacity field). Alpha is the getter.
func (*Opacity) Alpha ¶
Alpha returns the subtree opacity in [0, 1]. The zero value is fully transparent, so embedding constructors start it at 1.
func (*Opacity) SetOpacity ¶
SetOpacity sets the subtree opacity, clamped to [0, 1] — a spring tween's overshoot saturates instead of over-brightening. A change invalidates the host's bounds, so the next frame repaints the subtree under the new factor. Zero is a state, not a special case: painting it skips the subtree entirely, which is what makes tween endpoints free. It composes with the animation clock directly — a tween callback is just SetOpacity.
type Orientation ¶
type Orientation uint8
Orientation is the main direction an oriented widget runs along.
const ( // Horizontal runs left to right. Horizontal Orientation = iota // Vertical runs top to bottom. Vertical )
type Overlay ¶
type Overlay struct {
// contains filtered or unexported fields
}
Overlay stacks all children on the same rect and paints them in add order. The last child paints on top and wins hit tests. A hidden child takes no part: it neither sizes, paints, nor hits, as in a Box.
func (*Overlay) AccessibleName ¶
func (n *Overlay) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Overlay) AddClass ¶
func (n *Overlay) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Overlay) AppendAligned ¶
AppendAligned adds a child on top, sized and placed per axis like a GtkOverlay child: AlignFill takes the overlay's extent, the others keep the child's natural size pinned to the start, center or end. The child hits only inside its own rect, so a corner button leaves the rest of the content clickable.
func (*Overlay) Arrange ¶
Arrange records the border box and assigns the content box to every filling child, placing the aligned ones within it.
func (*Overlay) ArrangeRoot ¶
ArrangeRoot records the overlay's own rect.
func (*Overlay) AttachStylesheet ¶
func (n *Overlay) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Overlay) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Overlay) Children ¶
Children exposes a snapshot of the overlay's children in add order for focus traversal. A copy, like Box.Children: tree walks must be able to survive a callback that mutates the container.
func (*Overlay) Classes ¶
func (n *Overlay) Classes() []string
Classes returns a copy of the widget's classes.
func (*Overlay) DebugName ¶
func (n *Overlay) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Overlay) DetachStylesheet ¶
func (n *Overlay) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Overlay) Element ¶
func (n *Overlay) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Overlay) Enabled ¶
func (n *Overlay) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Overlay) HasState ¶
func (n *Overlay) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Overlay) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Overlay) HitTest ¶
HitTest returns the topmost child under p, or the overlay inside its bounds.
func (*Overlay) HoverWithin ¶
func (n *Overlay) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Overlay) InlineStyle ¶
func (n *Overlay) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Overlay) Invalidate ¶
func (n *Overlay) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Overlay) InvalidateLayout ¶
func (n *Overlay) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Overlay) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Overlay) LayoutMotion ¶
func (n *Overlay) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Overlay) MaximumSize ¶
func (n *Overlay) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Overlay) Measure ¶
Measure reports the widest request of its visible children inside the overlay's CSS box: padding, border and min sizes.
func (*Overlay) Parent ¶
func (n *Overlay) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Overlay) RemoveAttr ¶
func (n *Overlay) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Overlay) RemoveClass ¶
func (n *Overlay) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Overlay) SetAccessibleName ¶
func (n *Overlay) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Overlay) SetAttr ¶
func (n *Overlay) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Overlay) SetClasses ¶
func (n *Overlay) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Overlay) SetCursorName ¶
func (n *Overlay) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Overlay) SetDebugName ¶
func (n *Overlay) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Overlay) SetElement ¶
func (n *Overlay) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Overlay) SetEnabled ¶
SetEnabled turns the overlay's whole stack on or off through the per-query enable walk, like Box.
func (*Overlay) SetFocusOnClick ¶
func (n *Overlay) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Overlay) SetHAlign ¶
func (n *Overlay) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Overlay) SetHExpand ¶
func (n *Overlay) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Overlay) SetID ¶
func (n *Overlay) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Overlay) SetInlineStyle ¶
func (n *Overlay) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Overlay) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Overlay) SetLayoutMotion ¶
func (n *Overlay) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Overlay) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Overlay) SetMaximumSize ¶
func (n *Overlay) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Overlay) SetOnClickWithin ¶
func (n *Overlay) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Overlay) SetOnFocusChanged ¶
func (n *Overlay) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Overlay) SetOnHoverWithin ¶
func (n *Overlay) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Overlay) SetOnPointer ¶
func (n *Overlay) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Overlay) SetOnScroll ¶
func (n *Overlay) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Overlay) SetSharedElement ¶
func (n *Overlay) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Overlay) SetSizeRequest ¶
func (n *Overlay) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Overlay) SetState ¶
func (n *Overlay) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Overlay) SetTooltip ¶
func (n *Overlay) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Overlay) SetTooltipMarkup ¶
func (n *Overlay) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Overlay) SetVAlign ¶
func (n *Overlay) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Overlay) SetVExpand ¶
func (n *Overlay) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Overlay) SetVisible ¶
func (n *Overlay) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Overlay) SharedElement ¶
func (n *Overlay) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Overlay) SizeRequest ¶
func (n *Overlay) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Overlay) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Overlay) TooltipText ¶
func (n *Overlay) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type OverlaySplitView ¶
type OverlaySplitView struct {
// contains filtered or unexported fields
}
OverlaySplitView is the Flap shape: wide, the sidebar beside the content; collapsed, the content full-size with the sidebar sliding in over its leading edge on ShowSidebar. Gestures wait for the touch ticket.
func NewOverlaySplitView ¶
func NewOverlaySplitView(sidebar, content Widget, collapseWidth int) *OverlaySplitView
NewOverlaySplitView returns the split over content with sidebar; collapseWidth is 420 when not positive. Collapsed, the sidebar starts hidden.
func (*OverlaySplitView) Arrange ¶
Arrange evaluates the breakpoint against the allocated width, then lays out whichever layout it picked - in the same pass, so a collapse never paints one frame of the old layout.
func (*OverlaySplitView) Collapsed ¶
func (c *OverlaySplitView) Collapsed() bool
Collapsed reports which layout the last width chose.
func (*OverlaySplitView) ShowSidebar ¶
func (s *OverlaySplitView) ShowSidebar(on bool)
ShowSidebar opens or closes the collapsed overlay; above the breakpoint the sidebar always shows and this is a no-op.
func (*OverlaySplitView) SidebarShowing ¶
func (s *OverlaySplitView) SidebarShowing() bool
SidebarShowing reports whether the sidebar is on screen (always, wide).
type Pagination ¶
type Pagination struct {
// OnPageChanged fires with the new page after the user moved to
// it, not after SetPage.
OnPageChanged func(page int)
// contains filtered or unexported fields
}
Pagination steps through numbered pages: Previous, the page links around the current one with the first and last always shown and ellipses for the gaps, and Next. Pages count from 1. It styles as the `pagination` element: each link a button.page-link, the current one :checked, the ends button.previous and button.next, the gaps .ellipsis.
func NewPagination ¶
func NewPagination(face render.Font, count, page int) *Pagination
NewPagination returns a pagination over count pages at page, with one link on each side of the current page. count is at least 1 and page within 1..count, or the call panics.
func (*Pagination) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*Pagination) Children ¶
func (c *Pagination) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Pagination) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*Pagination) SetCount ¶
func (p *Pagination) SetCount(count, page int)
SetCount replaces the page count and the current page; count is at least 1 and page within 1..count, or the call panics.
func (*Pagination) SetPage ¶
func (p *Pagination) SetPage(page int)
SetPage moves to page, within 1..count or the call panics.
func (*Pagination) SetSiblings ¶
func (p *Pagination) SetSiblings(n int)
SetSiblings sets how many links show on each side of the current page, at least 0.
type Paned ¶
type Paned struct {
// OnPositionChanged fires after every applied position change —
// drag, keyboard, SetPosition, or a resize that re-normalized the
// request — with the arranged position.
OnPositionChanged func(position int)
// contains filtered or unexported fields
}
Paned is a two-pane container with a draggable divider: children are arranged along the axis (Row side by side, Column stacked), the divider position is pixels from the start edge, and dragging, keyboard nudges, or SetPosition move it — the children relayout live, one frame per position change.
The position is a request the arrangement clamps: each pane holds at least its minimum, so the divider never starves a pane past what it declared it needs; when a resize makes the request impossible, the position re-normalizes to the nearest clamp — GTK's keep-child-one semantics. Position reports the arranged position; SetPosition only asks.
The handle owns a generous hit zone around the divider (the slop overlaps the panes' edges); presses there drag, and the Paned is keyboard-focusable: arrows nudge along the axis (by a twentieth of the span, one pixel minimum), Home and End pin to the extremes. The pane children keep their own input: hits outside the handle zone reach them, and they join focus traversal through Children.
func NewPaned ¶
NewPaned returns a paned along axis with the two children; either may be nil, in which case the other takes the whole rect and no divider is drawn.
func (*Paned) AccessibleName ¶
func (n *Paned) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Paned) AddClass ¶
func (n *Paned) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Paned) Arrange ¶
Arrange clamps the requested position, lays the panes around it, and keeps the parent links current for the walks.
func (*Paned) AttachStylesheet ¶
func (n *Paned) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Paned) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Paned) Classes ¶
func (n *Paned) Classes() []string
Classes returns a copy of the widget's classes.
func (*Paned) CursorName ¶
CursorName returns the resize cursor for the axis while the handle is the hovered widget (HitTest returns the Paned only inside the handle's hit zone, so being hovered is being on the handle).
func (*Paned) DebugName ¶
func (n *Paned) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Paned) DetachStylesheet ¶
func (n *Paned) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Paned) DragMove ¶
DragMove drags the divider to the pointer: the position is where the pointer sits minus half the handle, clamped by the arrangement. Disabled panes do not drag.
func (*Paned) Element ¶
func (n *Paned) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Paned) Enabled ¶
func (n *Paned) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Paned) HasState ¶
func (n *Paned) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Paned) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Paned) HitTest ¶
HitTest returns the Paned inside the handle's hit zone — the handle owns the press even where the slop overlaps a pane — then whatever pane is under p, else nil: the paned's own chrome swallows nothing.
func (*Paned) HoverWithin ¶
func (n *Paned) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Paned) InlineStyle ¶
func (n *Paned) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Paned) Invalidate ¶
func (n *Paned) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Paned) InvalidateLayout ¶
func (n *Paned) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Paned) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Paned) KeyAction ¶
KeyAction implements KeyActionHandler: arrows nudge the divider along the axis by a twentieth of the span (one pixel at least), Home and End pin it to the extremes; the cross-axis arrows and every other action are not the handle's. Disabled panes ignore keys.
func (*Paned) LayoutMotion ¶
func (n *Paned) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Paned) MaximumSize ¶
func (n *Paned) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Paned) Measure ¶
Measure wants the two panes' requests plus the handle along the axis, so a Paned nested in a squeezing container (a Grid) keeps both panes alive; across, the larger pane's request at its natural extent along.
func (*Paned) Paint ¶
Paint draws the panes, then the divider between them through its `separator` node: the box layers it resolves, the theme's handle looks as the fallback per state, and no divider when a pane is missing (the other still paints).
func (*Paned) Parent ¶
func (n *Paned) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Paned) Position ¶
Position returns the divider's arranged position in pixels from the start edge — the clamped truth, never the unarranged request. Before the first arrangement it is zero.
func (*Paned) RemoveAttr ¶
func (n *Paned) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Paned) RemoveClass ¶
func (n *Paned) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Paned) SetAccessibleName ¶
func (n *Paned) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Paned) SetAttr ¶
func (n *Paned) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Paned) SetClasses ¶
func (n *Paned) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Paned) SetCursorName ¶
func (n *Paned) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Paned) SetDebugName ¶
func (n *Paned) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Paned) SetElement ¶
func (n *Paned) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Paned) SetEnabled ¶
func (n *Paned) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Paned) SetFocusOnClick ¶
func (n *Paned) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Paned) SetHAlign ¶
func (n *Paned) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Paned) SetHExpand ¶
func (n *Paned) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Paned) SetHovered ¶
SetHovered tracks the handle's hover shade.
func (*Paned) SetID ¶
func (n *Paned) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Paned) SetInlineStyle ¶
func (n *Paned) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Paned) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Paned) SetLayoutMotion ¶
func (n *Paned) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Paned) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Paned) SetMaxPosition ¶
SetMaxPosition caps the divider at pos pixels from the start edge (the start pane's largest extent), above the start pane's floor; zero removes the cap. Drags, keys and SetPosition all stop there.
func (*Paned) SetMaximumSize ¶
func (n *Paned) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Paned) SetOnClickWithin ¶
func (n *Paned) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Paned) SetOnFocusChanged ¶
func (n *Paned) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Paned) SetOnHoverWithin ¶
func (n *Paned) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Paned) SetOnPointer ¶
func (n *Paned) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Paned) SetOnScroll ¶
func (n *Paned) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Paned) SetPosition ¶
SetPosition asks for a divider position in pixels from the start edge; the next arrangement clamps it between the panes' minimums and under SetMaxPosition, and fires OnPositionChanged when the arranged position moved.
func (*Paned) SetPressed ¶
SetPressed tracks the drag's pressed shade and reports the press the divider follows.
func (*Paned) SetSharedElement ¶
func (n *Paned) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Paned) SetSizeRequest ¶
func (n *Paned) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Paned) SetState ¶
func (n *Paned) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Paned) SetTooltip ¶
func (n *Paned) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Paned) SetTooltipMarkup ¶
func (n *Paned) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Paned) SetVAlign ¶
func (n *Paned) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Paned) SetVExpand ¶
func (n *Paned) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Paned) SetVisible ¶
func (n *Paned) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Paned) SharedElement ¶
func (n *Paned) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Paned) SizeRequest ¶
func (n *Paned) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Paned) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Paned) TooltipText ¶
func (n *Paned) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type ParamAction ¶
type ParamAction[P comparable] struct { // contains filtered or unexported fields }
ParamAction is a named action activated with a value, relm4's stateless action with a target type: one "open-file" action serving every recent-file row. Proxies bind a Target, a value fixed at binding time. The parameter is comparable because targets are compared and keyed by the accelerator registry.
func NewParamAction ¶
func NewParamAction[P comparable](name string, fn func(P)) *ParamAction[P]
NewParamAction returns an enabled action running fn with the bound value on activation.
func (*ParamAction[P]) ActivateWith ¶
func (a *ParamAction[P]) ActivateWith(p P)
ActivateWith runs the action with p unless it is disabled.
func (*ParamAction) Enabled ¶
func (c *ParamAction) Enabled() bool
Enabled reports whether the action may be activated.
func (*ParamAction) SetEnabled ¶
func (c *ParamAction) SetEnabled(on bool)
SetEnabled enables or disables the action and every proxy bound to it.
func (*ParamAction) Subscribe ¶
func (c *ParamAction) Subscribe(fn func()) (cancel func())
Subscribe registers fn for every enabled or state change; the returned cancel removes it.
func (*ParamAction[P]) Target ¶
func (a *ParamAction[P]) Target(p P) Activatable
Target is the Activatable that runs the action with p.
type ParsedStylesheet ¶ added in v0.2.5
type ParsedStylesheet struct {
// contains filtered or unexported fields
}
ParsedStylesheet is CSS parsed into rules, ready for LoadParsed. It is immutable, so it may be made on one goroutine and installed on another.
func ParseStylesheet ¶ added in v0.2.5
func ParseStylesheet(css string) *ParsedStylesheet
ParseStylesheet parses css on any goroutine. Its parse warnings are held until LoadParsed reports them on the loop.
type Pile ¶
type Pile struct {
// contains filtered or unexported fields
}
Pile stacks its children as cards: collapsed, the front card (index 0) shows whole and the next few peek out past one edge of it, each a step further, scaled down about its middle and fainter, showing only their box (background, border, shadow; through a box-less single-child wrapper such as a SwipeDismiss or Revealer, the box inside it) and never their content; expanded, the cards lay out as a column with a gap. The change between the two moves the cards on their layout motion, which a pile opts its children into (smooth) unless the stylesheet's -lys-layout-motion says otherwise.
The pile carries the `expanded` class while expanded; its children carry `front`, `peek` or `buried` (deeper than the peek, neither painted nor hit). Collapsed, only the front card takes the pointer.
func NewPile ¶
func NewPile() *Pile
NewPile returns an empty, collapsed pile peeking two cards past its bottom edge.
func (*Pile) AccessibleName ¶
func (n *Pile) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Pile) AddClass ¶
func (n *Pile) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Pile) Arrange ¶
Arrange places the cards: collapsed, the front at the end away from the peek edge and each peek at the front's rect, narrowed and shifted toward the edge, the buried ones under the last peek; expanded, a column from the front's end.
func (*Pile) AttachStylesheet ¶
func (n *Pile) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Pile) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Pile) Classes ¶
func (n *Pile) Classes() []string
Classes returns a copy of the widget's classes.
func (*Pile) DebugName ¶
func (n *Pile) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Pile) DetachStylesheet ¶
func (n *Pile) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Pile) Element ¶
func (n *Pile) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Pile) Enabled ¶
func (n *Pile) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Pile) HasState ¶
func (n *Pile) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Pile) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Pile) HitTest ¶
HitTest is the front card collapsed, any card expanded, else the pile within its bounds.
func (*Pile) HoverWithin ¶
func (n *Pile) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Pile) InlineStyle ¶
func (n *Pile) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Pile) Invalidate ¶
func (n *Pile) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Pile) InvalidateLayout ¶
func (n *Pile) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Pile) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Pile) LayoutMotion ¶
func (n *Pile) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Pile) MaximumSize ¶
func (n *Pile) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Pile) Measure ¶
Measure is the front card and its peeks collapsed, the column of cards expanded, inside the pile's CSS box.
func (*Pile) Paint ¶
Paint draws the cards back to front: collapsed, the peeks as their own boxes only, then the front whole; expanded, every card.
func (*Pile) Parent ¶
func (n *Pile) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Pile) RemoveAttr ¶
func (n *Pile) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Pile) RemoveClass ¶
func (n *Pile) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Pile) SetAccessibleName ¶
func (n *Pile) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Pile) SetAttr ¶
func (n *Pile) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Pile) SetClasses ¶
func (n *Pile) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Pile) SetCursorName ¶
func (n *Pile) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Pile) SetDebugName ¶
func (n *Pile) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Pile) SetElement ¶
func (n *Pile) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Pile) SetEnabled ¶
func (n *Pile) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Pile) SetExpanded ¶
SetExpanded lays the cards out as a column (true) or stacks them.
func (*Pile) SetFocusOnClick ¶
func (n *Pile) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Pile) SetHAlign ¶
func (n *Pile) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Pile) SetHExpand ¶
func (n *Pile) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Pile) SetID ¶
func (n *Pile) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Pile) SetInlineStyle ¶
func (n *Pile) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Pile) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Pile) SetLayoutMotion ¶
func (n *Pile) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Pile) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Pile) SetMaximumSize ¶
func (n *Pile) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Pile) SetOnClickWithin ¶
func (n *Pile) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Pile) SetOnFocusChanged ¶
func (n *Pile) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Pile) SetOnHoverWithin ¶
func (n *Pile) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Pile) SetOnPointer ¶
func (n *Pile) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Pile) SetOnScroll ¶
func (n *Pile) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Pile) SetPeek ¶
SetPeek sets how many cards peek behind the front collapsed; below 0 it is 0.
func (*Pile) SetPeekEdge ¶
SetPeekEdge sets the edge the cards peek past: EdgeBottom for a pile hanging from the top of the screen, EdgeTop for one standing on the bottom, whose front card then sits lowest. Expanded, the front card stays at that same end of the column.
func (*Pile) SetPeekOffset ¶
SetPeekOffset sets the step, in logical pixels, each peeking card shows past the one in front of it.
func (*Pile) SetPeekOpacity ¶
SetPeekOpacity sets the opacity, as a fraction in [0, 1], each level of depth keeps of the card in front of it.
func (*Pile) SetPeekScale ¶
SetPeekScale sets the size, as a fraction in (0, 1], each level of depth keeps of the card in front of it, both sides scaling about the card's middle.
func (*Pile) SetSharedElement ¶
func (n *Pile) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Pile) SetSizeRequest ¶
func (n *Pile) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Pile) SetSpacing ¶
SetSpacing sets the gap between expanded cards.
func (*Pile) SetState ¶
func (n *Pile) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Pile) SetTooltip ¶
func (n *Pile) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Pile) SetTooltipMarkup ¶
func (n *Pile) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Pile) SetVAlign ¶
func (n *Pile) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Pile) SetVExpand ¶
func (n *Pile) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Pile) SetVisible ¶
func (n *Pile) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Pile) SharedElement ¶
func (n *Pile) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Pile) SizeRequest ¶
func (n *Pile) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Pile) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Pile) TooltipText ¶
func (n *Pile) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type PixelClaimer ¶
PixelClaimer is a widget that may take a finger scroll before the scrollers beneath it: a swipe-to-dismiss card takes a sideways one. It is offered the first deltas of a gesture no scroller holds yet; true takes them, and then the rest of the gesture (ClaimPixels) and its end (ScrollEnder).
type PixelScroller ¶
type PixelScroller interface {
ScrollPixels(dx, dy float64)
}
PixelScroller is a ScrollHandler that takes exact pixel deltas (touchpads, continuous devices) as well as wheel steps.
type PointerEvent ¶
type PointerEvent struct {
// Button is the wayland button code: BTNLeft, BTNRight, BTNMiddle,
// or a side button beyond them.
Button uint32
// Clicks counts the presses of this button on this widget, each
// within the double-click window of the last: 1, 2 for a double
// press, 3 for a triple.
Clicks int
// Mods are the keyboard modifiers held.
Mods Mods
// At is where the press landed, in root coordinates.
At Point
}
PointerEvent is a pointer button press as a hook sees it.
type PopoverOptions ¶
type PopoverOptions struct {
// Focus takes the keyboard focus as the popover opens.
Focus Widget
// NoGrab leaves the keyboard and pointer with the window: a hover
// card shows beside what the user is pointing at instead of taking
// the input, and closes only when told.
NoGrab bool
// OnClosed runs once the popover is gone, however it closed.
OnClosed func()
// Gap is the distance between the anchor and the popover.
Gap int
// Side is the side of the anchor the popover opens on, below
// unless set.
Side PopoverSide
}
PopoverOptions shape a widget-opened popover.
type PopoverSide ¶
type PopoverSide uint8
PopoverSide is the side of its anchor a popover opens on; the compositor flips it to the other side where there is no room.
const ( PopoverBelow PopoverSide = iota PopoverAbove PopoverRight PopoverLeft )
The popover sides.
type PreferencesGroup ¶
type PreferencesGroup struct {
// contains filtered or unexported fields
}
PreferencesGroup is a labeled boxed list of rows: a header line (title plus an optional suffix, the adw description slot), the bordered card, and rows separated by hairlines. Add appends rows; any widget works, ActionRow and friends are the point.
func NewPreferencesGroup ¶
func NewPreferencesGroup(face render.Font, sizePx float64, title string) *PreferencesGroup
NewPreferencesGroup returns an empty group; title empty skips the header line.
func (*PreferencesGroup) Add ¶
func (g *PreferencesGroup) Add(w Widget)
Add appends a row to the card.
func (*PreferencesGroup) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*PreferencesGroup) Baseline ¶
Baseline implements Baseliner: the root's, laid over the whole rect.
func (*PreferencesGroup) Children ¶
func (c *PreferencesGroup) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*PreferencesGroup) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*PreferencesGroup) Paint ¶
func (g *PreferencesGroup) Paint(cv *render.Canvas)
Paint draws the boxed-list card around the rows with hairlines between them.
func (*PreferencesGroup) SetSuffix ¶
func (g *PreferencesGroup) SetSuffix(s string)
SetSuffix sets the header's trailing note (the adw description slot); empty hides it.
func (*PreferencesGroup) SetTitle ¶
func (g *PreferencesGroup) SetTitle(t string)
SetTitle sets the header title.
type PreferencesPage ¶
type PreferencesPage struct {
// contains filtered or unexported fields
}
PreferencesPage is the scrolling stack of groups: a column of groups in a vertical Scroll, clamped to a readable width - the adw page.
func NewPreferencesPage ¶
func NewPreferencesPage() *PreferencesPage
NewPreferencesPage returns an empty page.
func (*PreferencesPage) Add ¶
func (p *PreferencesPage) Add(w Widget)
Add appends a group (or any widget) to the page.
func (*PreferencesPage) Arrange ¶
func (p *PreferencesPage) Arrange(r render.Rect)
Arrange lays the page out, then brings a pending Reveal into view.
func (*PreferencesPage) Baseline ¶
Baseline implements Baseliner: the root's, laid over the whole rect.
func (*PreferencesPage) Children ¶
func (c *PreferencesPage) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*PreferencesPage) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*PreferencesPage) Reveal ¶
func (p *PreferencesPage) Reveal(w Widget)
Reveal scrolls the page so w is in view at the next layout.
func (*PreferencesPage) ScrollBy ¶
func (p *PreferencesPage) ScrollBy(dx, dy int)
ScrollBy forwards wheel and gesture scrolling to the page's scroll.
func (*PreferencesPage) SetIconName ¶
func (p *PreferencesPage) SetIconName(name string)
SetIconName sets the page's switcher icon by theme name.
func (*PreferencesPage) SetTitle ¶
func (p *PreferencesPage) SetTitle(t string)
SetTitle names the page for a PreferencesView's switcher and search.
func (*PreferencesPage) Title ¶
func (p *PreferencesPage) Title() string
Title returns the page name.
type PreferencesView ¶
type PreferencesView struct {
// contains filtered or unexported fields
}
PreferencesView is the body of libadwaita's AdwPreferencesDialog: PreferencesPages behind a view switcher, a search that lists the matching rows of every page (title or subtitle, case-insensitive; rows opt out with SetSearchable), and subpages pushed over the pages with a back button. Activating a search result shows its page and scrolls the row into view.
func NewPreferencesView ¶
func NewPreferencesView(face render.Font, sizePx float64) *PreferencesView
NewPreferencesView returns an empty preferences view.
func (*PreferencesView) Add ¶
func (v *PreferencesView) Add(p *PreferencesPage)
Add appends a page; the switcher shows once there are two.
func (*PreferencesView) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*PreferencesView) Baseline ¶
Baseline implements Baseliner: the root's, laid over the whole rect.
func (*PreferencesView) Children ¶
func (c *PreferencesView) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*PreferencesView) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*PreferencesView) Pages ¶
func (v *PreferencesView) Pages() []*PreferencesPage
Pages returns the pages in order.
func (*PreferencesView) PopSubpage ¶
func (v *PreferencesView) PopSubpage() bool
PopSubpage returns from the topmost subpage, reporting whether there was one.
func (*PreferencesView) PushSubpage ¶
func (v *PreferencesView) PushSubpage(title string, content Widget)
PushSubpage pushes a page titled title over the preferences with a back button, AdwPreferencesDialog's push_subpage.
func (*PreferencesView) Search ¶
func (v *PreferencesView) Search(text string)
Search runs a search for text, as typing in the search entry does; empty returns to the page shown before.
func (*PreferencesView) ShowPage ¶
func (v *PreferencesView) ShowPage(p *PreferencesPage)
ShowPage shows p.
func (*PreferencesView) VisiblePage ¶
func (v *PreferencesView) VisiblePage() *PreferencesPage
VisiblePage returns the shown page, nil while searching.
type PressAter ¶
type PressAter interface {
PressAt(p Point)
}
PressAter receives where a press landed, right after SetPressed(true): a slider warps its value there (gtk-primary-button-warps-slider).
type PressEnder ¶
type PressEnder interface {
PressEnd()
}
PressEnder receives the end of a press gesture: the release (after any click), a cancelled press (the gesture became a data-device drag), or pointer loss (the device went away mid-gesture). Widgets that accumulate gesture state across DragMove calls — a list's rubber-band selection, say — settle and flush it here, so a gesture that ends off-widget still concludes exactly once.
type PressSetter ¶
type PressSetter interface {
SetPressed(on bool)
}
PressSetter receives press tracking from the Router.
type ProgressBar ¶
type ProgressBar struct {
// Fill and Trough color the bar; zero is the theme's accent (or
// the accent-color) and, for the trough, the fill at a fifth of
// its opacity, under the trough and progress rules.
Fill, Trough render.Color
// PulseStep is how far one Pulse moves the block (GTK pulse-step).
PulseStep float64
// contains filtered or unexported fields
}
ProgressBar paints a read-only fill over a trough, as GTK's node tree: `progressbar > trough > progress` - the bar's box, the trough's, and the fill's, each styled by the cascade. Besides the fraction it has GTK's activity mode for work of unknown length: Pulse steps a bouncing block, SetPulsing animates it continuously, and SetValue returns to the fraction.
func NewProgressBar ¶
func NewProgressBar(value float64) *ProgressBar
NewProgressBar returns a progress bar at value clamped to [0, 1].
func (*ProgressBar) Activity ¶
func (p *ProgressBar) Activity() bool
Activity reports whether the bar is in activity mode.
func (*ProgressBar) Arrange ¶
func (p *ProgressBar) Arrange(r render.Rect)
Arrange lays the bar out and syncs the pulse with visibility.
func (*ProgressBar) HitTest ¶
func (p *ProgressBar) HitTest(pt Point) Widget
HitTest returns the bar when p is inside its bounds.
func (*ProgressBar) Measure ¶
func (p *ProgressBar) Measure(axis Axis, forSize int) Sizes
Measure wants the 160x10 trough inside the bar's CSS box.
func (*ProgressBar) Paint ¶
func (p *ProgressBar) Paint(cv *render.Canvas)
Paint draws the trough and the fill: the fraction, or the block.
func (*ProgressBar) Pulse ¶
func (p *ProgressBar) Pulse()
Pulse enters activity mode and moves the block one PulseStep, bouncing off the trough's ends.
func (*ProgressBar) Pulsing ¶
func (p *ProgressBar) Pulsing() bool
Pulsing reports whether the continuous animation is on.
func (*ProgressBar) SetPulsing ¶
func (p *ProgressBar) SetPulsing(on bool)
SetPulsing animates the activity block continuously while the bar is on screen; off freezes it in place (SetValue leaves the mode).
func (*ProgressBar) SetValue ¶
func (p *ProgressBar) SetValue(v float64)
SetValue sets the fraction, leaving activity mode.
type ProgressRing ¶
type ProgressRing struct {
// contains filtered or unexported fields
}
ProgressRing is a circular determinate progress: the fraction sweeps clockwise from twelve o'clock over a full-circle track, with an optional child centered inside, a percentage or an icon. Its node tree is ProgressBar's, `progressring > trough > progress`: the ring's min-width and min-height set the diameter, the trough's min-height the stroke, and the trough's and progress's background colors the track and the fill, the fill the accent (or the accent-color) and the track the fill at a fifth of its opacity unless set. The success, warning and error classes recolor it. A new value eases in over the theme's medium motion.
func NewProgressRing ¶
func NewProgressRing(value float64) *ProgressRing
NewProgressRing returns a ring at value clamped to [0, 1].
func (*ProgressRing) AccessibleName ¶
func (n *ProgressRing) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*ProgressRing) AddClass ¶
func (n *ProgressRing) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*ProgressRing) Arrange ¶
func (r *ProgressRing) Arrange(rect render.Rect)
Arrange centers the ring's square in the content box and the child at its natural size in the square.
func (*ProgressRing) AttachStylesheet ¶
func (n *ProgressRing) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*ProgressRing) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*ProgressRing) Child ¶
func (r *ProgressRing) Child() Widget
Child returns the centered widget, nil when none.
func (*ProgressRing) Children ¶
func (r *ProgressRing) Children() []Widget
Children returns the centered widget.
func (*ProgressRing) Classes ¶
func (n *ProgressRing) Classes() []string
Classes returns a copy of the widget's classes.
func (*ProgressRing) DebugName ¶
func (n *ProgressRing) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*ProgressRing) DetachStylesheet ¶
func (n *ProgressRing) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*ProgressRing) Element ¶
func (n *ProgressRing) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*ProgressRing) Enabled ¶
func (n *ProgressRing) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*ProgressRing) HAlign ¶
func (n *ProgressRing) HAlign() Align
HAlign returns the horizontal placement.
func (*ProgressRing) HasState ¶
func (n *ProgressRing) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*ProgressRing) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*ProgressRing) HitTest ¶
func (r *ProgressRing) HitTest(p Point) Widget
HitTest returns the child under p, else the ring inside its bounds.
func (*ProgressRing) HoverWithin ¶
func (n *ProgressRing) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*ProgressRing) ID ¶
func (n *ProgressRing) ID() string
ID returns the style id, empty when none is set.
func (*ProgressRing) InlineStyle ¶
func (n *ProgressRing) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*ProgressRing) Invalidate ¶
func (n *ProgressRing) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*ProgressRing) InvalidateLayout ¶
func (n *ProgressRing) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*ProgressRing) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*ProgressRing) LayoutMotion ¶
func (n *ProgressRing) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*ProgressRing) MaximumSize ¶
func (n *ProgressRing) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*ProgressRing) Measure ¶
func (r *ProgressRing) Measure(axis Axis, forSize int) Sizes
Measure wants the diameter square inside the ring's CSS box.
func (*ProgressRing) Paint ¶
func (r *ProgressRing) Paint(cv *render.Canvas)
Paint strokes the track and the sweep, then the child.
func (*ProgressRing) Parent ¶
func (n *ProgressRing) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*ProgressRing) RemoveAttr ¶
func (n *ProgressRing) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*ProgressRing) RemoveClass ¶
func (n *ProgressRing) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*ProgressRing) SetAccessibleName ¶
func (n *ProgressRing) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*ProgressRing) SetAttr ¶
func (n *ProgressRing) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*ProgressRing) SetChild ¶
func (r *ProgressRing) SetChild(w Widget)
SetChild centers w inside the ring; nil removes it.
func (*ProgressRing) SetClasses ¶
func (n *ProgressRing) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*ProgressRing) SetCursorName ¶
func (n *ProgressRing) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*ProgressRing) SetDebugName ¶
func (n *ProgressRing) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*ProgressRing) SetElement ¶
func (n *ProgressRing) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*ProgressRing) SetEnabled ¶
func (n *ProgressRing) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*ProgressRing) SetFocusOnClick ¶
func (n *ProgressRing) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*ProgressRing) SetHAlign ¶
func (n *ProgressRing) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*ProgressRing) SetHExpand ¶
func (n *ProgressRing) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*ProgressRing) SetID ¶
func (n *ProgressRing) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*ProgressRing) SetInlineStyle ¶
func (n *ProgressRing) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*ProgressRing) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*ProgressRing) SetLayoutMotion ¶
func (n *ProgressRing) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*ProgressRing) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*ProgressRing) SetMaximumSize ¶
func (n *ProgressRing) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*ProgressRing) SetOnClickWithin ¶
func (n *ProgressRing) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*ProgressRing) SetOnFocusChanged ¶
func (n *ProgressRing) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*ProgressRing) SetOnHoverWithin ¶
func (n *ProgressRing) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*ProgressRing) SetOnPointer ¶
func (n *ProgressRing) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*ProgressRing) SetOnScroll ¶
func (n *ProgressRing) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*ProgressRing) SetSharedElement ¶
func (n *ProgressRing) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*ProgressRing) SetSizeRequest ¶
func (n *ProgressRing) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*ProgressRing) SetState ¶
func (n *ProgressRing) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*ProgressRing) SetTooltip ¶
func (n *ProgressRing) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*ProgressRing) SetTooltipMarkup ¶
func (n *ProgressRing) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*ProgressRing) SetVAlign ¶
func (n *ProgressRing) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*ProgressRing) SetVExpand ¶
func (n *ProgressRing) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*ProgressRing) SetValue ¶
func (r *ProgressRing) SetValue(v float64)
SetValue clamps v to [0, 1] and eases the sweep to it.
func (*ProgressRing) SetVisible ¶
func (n *ProgressRing) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*ProgressRing) SharedElement ¶
func (n *ProgressRing) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*ProgressRing) SizeRequest ¶
func (n *ProgressRing) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*ProgressRing) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*ProgressRing) TooltipText ¶
func (n *ProgressRing) TooltipText() string
TooltipText returns the hover text, empty when none is set.
func (*ProgressRing) VAlign ¶
func (n *ProgressRing) VAlign() Align
VAlign returns the vertical placement.
func (*ProgressRing) Value ¶
func (r *ProgressRing) Value() float64
Value returns the fraction in [0, 1].
type RawKeyHandler ¶
type RawKeyHandler interface {
// RawKey reports whether the press was consumed. code is the
// evdev keycode, sym its keysym, mods the held modifiers.
RawKey(code uint32, mods Mods, sym xkb.Keysym) bool
}
RawKeyHandler sees the key presses the action translation does not cover — letters and other keysyms that carry no KeyAction — while its tree holds the keyboard (a popup menu under a grab, say). Returning true consumes the press; a false return hands nothing on (the host decides what, if anything, happens next). Mnemonics and accelerators ride this path.
type RevealTransition ¶
type RevealTransition uint8
RevealTransition is how a Revealer brings its child in and out.
const ( // RevealNone shows and hides at once; a hidden child takes no space. RevealNone RevealTransition = iota // RevealFade fades the child's opacity. RevealFade // RevealSlideUp slides the child in from below, clipped to its slot. RevealSlideUp // RevealSlideDown slides the child in from above. RevealSlideDown // RevealSlideLeft slides the child in from the right. RevealSlideLeft // RevealSlideRight slides the child in from the left. RevealSlideRight // RevealBounce scales the child up from its center, overshooting, // while it fades in. RevealBounce // RevealZoom scales the child up from its center while it fades in. RevealZoom // RevealRotate spins the child half a turn while it grows from 30% // and fades in. RevealRotate // RevealFlip widens the child from a vertical line at its center. RevealFlip // RevealSwingUp swings the child up about its bottom edge. RevealSwingUp // RevealSwingDown swings the child down about its top edge. RevealSwingDown // RevealSwingLeft swings the child about its right edge. RevealSwingLeft // RevealSwingRight swings the child about its left edge. RevealSwingRight // RevealGenie sucks the child toward the revealer's genie edge. RevealGenie )
type Revealer ¶
type Revealer struct {
// contains filtered or unexported fields
}
Revealer shows one child through an enter/exit transition: a fade, a slide clipped to the child's slot, or a transformed composite (zoom, bounce, rotate, flip, swing, genie) drawn through an offscreen layer with its opacity. Progress runs linearly in time toward the target; each transition shapes it with its own curve, the bounce overshooting.
Every transition but RevealNone reserves the child's full size for the whole run, hidden included, and moves the child within it, so a content-sized surface keeps its size while a card slides in over its own slot. RevealNone takes no space while hidden.
The child hit-tests at its slot whenever any of it shows; a transform moves pixels, not input.
func NewRevealer ¶
NewRevealer wraps child hidden, fading over 200ms.
func (*Revealer) AccessibleName ¶
func (n *Revealer) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Revealer) AddClass ¶
func (n *Revealer) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Revealer) Arrange ¶
Arrange gives the child the whole rect; a collapsing slide's child keeps its natural extent along the slide, its leading edge on the slot's growing edge.
func (*Revealer) AttachStylesheet ¶
func (n *Revealer) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Revealer) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Revealer) Children ¶
Children exposes the child for damage, focus and accessibility while any of it shows or is being revealed, so keyboard traversal and the accessibility tree skip a hidden revealer's content.
func (*Revealer) Classes ¶
func (n *Revealer) Classes() []string
Classes returns a copy of the widget's classes.
func (*Revealer) DebugName ¶
func (n *Revealer) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Revealer) DetachStylesheet ¶
func (n *Revealer) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Revealer) Element ¶
func (n *Revealer) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Revealer) Enabled ¶
func (n *Revealer) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Revealer) Finish ¶
func (r *Revealer) Finish()
Finish lands a running transition at once, reporting it as its end would; with none running it does nothing. It is the escape for a surface that must go now (a shutdown, a test without a clock).
func (*Revealer) HAlign ¶
func (n *Revealer) HAlign() Align
HAlign returns the horizontal placement.
func (*Revealer) HasState ¶
func (n *Revealer) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Revealer) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Revealer) HoverWithin ¶
func (n *Revealer) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Revealer) ID ¶
func (n *Revealer) ID() string
ID returns the style id, empty when none is set.
func (*Revealer) InlineStyle ¶
func (n *Revealer) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Revealer) Invalidate ¶
func (n *Revealer) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Revealer) InvalidateLayout ¶
func (n *Revealer) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Revealer) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Revealer) LayoutMotion ¶
func (n *Revealer) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Revealer) MaximumSize ¶
func (n *Revealer) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Revealer) Measure ¶
Measure is the child's size, nothing for a hidden RevealNone, and for a collapsing slide the child's natural extent along the slide scaled by the eased progress.
func (*Revealer) Parent ¶
func (n *Revealer) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Revealer) Progress ¶
Progress is how far the child is shown, 0 hidden to 1 shown, before the transition's curve.
func (*Revealer) RemoveAttr ¶
func (n *Revealer) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Revealer) RemoveClass ¶
func (n *Revealer) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Revealer) Revealed ¶
Revealed reports the target state: true once SetRevealed(true) asked for the child, whether or not the enter has finished.
func (*Revealer) SetAccessibleName ¶
func (n *Revealer) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Revealer) SetAttr ¶
func (n *Revealer) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Revealer) SetClasses ¶
func (n *Revealer) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Revealer) SetCollapse ¶
SetCollapse makes a slide take space as it shows, the way a GTK revealer does: along the slide's axis the revealer measures the child's natural size scaled by the eased progress, nothing while hidden, and the child keeps its full size, its leading edge riding the slot's growing edge, clipped to the slot. Content below a collapsing revealer moves with it. Only the four slides collapse; the other transitions reserve the child's full size whatever this says.
func (*Revealer) SetCursorName ¶
func (n *Revealer) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Revealer) SetDebugName ¶
func (n *Revealer) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Revealer) SetDuration ¶
SetDuration sets the full transition length; zero snaps.
func (*Revealer) SetElement ¶
func (n *Revealer) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Revealer) SetEnabled ¶
func (n *Revealer) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Revealer) SetFocusOnClick ¶
func (n *Revealer) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Revealer) SetGenieEdge ¶
SetGenieEdge picks the edge RevealGenie collapses toward.
func (*Revealer) SetHAlign ¶
func (n *Revealer) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Revealer) SetHExpand ¶
func (n *Revealer) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Revealer) SetID ¶
func (n *Revealer) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Revealer) SetInlineStyle ¶
func (n *Revealer) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Revealer) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Revealer) SetLayoutMotion ¶
func (n *Revealer) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Revealer) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Revealer) SetMaximumSize ¶
func (n *Revealer) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Revealer) SetOnClickWithin ¶
func (n *Revealer) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Revealer) SetOnFocusChanged ¶
func (n *Revealer) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Revealer) SetOnHoverWithin ¶
func (n *Revealer) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Revealer) SetOnPointer ¶
func (n *Revealer) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Revealer) SetOnScroll ¶
func (n *Revealer) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Revealer) SetOnTransitionDone ¶
SetOnTransitionDone runs fn whenever a transition lands, with the state it landed in: the hook for unmapping a surface or dropping a card once its exit has played.
func (*Revealer) SetRevealed ¶
SetRevealed starts the transition toward shown or hidden. A reversal mid-flight starts from where the child is and runs the full duration. Asking for the current target changes nothing.
func (*Revealer) SetSharedElement ¶
func (n *Revealer) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Revealer) SetSizeRequest ¶
func (n *Revealer) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Revealer) SetState ¶
func (n *Revealer) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Revealer) SetTooltip ¶
func (n *Revealer) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Revealer) SetTooltipMarkup ¶
func (n *Revealer) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Revealer) SetTransition ¶
func (r *Revealer) SetTransition(t RevealTransition)
SetTransition picks the transition the next reveal or hide plays.
func (*Revealer) SetVAlign ¶
func (n *Revealer) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Revealer) SetVExpand ¶
func (n *Revealer) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Revealer) SetVisible ¶
func (n *Revealer) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Revealer) SharedElement ¶
func (n *Revealer) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Revealer) SizeRequest ¶
func (n *Revealer) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Revealer) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Revealer) TooltipText ¶
func (n *Revealer) TooltipText() string
TooltipText returns the hover text, empty when none is set.
func (*Revealer) Transition ¶
func (r *Revealer) Transition() RevealTransition
Transition returns the transition style.
type RichLabel ¶
type RichLabel struct {
// OnLinkClick fires when a press-release lands on a link run.
OnLinkClick func(href string)
// contains filtered or unexported fields
}
RichLabel paints a single line of styled text driven by the minimal markup subset ParseMarkup accepts; see that function for the grammar and the escaping rules. Input ParseMarkup rejects renders literally, tags and all, so malformed markup can never panic or break a layout.
Text is shaped once per run and drawn on one shared baseline; the line height is the maximum over the runs, so a taller face grows the box instead of misaligning its neighbors. Links (<a href=...>) are opt-in: they underline in the run's color, and installing OnLinkClick makes them clickable with a hand cursor.
func NewRichLabel ¶
NewRichLabel returns a rich label that paints markup with face at sizePx pixels in color. Face may be a render.Chain for mixed-script fallback; it shapes every run until SetVariants provides real variants. The argument order is the toolkit-wide constructor order: face, then sizePx, then the content, then colors. A nil face panics here (see requireFace) instead of failing later, in shaping.
func (*RichLabel) AccessibleName ¶
func (n *RichLabel) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*RichLabel) AddClass ¶
func (n *RichLabel) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*RichLabel) Arrange ¶
Arrange records the border box inside r, the margin box, and fits the line to the content box's width.
func (*RichLabel) AttachStylesheet ¶
func (n *RichLabel) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*RichLabel) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*RichLabel) CharsWithin ¶
CharsWithin is how many approximate character widths fit in px, the max-width-chars that holds the label's natural width to px.
func (*RichLabel) Classes ¶
func (n *RichLabel) Classes() []string
Classes returns a copy of the widget's classes.
func (*RichLabel) ClearSelection ¶
func (l *RichLabel) ClearSelection()
ClearSelection drops the highlight.
func (*RichLabel) ClickAt ¶
ClickAt fires OnLinkClick when the click lands on a link run; a selectable label's plain click drops the selection.
func (*RichLabel) CursorName ¶
CursorName asks for the pointing hand while the pointer sits on a link run.
func (*RichLabel) DebugName ¶
func (n *RichLabel) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*RichLabel) DetachStylesheet ¶
func (n *RichLabel) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*RichLabel) Direction ¶
Direction returns the base paragraph direction the line resolves with.
func (*RichLabel) Element ¶
func (n *RichLabel) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*RichLabel) Ellipsize ¶
func (l *RichLabel) Ellipsize() EllipsizeMode
Ellipsize returns the truncation mode.
func (*RichLabel) Enabled ¶
func (n *RichLabel) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*RichLabel) HAlign ¶
func (n *RichLabel) HAlign() Align
HAlign returns the horizontal placement.
func (*RichLabel) HasState ¶
func (n *RichLabel) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*RichLabel) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*RichLabel) HoverWithin ¶
func (n *RichLabel) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*RichLabel) ID ¶
func (n *RichLabel) ID() string
ID returns the style id, empty when none is set.
func (*RichLabel) InlineStyle ¶
func (n *RichLabel) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*RichLabel) Invalidate ¶
func (n *RichLabel) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*RichLabel) InvalidateLayout ¶
func (n *RichLabel) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*RichLabel) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*RichLabel) LayoutMotion ¶
func (n *RichLabel) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*RichLabel) MaxWidthChars ¶
MaxWidthChars returns the natural-width cap in characters, 0 when unset.
func (*RichLabel) MaximumSize ¶
func (n *RichLabel) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*RichLabel) Measure ¶
Measure reports the line inside the CSS box: across its total advance, needing the ellipsis when it ellipsizes, else its widest token when it wraps, else all of it, max-width-chars holding the advance of one that can narrow; down one line height - the maximum over the runs - per row it wraps into at the width given.
func (*RichLabel) Paint ¶
Paint draws the selection highlight, then each run: its background, its variant face off its baseline shift, its color (a span color wins over the label color, faded by its alpha), and an underline for link runs. Wrap mode lays one row per baseline.
func (*RichLabel) Parent ¶
func (n *RichLabel) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*RichLabel) PressAt ¶
PressAt starts a drag selection at the pressed rune. user-select none never starts one; all selects the whole text.
func (*RichLabel) RemoveAttr ¶
func (n *RichLabel) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*RichLabel) RemoveClass ¶
func (n *RichLabel) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*RichLabel) Selectable ¶
Selectable reports whether the label takes drag selections.
func (*RichLabel) SelectedText ¶
SelectedText is the selected runes and whether any are selected, the copy path's source.
func (*RichLabel) SelectionBands ¶
SelectionBands returns the selection rectangles covering runes [start, end) of Text(), in root coordinates: one band per run the range touches, spanning the widget's full height. Rich labels have no editing caret; bands are the whole of their selection geometry.
func (*RichLabel) SetAccessibleName ¶
func (n *RichLabel) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*RichLabel) SetAlignment ¶
SetAlignment selects horizontal placement when the arranged rect is wider than the line.
func (*RichLabel) SetAttr ¶
func (n *RichLabel) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*RichLabel) SetClasses ¶
func (n *RichLabel) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*RichLabel) SetCursorName ¶
func (n *RichLabel) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*RichLabel) SetDebugName ¶
func (n *RichLabel) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*RichLabel) SetDirection ¶
SetDirection selects the base paragraph direction the line resolves and lays out with. DirectionAuto (the default) reads it off the line's first strong character; the resolution spans the whole line, so styled spans reorder together. Start/end alignment mirrors with the resolved direction. Changing the direction re-resolves the line and drops the measure cache.
func (*RichLabel) SetElement ¶
func (n *RichLabel) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*RichLabel) SetEllipsize ¶
func (l *RichLabel) SetEllipsize(mode EllipsizeMode)
SetEllipsize sets how a line wider than its box truncates: Start, Middle, or End trade runes for an ellipsis, in the style of the run it stands beside, until the line fits; None (the default) lets it overflow. The natural width stays the whole line's.
func (*RichLabel) SetEnabled ¶
func (n *RichLabel) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*RichLabel) SetFocusOnClick ¶
func (n *RichLabel) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*RichLabel) SetHAlign ¶
func (n *RichLabel) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*RichLabel) SetHExpand ¶
func (n *RichLabel) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*RichLabel) SetHovered ¶
SetHovered forgets the pointer position on leave.
func (*RichLabel) SetID ¶
func (n *RichLabel) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*RichLabel) SetInlineStyle ¶
func (n *RichLabel) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*RichLabel) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*RichLabel) SetLayoutMotion ¶
func (n *RichLabel) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*RichLabel) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*RichLabel) SetMarkup ¶
SetMarkup replaces the label markup and invalidates its bounds. Markup ParseMarkup rejects renders literally.
func (*RichLabel) SetMaxLines ¶
SetMaxLines caps a wrapping, ellipsizing label at n rows: past that the rows merge into the last and the truncation mode ellipsizes it. 0, the default, is no cap.
func (*RichLabel) SetMaxWidthChars ¶
SetMaxWidthChars caps the label's natural width at n approximate character widths, GTK's max-width-chars: a wrapping label lays its text out wrapped at the cap and asks for its widest row, a single line truncates by the ellipsize mode; a shorter text keeps its own width. n <= 0 removes the cap.
func (*RichLabel) SetMaximumSize ¶
func (n *RichLabel) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*RichLabel) SetOnClickWithin ¶
func (n *RichLabel) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*RichLabel) SetOnFocusChanged ¶
func (n *RichLabel) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*RichLabel) SetOnHoverWithin ¶
func (n *RichLabel) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*RichLabel) SetOnPointer ¶
func (n *RichLabel) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*RichLabel) SetOnScroll ¶
func (n *RichLabel) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*RichLabel) SetSelectable ¶
SetSelectable lets a press drag a text selection across the label, the readout a user copies; ctrl+c copies it through SelectedText.
func (*RichLabel) SetSelection ¶
SetSelection highlights the rune range [start, end) of Text(), clamped; an empty range paints nothing.
func (*RichLabel) SetSharedElement ¶
func (n *RichLabel) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*RichLabel) SetSizeRequest ¶
func (n *RichLabel) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*RichLabel) SetState ¶
func (n *RichLabel) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*RichLabel) SetTooltip ¶
func (n *RichLabel) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*RichLabel) SetTooltipMarkup ¶
func (n *RichLabel) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*RichLabel) SetVAlign ¶
func (n *RichLabel) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*RichLabel) SetVExpand ¶
func (n *RichLabel) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*RichLabel) SetVariants ¶
func (l *RichLabel) SetVariants(v VariantFunc)
SetVariants installs the face variants bold and italic runs shape with, and re-shapes the label. Plain runs always shape with the base face.
func (*RichLabel) SetVisible ¶
func (n *RichLabel) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*RichLabel) SetWrap ¶
SetWrap toggles word wrapping at the arranged width: Measure reports the widest wrapped row and one line height per row, and Paint lays the rows out with the alignment. Changing it relayouts.
func (*RichLabel) SharedElement ¶
func (n *RichLabel) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*RichLabel) SizeRequest ¶
func (n *RichLabel) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*RichLabel) Text ¶
Text returns the label's decoded plain text: the concatenated run text, or the raw input when the markup was rejected.
func (*RichLabel) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*RichLabel) TooltipText ¶
func (n *RichLabel) TooltipText() string
TooltipText returns the hover text, empty when none is set.
func (*RichLabel) VAlign ¶
func (n *RichLabel) VAlign() Align
VAlign returns the vertical placement.
type Role ¶
type Role uint8
Role classifies a widget for assistive technology. The names follow the AT-SPI roles an out-of-process bridge would translate to, so callers can switch on them without lys-ui gaining a dbus dependency.
const ( RoleNone Role = iota RoleButton RoleLabel RoleEntry RoleTextArea RoleSlider RoleSwitch RoleCheckBox RoleProgressBar RoleLevelBar RoleScrollArea RoleList RoleMenu RoleTabList RoleComboBox RoleSplitter RoleCalendar RoleColorChooser RoleScrollBar // RoleToggleButton is a button that stays pressed (GTK's // toggle-button role); A11yState.Pressed carries its state. RoleToggleButton // RoleAlert is an inline callout assistive technology announces // (an Alert). RoleAlert // RoleChart is a chart, named by a summary of its data. RoleChart )
Semantic roles. RoleNone is zero: layout containers, spacers, and unclassified leaves; the rest name the interactive and text widgets, translated to their AT-SPI names by String.
type Roleer ¶
type Roleer interface {
// Role returns the widget's semantic role.
Role() Role
}
Roleer is implemented by widgets carrying a semantic role.
type Router ¶
type Router struct {
// Root is the widget tree inputs route through.
Root Widget
// contains filtered or unexported fields
}
Router turns pointer and keyboard input into widget state changes: hover tracking, press/release with click detection, drags, scroll bubbling, and focus for keyboard text.
The Router is not safe for concurrent use; call it from the same goroutine that dispatches the wayland connection.
func (*Router) Axis ¶
Axis routes vertical and horizontal scrolling to the hovered widget or the nearest ancestor that handles scrolling, mods held. A scroll hook (SetOnScroll) on the way sees the step first and consumes it only when it says so; a disabled ScrollHandler stops the walk: the wheel never scrolls through an inert viewport to an outer one.
func (*Router) AxisEnd ¶
func (r *Router) AxisEnd()
AxisEnd ends a finger scroll: the PixelScroller that took the gesture's pixels hears it (ScrollEnder) even when the pointer has since moved off it.
func (*Router) AxisPixels ¶
AxisPixels routes exact scroll deltas like Axis routes steps: to the nearest scrolling widget under the pointer, which takes the pixels when it is a PixelScroller; any other, and a scroll hook on the way, gets whole steps as the pixels add up to them.
func (*Router) BeginDrop ¶ added in v0.2.5
BeginDrop clears the hover state and returns what hands the current drop target its payload once the bytes are in: the target stays the one under the drop, whatever drags come through while they travel.
func (*Router) CancelPress ¶
func (r *Router) CancelPress()
CancelPress drops the active press without a click: a gesture that became a data-device drag must not fire the widget on release.
func (*Router) DragAction ¶
DragAction is the current drop target's pick among offered (DropActionChooser), ActionNone to leave the choice to the default.
func (*Router) DragEnter ¶
DragEnter routes a drag entering the tree: find the drop target at p, ask it for a decision by mime, and highlight it only when it accepted. Returns the accepted mime ("" rejects).
func (*Router) DragHover ¶
DragHover routes drag movement within the tree. The compositor only sends enter on surface changes, so crossing between targets inside one surface retargets here, with the mimes from the enter.
func (*Router) DragLeave ¶
func (r *Router) DragLeave()
DragLeave clears the drop target after the drag left the surface or ended without a drop.
func (*Router) DragMime ¶
DragMime returns the mime the current drop target accepted, empty while nothing is accepted; the payload is fetched for it on drop.
func (*Router) Drop ¶
Drop delivers the drop to the current drop target and clears the hover state. data carries the payload bytes the app fetched from the offer — or through the same-process shortcut.
func (*Router) FocusNext ¶
func (r *Router) FocusNext()
FocusNext moves focus to the next focusable widget in paint order, wrapping around; with no focus it takes the first.
func (*Router) FocusPrev ¶
func (r *Router) FocusPrev()
FocusPrev moves focus to the previous focusable widget.
func (*Router) Forget ¶
Forget drops every piece of router state that points at w or into w's subtree — the widget-removal counterpart of PointerLost. Hover clears, so no hover shade or tooltip dwell outlives a removed widget; the press is cancelled without a click (its release must never click a ghost); the drop target clears, so a drop cannot land on detached content; and focus — including a focus on a descendant — moves to the next focusable widget in paint order, exactly like focusAfter, or nowhere when none follows. Containers fire this through the removal hook (SetRemovedHook); descent is decided from the parent links the last Arrange recorded, the same bookkeeping markSub walks.
func (*Router) Gesture ¶
Gesture routes g: a Begin (or a long press) goes to the widget under g.At and up its ancestors until one claims it; the rest of the gesture goes to the claimer. It reports whether a widget took it.
func (*Router) KeyAction ¶
KeyAction delivers an editing or activation action to the focused widget — never to one that went disabled since it took focus; see keyboardTarget. An ancestor KeyInterceptor sees the action first (GTK's key controller on a parent), and an ancestor FocusNavigator may move focus instead.
func (*Router) Leave ¶
func (r *Router) Leave()
Leave clears hover state when the pointer leaves the surface.
func (*Router) Move ¶
Move updates hover state and feeds drags and in-widget hover tracking. p is in root coordinates. A hit inside a disabled subtree hovers nothing: an inert control shows no hover shade.
func (*Router) PointerLost ¶
func (r *Router) PointerLost()
PointerLost ends every pointer-derived state because the pointer stopped delivering events: the device went away (wl_seat capability loss) or the compositor ended the grab that kept it here. The active press is cancelled without a click — its release will never arrive — and hover clears, so nothing stays highlighted or half-pressed for a device that is gone.
func (*Router) Press ¶
Press records a pointer button press, mods held. p is in root coordinates. A pointer hook (SetOnPointer) sees it first and may consume it. A press on a disabled widget is swallowed whole: no pressed shade, no drag, and no focus move — focus stays where it was, exactly like a press on empty space outside any control leaves a text field alone.
func (*Router) Rehover ¶
Rehover re-picks the hovered widget under the resting pointer after a layout moved the tree beneath it (a scroll, a reflow, a removal): hover follows what is under the pointer now, not what was there when it last moved. A press in progress keeps its target. Reports whether the hover changed.
func (*Router) Release ¶
Release finishes a press: a release over the pressed widget clicks it — unless the widget was disabled between press and release, in which case the click dies with the gesture.
func (*Router) SelectAll ¶
func (r *Router) SelectAll()
SelectAll asks the focused widget to select its entire content, honoring a disable-during-focus just like KeyAction.
func (*Router) SetFocus ¶
SetFocus moves keyboard focus to w, the programmatic counterpart of clicking it: a search entry that should take typing the moment its surface maps is focused this way. A w that cannot take focus fails with ErrNotFocusable and one outside this router's tree with ErrNotInTree, leaving focus where it was; nil clears focus.
type RouterPointer ¶
type RouterPointer struct{ R *Router }
RouterPointer is TouchPointer straight onto a router: move, left press and release, and a cancelled press. The emulated pointer leaves after a release - a finger does not hover.
func (RouterPointer) TouchCancel ¶
func (p RouterPointer) TouchCancel()
TouchCancel implements TouchPointer.
func (RouterPointer) TouchMove ¶
func (p RouterPointer) TouchMove(at Point)
TouchMove implements TouchPointer.
func (RouterPointer) TouchPress ¶
func (p RouterPointer) TouchPress(at Point)
TouchPress implements TouchPointer.
func (RouterPointer) TouchRelease ¶
func (p RouterPointer) TouchRelease(at Point)
TouchRelease implements TouchPointer.
type RuneHandler ¶
type RuneHandler interface {
InsertRune(r rune)
}
RuneHandler receives typed characters.
type SchemeStyle ¶
SchemeStyle is one style of a TextScheme. Zero colors keep what the text would paint with; Bold and Italic shape with the faces SetVariants gives.
type ScreenPick ¶
type ScreenPick struct {
// OnPick receives the clicked pixel's color.
OnPick func(render.Color)
// contains filtered or unexported fields
}
ScreenPick displays one captured screen and reports the pixel color under clicks - the eyedropper's view (#84). The capture arrives as a plain image (the app's capture pipeline grabbed it off the loop), paints scaled to fit, and a click maps back to the exact source pixel, so colors are picked from what the screen really showed. The cursor is a crosshair; the picked color lands in OnPick exactly once per click.
func NewScreenPick ¶
func NewScreenPick(img image.Image) *ScreenPick
NewScreenPick returns a pick view over img, handed over read-only.
func (*ScreenPick) AccessibleName ¶
func (n *ScreenPick) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*ScreenPick) AddClass ¶
func (n *ScreenPick) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*ScreenPick) Arrange ¶
func (s *ScreenPick) Arrange(r render.Rect)
Arrange records the rect; the drawn fit is computed in Paint from the mapped device rect, the same math every image draw uses.
func (*ScreenPick) AttachStylesheet ¶
func (n *ScreenPick) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*ScreenPick) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*ScreenPick) Classes ¶
func (n *ScreenPick) Classes() []string
Classes returns a copy of the widget's classes.
func (*ScreenPick) ClickAt ¶
func (s *ScreenPick) ClickAt(p Point)
ClickAt picks the source pixel under the point and hands its color to OnPick. Points in the letterbox clamp to the nearest edge pixel.
func (*ScreenPick) DebugName ¶
func (n *ScreenPick) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*ScreenPick) DetachStylesheet ¶
func (n *ScreenPick) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*ScreenPick) Element ¶
func (n *ScreenPick) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*ScreenPick) Enabled ¶
func (n *ScreenPick) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*ScreenPick) HAlign ¶
func (n *ScreenPick) HAlign() Align
HAlign returns the horizontal placement.
func (*ScreenPick) HasState ¶
func (n *ScreenPick) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*ScreenPick) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*ScreenPick) HitTest ¶
func (s *ScreenPick) HitTest(p Point) Widget
HitTest resolves inside the bounds.
func (*ScreenPick) HoverWithin ¶
func (n *ScreenPick) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*ScreenPick) ID ¶
func (n *ScreenPick) ID() string
ID returns the style id, empty when none is set.
func (*ScreenPick) InlineStyle ¶
func (n *ScreenPick) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*ScreenPick) Invalidate ¶
func (n *ScreenPick) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*ScreenPick) InvalidateLayout ¶
func (n *ScreenPick) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*ScreenPick) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*ScreenPick) LayoutMotion ¶
func (n *ScreenPick) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*ScreenPick) MaximumSize ¶
func (n *ScreenPick) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*ScreenPick) Measure ¶
func (s *ScreenPick) Measure(axis Axis, forSize int) Sizes
Measure is the image's pictureRequest: the dialog scales it down to fit.
func (*ScreenPick) Paint ¶
func (s *ScreenPick) Paint(cv *render.Canvas)
Paint draws the image scaled to fit, letterboxed inside the bounds.
func (*ScreenPick) Parent ¶
func (n *ScreenPick) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*ScreenPick) RemoveAttr ¶
func (n *ScreenPick) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*ScreenPick) RemoveClass ¶
func (n *ScreenPick) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*ScreenPick) SetAccessibleName ¶
func (n *ScreenPick) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*ScreenPick) SetAttr ¶
func (n *ScreenPick) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*ScreenPick) SetClasses ¶
func (n *ScreenPick) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*ScreenPick) SetCursorName ¶
func (n *ScreenPick) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*ScreenPick) SetDebugName ¶
func (n *ScreenPick) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*ScreenPick) SetElement ¶
func (n *ScreenPick) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*ScreenPick) SetEnabled ¶
func (n *ScreenPick) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*ScreenPick) SetFocusOnClick ¶
func (n *ScreenPick) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*ScreenPick) SetHAlign ¶
func (n *ScreenPick) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*ScreenPick) SetHExpand ¶
func (n *ScreenPick) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*ScreenPick) SetID ¶
func (n *ScreenPick) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*ScreenPick) SetInlineStyle ¶
func (n *ScreenPick) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*ScreenPick) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*ScreenPick) SetLayoutMotion ¶
func (n *ScreenPick) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*ScreenPick) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*ScreenPick) SetMaximumSize ¶
func (n *ScreenPick) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*ScreenPick) SetOnClickWithin ¶
func (n *ScreenPick) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*ScreenPick) SetOnFocusChanged ¶
func (n *ScreenPick) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*ScreenPick) SetOnHoverWithin ¶
func (n *ScreenPick) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*ScreenPick) SetOnPointer ¶
func (n *ScreenPick) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*ScreenPick) SetOnScroll ¶
func (n *ScreenPick) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*ScreenPick) SetSharedElement ¶
func (n *ScreenPick) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*ScreenPick) SetSizeRequest ¶
func (n *ScreenPick) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*ScreenPick) SetState ¶
func (n *ScreenPick) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*ScreenPick) SetTooltip ¶
func (n *ScreenPick) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*ScreenPick) SetTooltipMarkup ¶
func (n *ScreenPick) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*ScreenPick) SetVAlign ¶
func (n *ScreenPick) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*ScreenPick) SetVExpand ¶
func (n *ScreenPick) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*ScreenPick) SetVisible ¶
func (n *ScreenPick) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*ScreenPick) SharedElement ¶
func (n *ScreenPick) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*ScreenPick) SizeRequest ¶
func (n *ScreenPick) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*ScreenPick) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*ScreenPick) TooltipText ¶
func (n *ScreenPick) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type Scroll ¶
type Scroll struct {
// ShowBars enables the auto-hiding scrollbar indicators.
ShowBars bool
// OnScrolled fires when a wheel, bar drag, or keyboard scroll lands
// at a NEW offset (same-offset scrolls stay silent). Nil means
// nobody listens.
OnScrolled func(x, y int)
// FillX and FillY stretch a smaller child across the viewport
// instead of centering it.
FillX, FillY bool
// VerticalOnly scrolls up and down only (GTK's hscrollbar-policy
// never): the child is measured and laid out at the viewport's
// width, so a wrapping label wraps there instead of at infinity.
VerticalOnly bool
// PropagateNaturalWidth (GTK's propagate-natural-width) makes a
// VerticalOnly scroll ask for its child's natural width; without
// it the scroll asks for the child's minimum, as GTK's does.
PropagateNaturalWidth bool
// PropagateNaturalHeight (GTK's propagate-natural-height): the
// scroll asks for its content's height, capped by
// SetMaxContentHeight, giving nothing up to a short parent. Without
// it, as GTK's, the scroll asks for no height of its own: it takes
// what its parent gives it (an expanding slot, FillY) and scrolls
// the rest.
PropagateNaturalHeight bool
// contains filtered or unexported fields
}
Scroll embeds a child larger than the viewport and shifts it by an offset. With ShowBars, overflowing axes reserve a scrollbar gutter; the bars fade in on hover or scrolling and out after a dwell, drag 1:1, and gutter clicks page. A child smaller than the viewport is centered, or stretched along an axis when the matching Fill flag is set.
func (*Scroll) AccessibleName ¶
func (n *Scroll) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Scroll) AddClass ¶
func (n *Scroll) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Scroll) Arrange ¶
Arrange pins the viewport to r, reserving a gutter for each overflowing axis that shows a bar, and places the child at the negative offset: stretched across the viewport when Fill is set and the child is smaller, centered when it is smaller without fill, otherwise at its natural size shifted by the offset.
func (*Scroll) ArrangeRoot ¶
ArrangeRoot records the viewport rect.
func (*Scroll) AttachStylesheet ¶
func (n *Scroll) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Scroll) AxisRange ¶
func (s *Scroll) AxisRange(axis Axis) ScrollRange
AxisRange implements Adjustable: the offset, the visible extent, and the content's extent along axis.
func (*Scroll) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Scroll) Children ¶
Children exposes the wrapped child for focus traversal; an empty scroll (SetChild(nil)) exposes none.
func (*Scroll) Classes ¶
func (n *Scroll) Classes() []string
Classes returns a copy of the widget's classes.
func (*Scroll) ClickAt ¶
ClickAt implements Clicker: a gutter press above or below (or left or right of) a handle pages by one viewport; the first DragMove of such a press would have grabbed the handle instead. A click on a handle without motion does nothing. Disabled scrolls ignore clicks.
func (*Scroll) DebugName ¶
func (n *Scroll) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Scroll) DetachStylesheet ¶
func (n *Scroll) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Scroll) DragMove ¶
DragMove implements DragMover. The first call inside a scrollbar track grabs that handle (recording the press position and offset); later calls map pointer motion 1:1 onto content motion through the viewport-to-track ratio. Outside the tracks this is content drugging of the wrapped child, which the child handles. Disabled scrolls ignore drags.
func (*Scroll) Element ¶
func (n *Scroll) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Scroll) Enabled ¶
func (n *Scroll) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Scroll) HasState ¶
func (n *Scroll) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Scroll) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Scroll) HitTest ¶
HitTest returns the widget under p: the shown scrollbars belong to the scroll itself (a press there drags or pages, never hits content), the child's bounds already carry the scroll offset so hit-testing through a scrolled viewport lands on the right content, and anything else inside the bounds is the scroll.
func (*Scroll) HoverWithin ¶
func (n *Scroll) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Scroll) InlineStyle ¶
func (n *Scroll) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Scroll) Invalidate ¶
func (n *Scroll) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Scroll) InvalidateLayout ¶
func (n *Scroll) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Scroll) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Scroll) LayoutMotion ¶
func (n *Scroll) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Scroll) MaxContentHeight ¶
MaxContentHeight is the cap SetMaxContentHeight set, 0 for none.
func (*Scroll) MaximumSize ¶
func (n *Scroll) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Scroll) Measure ¶
Measure reports the scroll's request inside its CSS box. Across, a scroll that pans sideways asks for its child's natural width and needs none; a VerticalOnly one needs its child's minimum and asks for it too, or for the natural width under PropagateNaturalWidth (GTK's never policy). Down, it asks for nothing of its own unless PropagateNaturalHeight, then for its child's height up to the SetMaxContentHeight cap, needing only scrollFloor: a short parent gets the rest back and the scroll scrolls it.
func (*Scroll) Paint ¶
Paint clips to the viewport, paints the shifted child, and draws the auto-hiding bars in their gutters at the current fade alpha.
func (*Scroll) Parent ¶
func (n *Scroll) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Scroll) RemoveAttr ¶
func (n *Scroll) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Scroll) RemoveClass ¶
func (n *Scroll) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Scroll) ScrollBy ¶
ScrollBy shifts the offset by dx, dy wheel steps and shows the bars. A step is GTK's wheel scroll: the visible extent raised to 2/3 (a taller page scrolls further per notch), at least one pixel. A disabled scroll does not scroll.
func (*Scroll) ScrollEnd ¶
func (s *Scroll) ScrollEnd()
ScrollEnd implements ScrollEnder: the fingers lifted, so the content glides on from the gesture's velocity, and the glow fades once the motion is over.
func (*Scroll) ScrollPixels ¶
ScrollPixels implements PixelScroller: exact deltas, the fraction kept for the next one so slow finger motion still moves. The deltas feed the kinetic glide, and pushing past an end builds the edge glow.
func (*Scroll) SetAccessibleName ¶
func (n *Scroll) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Scroll) SetAttr ¶
func (n *Scroll) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Scroll) SetAxisOffset ¶
SetAxisOffset implements Adjustable.
func (*Scroll) SetChild ¶
SetChild replaces the wrapped child. The old child detaches like any removal — parent link cleared, removal hook fired — and the scroll forgets the old content's position: offsets reset to the top-left (new content keeps no memory of the old scroll) and any bar drag ends. Re-setting the current child is a no-op. nil clears the content: an empty scroll measures empty, paints nothing, and hit tests as itself.
func (*Scroll) SetClasses ¶
func (n *Scroll) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Scroll) SetCursorName ¶
func (n *Scroll) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Scroll) SetDebugName ¶
func (n *Scroll) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Scroll) SetElement ¶
func (n *Scroll) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Scroll) SetEnabled ¶
SetEnabled turns the viewport and everything inside it on or off through the per-query enable walk, like Box. A disabled scroll ignores wheel, bar drags, and gutter clicks; its child is disabled with it.
func (*Scroll) SetFocusOnClick ¶
func (n *Scroll) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Scroll) SetHAlign ¶
func (n *Scroll) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Scroll) SetHExpand ¶
func (n *Scroll) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Scroll) SetHovered ¶
SetHovered implements HoverSetter: entering shows the bars, leaving starts the dwell before they fade. Hovering itself paints nothing; the fade tweens invalidate the gutter strips as alpha moves.
func (*Scroll) SetID ¶
func (n *Scroll) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Scroll) SetInlineStyle ¶
func (n *Scroll) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Scroll) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Scroll) SetLayoutMotion ¶
func (n *Scroll) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Scroll) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Scroll) SetMaxContentHeight ¶
SetMaxContentHeight caps the height the scroll asks for (GTK's max-content-height) and turns PropagateNaturalHeight on, the only height a cap applies to: up to h it is as tall as its content, past it h tall and scrolling. 0 is no cap; a negative h is 0.
func (*Scroll) SetMaximumSize ¶
func (n *Scroll) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Scroll) SetOffset ¶
SetOffset scrolls to x, y, clamped so the child never leaves the viewport (overshoot clamps). A child smaller than the viewport stays pinned at 0. The next Arrange moves the content and owes the damage.
func (*Scroll) SetOnClickWithin ¶
func (n *Scroll) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Scroll) SetOnFocusChanged ¶
func (n *Scroll) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Scroll) SetOnHoverWithin ¶
func (n *Scroll) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Scroll) SetOnPointer ¶
func (n *Scroll) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Scroll) SetOnScroll ¶
func (n *Scroll) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Scroll) SetPressed ¶
SetPressed implements PressSetter: ending the press ends any drag.
func (*Scroll) SetSharedElement ¶
func (n *Scroll) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Scroll) SetSizeRequest ¶
func (n *Scroll) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Scroll) SetState ¶
func (n *Scroll) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Scroll) SetTooltip ¶
func (n *Scroll) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Scroll) SetTooltipMarkup ¶
func (n *Scroll) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Scroll) SetVAlign ¶
func (n *Scroll) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Scroll) SetVExpand ¶
func (n *Scroll) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Scroll) SetVisible ¶
func (n *Scroll) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Scroll) SharedElement ¶
func (n *Scroll) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Scroll) SizeRequest ¶
func (n *Scroll) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Scroll) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Scroll) TooltipText ¶
func (n *Scroll) TooltipText() string
TooltipText returns the hover text, empty when none is set.
func (*Scroll) Visible ¶
func (n *Scroll) Visible() bool
Visible reports the widget's own visibility flag, not the effective state: a widget inside an invisible container still reads true. Layout, Paint, and HitTest paths consult widget.IsVisible, which folds the ancestors in.
func (*Scroll) WatchRange ¶
func (s *Scroll) WatchRange(fn func())
WatchRange implements Adjustable.
type ScrollEnder ¶
type ScrollEnder interface {
ScrollEnd()
}
ScrollEnder is a PixelScroller told when a finger scroll ends (the fingers lifted): Scroll glides on from the gesture's velocity.
type ScrollEvent ¶
type ScrollEvent struct {
DX, DY int
// Mods are the keyboard modifiers held.
Mods Mods
// At is where the pointer rests, in root coordinates.
At Point
}
ScrollEvent is a wheel step as a hook sees it, in ScrollBy's steps: DY positive downward, DX positive rightward.
type ScrollHandler ¶
type ScrollHandler interface {
ScrollBy(dx, dy int)
}
ScrollHandler receives scroll deltas in 40px steps: dx from the horizontal axis (tilt wheels, trackpads), dy from the vertical.
type ScrollMove ¶ added in v0.2.5
ScrollMove is a viewport whose pixels moved by DX, DY as they stand: a frame can copy them there instead of painting them, and owes only what the move exposed, which the damage holds. All in logical pixels.
func CollectFrameDamageInto ¶ added in v0.2.5
func CollectFrameDamageInto(buf []render.Rect, moves []ScrollMove, root Widget) (rects []render.Rect, outMoves []ScrollMove, any bool)
CollectFrameDamageInto is CollectDamageInto for a frame that can copy pixels: a viewport that only scrolled reports a ScrollMove, reusing moves' storage, and owes only what the move exposed.
type ScrollRange ¶
type ScrollRange struct{ Offset, Page, Total int }
ScrollRange is one axis of a scroll position (GTK Adjustment's numbers): Offset into a Total extent, of which Page is visible. The bar geometry and the drag and page arithmetic live here once, for Scroll's own bars and the standalone Scrollbar alike.
func (ScrollRange) Overflows ¶
func (r ScrollRange) Overflows() bool
Overflows reports whether there is anything to scroll.
type Scrollbar ¶
type Scrollbar struct {
// contains filtered or unexported fields
}
Scrollbar is a standalone, always-visible bar bound to an Adjustable (GTK Scrollbar): the thumb tracks the target's range, dragging it scrolls 1:1, and a track click pages. It draws nothing while the target does not overflow. Place it beside the scrolled widget; the target's own auto-hiding bars are independent of it.
func NewScrollbar ¶
func NewScrollbar(target Adjustable, axis Axis) *Scrollbar
NewScrollbar returns a bar driving target along axis (Row for a horizontal bar, Column for a vertical one).
func (*Scrollbar) AccessibleName ¶
func (n *Scrollbar) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Scrollbar) AddClass ¶
func (n *Scrollbar) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Scrollbar) Arrange ¶
Arrange records the widget's rect. A rect that moved or resized from the previous frame also invalidates the old pixels, so partial damage does not leave the widget's old paint behind.
func (*Scrollbar) AttachStylesheet ¶
func (n *Scrollbar) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Scrollbar) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Scrollbar) Classes ¶
func (n *Scrollbar) Classes() []string
Classes returns a copy of the widget's classes.
func (*Scrollbar) ClickAt ¶
ClickAt pages toward a track click; the release ending a thumb drag is not a click.
func (*Scrollbar) DebugName ¶
func (n *Scrollbar) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Scrollbar) DetachStylesheet ¶
func (n *Scrollbar) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Scrollbar) Element ¶
func (n *Scrollbar) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Scrollbar) Enabled ¶
func (n *Scrollbar) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Scrollbar) HAlign ¶
func (n *Scrollbar) HAlign() Align
HAlign returns the horizontal placement.
func (*Scrollbar) HasState ¶
func (n *Scrollbar) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Scrollbar) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Scrollbar) HoverWithin ¶
func (n *Scrollbar) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Scrollbar) ID ¶
func (n *Scrollbar) ID() string
ID returns the style id, empty when none is set.
func (*Scrollbar) InlineStyle ¶
func (n *Scrollbar) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Scrollbar) Invalidate ¶
func (n *Scrollbar) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Scrollbar) InvalidateLayout ¶
func (n *Scrollbar) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Scrollbar) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Scrollbar) LayoutMotion ¶
func (n *Scrollbar) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Scrollbar) MaximumSize ¶
func (n *Scrollbar) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Scrollbar) Measure ¶
Measure is the bar's thickness across its axis; along it the bar takes what its parent stretches it to. scrollbar-width: none collapses it, thin keeps the slot and paints slimmer.
func (*Scrollbar) Parent ¶
func (n *Scrollbar) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Scrollbar) RemoveAttr ¶
func (n *Scrollbar) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Scrollbar) RemoveClass ¶
func (n *Scrollbar) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Scrollbar) SetAccessibleName ¶
func (n *Scrollbar) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Scrollbar) SetAttr ¶
func (n *Scrollbar) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Scrollbar) SetClasses ¶
func (n *Scrollbar) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Scrollbar) SetCursorName ¶
func (n *Scrollbar) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Scrollbar) SetDebugName ¶
func (n *Scrollbar) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Scrollbar) SetElement ¶
func (n *Scrollbar) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Scrollbar) SetEnabled ¶
func (n *Scrollbar) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Scrollbar) SetFocusOnClick ¶
func (n *Scrollbar) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Scrollbar) SetHAlign ¶
func (n *Scrollbar) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Scrollbar) SetHExpand ¶
func (n *Scrollbar) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Scrollbar) SetID ¶
func (n *Scrollbar) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Scrollbar) SetInlineStyle ¶
func (n *Scrollbar) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Scrollbar) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Scrollbar) SetLayoutMotion ¶
func (n *Scrollbar) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Scrollbar) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Scrollbar) SetMaximumSize ¶
func (n *Scrollbar) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Scrollbar) SetOnClickWithin ¶
func (n *Scrollbar) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Scrollbar) SetOnFocusChanged ¶
func (n *Scrollbar) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Scrollbar) SetOnHoverWithin ¶
func (n *Scrollbar) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Scrollbar) SetOnPointer ¶
func (n *Scrollbar) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Scrollbar) SetOnScroll ¶
func (n *Scrollbar) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Scrollbar) SetSharedElement ¶
func (n *Scrollbar) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Scrollbar) SetSizeRequest ¶
func (n *Scrollbar) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Scrollbar) SetState ¶
func (n *Scrollbar) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Scrollbar) SetTooltip ¶
func (n *Scrollbar) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Scrollbar) SetTooltipMarkup ¶
func (n *Scrollbar) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Scrollbar) SetVAlign ¶
func (n *Scrollbar) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Scrollbar) SetVExpand ¶
func (n *Scrollbar) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Scrollbar) SetVisible ¶
func (n *Scrollbar) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Scrollbar) SharedElement ¶
func (n *Scrollbar) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Scrollbar) SizeRequest ¶
func (n *Scrollbar) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Scrollbar) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Scrollbar) TooltipText ¶
func (n *Scrollbar) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type SearchBar ¶
type SearchBar struct {
// contains filtered or unexported fields
}
SearchBar is the slide-down search container: a SearchEntry (the accessor returns it wired for focus) inside a Revealer that slides in from the top, keyed by SetSearchMode - the state an accel or the app's shortcut handling flips. The key capture itself stays the app's (accel groups, OnKey); the bar owns only the reveal.
func NewSearchBar ¶
NewSearchBar returns a hidden bar with an empty search field; call Entry().SetPlaceholder on it for hint text.
func (*SearchBar) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*SearchBar) Children ¶
func (c *SearchBar) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*SearchBar) Entry ¶
func (b *SearchBar) Entry() *SearchEntry
Entry returns the bar's search field.
func (*SearchBar) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*SearchBar) SearchMode ¶
SearchMode reports whether the bar is showing.
func (*SearchBar) SetSearchMode ¶
SetSearchMode reveals or hides the bar; revealing keeps whatever text the field held.
type SearchEntry ¶
type SearchEntry struct {
*Entry
// OnSearchChanged fires with the settled text - the delayed signal
// a search wants, so a fast typist triggers one search, not one
// per keystroke.
OnSearchChanged func(text string)
// contains filtered or unexported fields
}
SearchEntry is the search preset over Entry: a leading search icon, a clear button while text exists, Esc clearing (an empty field passes Esc on), and OnSearchChanged - the delayed search-changed signal, fired once typing settles for the delay (SetDelay tunes it, zero fires synchronously). The entry's whole public surface rides along through the embedded field; wire the app's search to OnSearchChanged, not OnChanged.
func NewSearchEntry ¶
func NewSearchEntry(face render.Font, sizePx float64, placeholder string) *SearchEntry
NewSearchEntry returns a search field with an optional placeholder.
func (SearchEntry) AccessibleName ¶
func (n SearchEntry) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (SearchEntry) AddClass ¶
func (n SearchEntry) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (SearchEntry) AttachStylesheet ¶
func (n SearchEntry) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (SearchEntry) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (SearchEntry) Classes ¶
func (n SearchEntry) Classes() []string
Classes returns a copy of the widget's classes.
func (SearchEntry) DebugName ¶
func (n SearchEntry) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (SearchEntry) DetachStylesheet ¶
func (n SearchEntry) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (SearchEntry) Element ¶
func (n SearchEntry) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (SearchEntry) Enabled ¶
func (n SearchEntry) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (SearchEntry) HAlign ¶
func (n SearchEntry) HAlign() Align
HAlign returns the horizontal placement.
func (SearchEntry) HasState ¶
func (n SearchEntry) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (SearchEntry) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (SearchEntry) HoverWithin ¶
func (n SearchEntry) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (SearchEntry) ID ¶
func (n SearchEntry) ID() string
ID returns the style id, empty when none is set.
func (SearchEntry) InlineStyle ¶
func (n SearchEntry) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (SearchEntry) Invalidate ¶
func (n SearchEntry) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (SearchEntry) InvalidateLayout ¶
func (n SearchEntry) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (SearchEntry) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (SearchEntry) LayoutMotion ¶
func (n SearchEntry) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (SearchEntry) MaximumSize ¶
func (n SearchEntry) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (SearchEntry) Parent ¶
func (n SearchEntry) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (SearchEntry) RemoveAttr ¶
func (n SearchEntry) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (SearchEntry) RemoveClass ¶
func (n SearchEntry) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (SearchEntry) SetAccessibleName ¶
func (n SearchEntry) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (SearchEntry) SetAttr ¶
func (n SearchEntry) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (SearchEntry) SetClasses ¶
func (n SearchEntry) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (SearchEntry) SetCursorName ¶
func (n SearchEntry) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (SearchEntry) SetDebugName ¶
func (n SearchEntry) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*SearchEntry) SetDelay ¶
func (s *SearchEntry) SetDelay(d time.Duration)
SetDelay tunes the search-changed settle time; zero fires synchronously with every change.
func (SearchEntry) SetElement ¶
func (n SearchEntry) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (SearchEntry) SetEnabled ¶
func (n SearchEntry) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (SearchEntry) SetFocusOnClick ¶
func (n SearchEntry) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (SearchEntry) SetHAlign ¶
func (n SearchEntry) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (SearchEntry) SetHExpand ¶
func (n SearchEntry) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (SearchEntry) SetID ¶
func (n SearchEntry) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (SearchEntry) SetInlineStyle ¶
func (n SearchEntry) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (SearchEntry) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (SearchEntry) SetLayoutMotion ¶
func (n SearchEntry) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (SearchEntry) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (SearchEntry) SetMaximumSize ¶
func (n SearchEntry) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (SearchEntry) SetOnClickWithin ¶
func (n SearchEntry) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (SearchEntry) SetOnFocusChanged ¶
func (n SearchEntry) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (SearchEntry) SetOnHoverWithin ¶
func (n SearchEntry) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (SearchEntry) SetOnPointer ¶
func (n SearchEntry) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (SearchEntry) SetOnScroll ¶
func (n SearchEntry) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (SearchEntry) SetSharedElement ¶
func (n SearchEntry) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (SearchEntry) SetSizeRequest ¶
func (n SearchEntry) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (SearchEntry) SetState ¶
func (n SearchEntry) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (SearchEntry) SetTooltip ¶
func (n SearchEntry) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (SearchEntry) SetTooltipMarkup ¶
func (n SearchEntry) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (SearchEntry) SetVAlign ¶
func (n SearchEntry) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (SearchEntry) SetVExpand ¶
func (n SearchEntry) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (SearchEntry) SetVisible ¶
func (n SearchEntry) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (SearchEntry) SharedElement ¶
func (n SearchEntry) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (SearchEntry) SizeRequest ¶
func (n SearchEntry) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (SearchEntry) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (SearchEntry) TooltipText ¶
func (n SearchEntry) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type SegmentDrop ¶ added in v0.2.3
type SegmentDrop struct {
// contains filtered or unexported fields
}
SegmentDrop is a SegmentIndicator's one travelling indicator, painted behind the segments as the indicator element under segments. It rests on the active segment's box. On a switch its leading edges spring ahead and its trailing edges follow, so it stretches towards the target, travels there and settles as one shape, along whichever axis the segments stack. It shows nothing while no segment is active, and it appears and goes at once, without travelling. Under reduced motion or a theme without animations it lands on the target at once.
func (*SegmentDrop) Moving ¶ added in v0.2.3
func (d *SegmentDrop) Moving() bool
Moving reports whether the indicator is in flight. A settled or hidden indicator is not, and schedules no frame.
type SegmentIndicator ¶
type SegmentIndicator struct {
// OnSelect hears a clicked segment's index.
OnSelect func(i int)
// contains filtered or unexported fields
}
SegmentIndicator is a row of segments, one per workspace or page: the active one drawn long and filled, occupied and urgent ones in their theme colours. A segment can hold content (SetSegmentContent), centred in it, and Segment reaches its button. A click on a segment reports it through OnSelect. In a vertical bar the segments stack. It styles as the segments element, each segment a button.segment with the active, occupied and urgent classes. EnableDrop adds one indicator that travels between the segments behind them.
func NewSegmentIndicator ¶
func NewSegmentIndicator(n int) *SegmentIndicator
NewSegmentIndicator returns n empty segments, none active.
func (*SegmentIndicator) Active ¶
func (s *SegmentIndicator) Active() int
Active is the active segment, -1 for none.
func (*SegmentIndicator) Arrange ¶
func (s *SegmentIndicator) Arrange(r render.Rect)
Arrange lays the segments out, then settles an enabled drop on what their boxes now are.
func (*SegmentIndicator) Baseline ¶
Baseline implements Baseliner: the root's, laid over the whole rect.
func (*SegmentIndicator) Children ¶
func (c *SegmentIndicator) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*SegmentIndicator) Count ¶
func (s *SegmentIndicator) Count() int
Count is the number of segments.
func (*SegmentIndicator) EnableDrop ¶ added in v0.2.3
func (s *SegmentIndicator) EnableDrop() *SegmentDrop
EnableDrop gives the row its one travelling indicator and returns it, for its classes and inline style. The stylesheet draws it: the indicator element takes any box the segments would, and without a rule it paints nothing. A row that never calls this keeps no animation state.
func (*SegmentIndicator) Measure ¶
func (s *SegmentIndicator) Measure(axis Axis, forSize int) Sizes
Measure stacks the segments in a vertical bar, then measures them.
func (*SegmentIndicator) Paint ¶
func (s *SegmentIndicator) Paint(cv *render.Canvas)
Paint draws the row's box, an enabled drop on it, and the segments over the drop.
func (*SegmentIndicator) Segment ¶
func (s *SegmentIndicator) Segment(i int) *Button
Segment is segment i's button, nil out of range: for its classes, inline style, tooltip, and its SetOnPointer and SetOnScroll for the other buttons and the wheel.
func (*SegmentIndicator) SetActive ¶
func (s *SegmentIndicator) SetActive(i int)
SetActive makes segment i the active one; out of range, none is. An enabled drop travels there from where it is.
func (*SegmentIndicator) SetCount ¶
func (s *SegmentIndicator) SetCount(n int)
SetCount keeps n segments, the states of those kept.
func (*SegmentIndicator) SetSegmentContent ¶
func (s *SegmentIndicator) SetSegmentContent(i int, w Widget)
SetSegmentContent shows w inside segment i (a label, app icons), nil for none; out of range does nothing.
func (*SegmentIndicator) SetSegmentState ¶
func (s *SegmentIndicator) SetSegmentState(i int, st SegmentState)
SetSegmentState marks segment i empty or occupied; out of range does nothing.
func (*SegmentIndicator) SetSegmentUrgent ¶
func (s *SegmentIndicator) SetSegmentUrgent(i int, urgent bool)
SetSegmentUrgent marks segment i as asking for attention or not, whatever its state; out of range does nothing.
func (*SegmentIndicator) ShiftActive ¶ added in v0.2.3
func (s *SegmentIndicator) ShiftActive(i int)
ShiftActive is SetActive for the same item at a new index, after segments before it came or went: it starts no travel for an enabled drop, which stays on the item, and it leaves one already under way or still owed to the next frame alone.
type SegmentState ¶
type SegmentState uint8
SegmentState marks a segment of a SegmentIndicator.
const ( SegmentEmpty SegmentState = iota // SegmentOccupied is a segment with something in it, a workspace // with windows. SegmentOccupied )
The segment states.
type SelectAller ¶
type SelectAller interface {
SelectAll()
}
SelectAller clears or sets a full selection on the focused widget.
type SelectedTexter ¶
type SelectedTexter interface {
// SelectedText returns the selected text and whether a non-empty
// selection exists.
SelectedText() (string, bool)
}
SelectedTexter exposes the widget's active selection.
type SelectionMode ¶
type SelectionMode uint8
SelectionMode is how pointer and keyboard gestures turn into a selected row set on a List.
const ( // SelectionSingle keeps zero or one selected row: a click or a // plain motion key selects exactly that row, Enter activates it. // The zero value, so a List is single-select unless told otherwise. SelectionSingle SelectionMode = iota // SelectionNone ignores every selection gesture and Select call; // rows keep only their own widget behavior. Keyboard selection // keys do nothing. SelectionNone // SelectionBrowse is single-select that never sits empty once it // has selected: pointer motion over a row selects it (focus // follows the pointer, GTK's browse mode) and gestures cannot // clear the selection, only move it. SelectionBrowse // SelectionMultiple keeps any set of rows. Clicks toggle rows, // drags rubber-band select, shift+arrows extend from the anchor, // ctrl+arrows move the keyboard cursor without selecting, // ctrl+space toggles the cursor row, ctrl+a selects everything. SelectionMultiple )
type Separator ¶
type Separator struct {
// contains filtered or unexported fields
}
Separator is the standalone one-pixel theme rule: horizontal between stacked rows, vertical between side-by-side panes. Menus paint the same rule inline for their ItemSeparator rows; layouts reach for this widget. The natural size is one pixel square along both axes — boxes stretch the cross axis, and expand stretches the main axis — and the rule paints through whatever it was allocated.
func NewSeparator ¶
func NewSeparator(orientation Orientation) *Separator
NewSeparator returns a separator along orientation.
func (*Separator) AccessibleName ¶
func (n *Separator) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Separator) AddClass ¶
func (n *Separator) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Separator) Arrange ¶
Arrange records the widget's rect. A rect that moved or resized from the previous frame also invalidates the old pixels, so partial damage does not leave the widget's old paint behind.
func (*Separator) AttachStylesheet ¶
func (n *Separator) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Separator) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Separator) Classes ¶
func (n *Separator) Classes() []string
Classes returns a copy of the widget's classes.
func (*Separator) DebugName ¶
func (n *Separator) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Separator) DetachStylesheet ¶
func (n *Separator) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Separator) Element ¶
func (n *Separator) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Separator) Enabled ¶
func (n *Separator) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Separator) HAlign ¶
func (n *Separator) HAlign() Align
HAlign returns the horizontal placement.
func (*Separator) HasState ¶
func (n *Separator) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Separator) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Separator) HoverWithin ¶
func (n *Separator) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Separator) ID ¶
func (n *Separator) ID() string
ID returns the style id, empty when none is set.
func (*Separator) InlineStyle ¶
func (n *Separator) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Separator) Invalidate ¶
func (n *Separator) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Separator) InvalidateLayout ¶
func (n *Separator) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Separator) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Separator) LayoutMotion ¶
func (n *Separator) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Separator) MaximumSize ¶
func (n *Separator) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Separator) Orientation ¶
func (s *Separator) Orientation() Orientation
Orientation returns the axis the rule runs along.
func (*Separator) Paint ¶
Paint draws the rule centered in the allocated rect, in the theme border color menus use for their inline separators.
func (*Separator) Parent ¶
func (n *Separator) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Separator) RemoveAttr ¶
func (n *Separator) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Separator) RemoveClass ¶
func (n *Separator) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Separator) SetAccessibleName ¶
func (n *Separator) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Separator) SetAttr ¶
func (n *Separator) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Separator) SetClasses ¶
func (n *Separator) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Separator) SetCursorName ¶
func (n *Separator) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Separator) SetDebugName ¶
func (n *Separator) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Separator) SetElement ¶
func (n *Separator) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Separator) SetEnabled ¶
func (n *Separator) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Separator) SetFocusOnClick ¶
func (n *Separator) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Separator) SetHAlign ¶
func (n *Separator) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Separator) SetHExpand ¶
func (n *Separator) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Separator) SetID ¶
func (n *Separator) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Separator) SetInlineStyle ¶
func (n *Separator) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Separator) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Separator) SetLayoutMotion ¶
func (n *Separator) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Separator) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Separator) SetMaximumSize ¶
func (n *Separator) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Separator) SetOnClickWithin ¶
func (n *Separator) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Separator) SetOnFocusChanged ¶
func (n *Separator) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Separator) SetOnHoverWithin ¶
func (n *Separator) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Separator) SetOnPointer ¶
func (n *Separator) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Separator) SetOnScroll ¶
func (n *Separator) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Separator) SetSharedElement ¶
func (n *Separator) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Separator) SetSizeRequest ¶
func (n *Separator) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Separator) SetState ¶
func (n *Separator) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Separator) SetTooltip ¶
func (n *Separator) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Separator) SetTooltipMarkup ¶
func (n *Separator) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Separator) SetVAlign ¶
func (n *Separator) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Separator) SetVExpand ¶
func (n *Separator) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Separator) SetVisible ¶
func (n *Separator) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Separator) SharedElement ¶
func (n *Separator) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Separator) SizeRequest ¶
func (n *Separator) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Separator) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Separator) TooltipText ¶
func (n *Separator) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type Sheet ¶
type Sheet struct {
// OnClosed fires when a close finished sliding out, whatever
// caused it.
OnClosed func()
// contains filtered or unexported fields
}
Sheet is a panel over content (and adw's BottomSheet as NewBottomSheet): SetOpen slides the panel in from its side over a dimmed backdrop. A click on the backdrop and Escape close it, and while it is open Tab stays inside the panel. A bottom sheet carries a grab handle: dragging it down past a third of the sheet dismisses it, a shorter drag springs back. Side and top sheets take an optional header (SetHeader), footer (SetFooter) and a close button. It styles as the `sheet` element; the panel as `.sheet-panel`, its header's .title and .description.
func NewBottomSheet ¶
NewBottomSheet returns a closed sheet sliding sheet up from the bottom over content, with the grab handle (adw BottomSheet).
func (*Sheet) Arrange ¶
Arrange lays the content over the whole rect and the panel where the slide and the drag put it: each animation frame relayouts the sheet.
func (*Sheet) Children ¶
Children is the content and, while showing, the panel: focus traversal, damage and the accessibility tree reach the panel's widgets.
func (*Sheet) HitTest ¶
HitTest resolves into the panel while the sheet shows (the backdrop and a bottom sheet's handle are the sheet itself), else into the content.
func (*Sheet) InterceptKey ¶
InterceptKey implements KeyInterceptor: Escape anywhere in the open sheet closes it.
func (*Sheet) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*Sheet) Paint ¶
Paint draws the content, then - while showing - the dimmed backdrop, the panel's surface (a bottom sheet's with its handle) and the panel.
func (*Sheet) PressEnd ¶
func (s *Sheet) PressEnd()
PressEnd dismisses past a third of the sheet's height, else springs back.
func (*Sheet) SetHeader ¶
SetHeader puts a title and a description above the body, with a close button at the panel's corner.
type ShortcutItem ¶
ShortcutItem is one shortcut: what it does, and its keys in the accelerator label form ("Ctrl+Shift+P", a chord "Ctrl+X Ctrl+S").
type ShortcutSection ¶
type ShortcutSection struct {
Title string
Items []ShortcutItem
}
ShortcutSection is one titled group of a shortcuts overview.
type ShortcutsView ¶
type ShortcutsView struct {
*PreferencesPage
}
ShortcutsView is the shortcuts overview (GTK ShortcutsWindow, adw ShortcutsDialog's content): a scrolling page of boxed groups, one per section, each shortcut a row with its title and keycaps. Fill it from the application's accelerator registry (app.Application.ShortcutsDialog does) or from any data.
func NewShortcutsView ¶
func NewShortcutsView(face render.Font, sections []ShortcutSection) *ShortcutsView
NewShortcutsView builds the overview of sections.
func (ShortcutsView) Baseline ¶
Baseline implements Baseliner: the root's, laid over the whole rect.
func (ShortcutsView) Children ¶
func (c ShortcutsView) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
type Sidebar ¶
type Sidebar struct {
// OnWidthChanged fires with the expanded width after a drag
// resized it, for the app to keep.
OnWidthChanged func(width int)
// contains filtered or unexported fields
}
Sidebar is an application sidebar beside content: a header, groups of items with icons, badges and submenus, and a footer. On a wide window it docks beside the content and Toggle collapses it - off canvas or to an icon rail - with a slide; below its narrow width it hides and Toggle opens it as a sheet over the content. Picking an item makes it the active one. Bind ToggleAction to Ctrl+B with an accelerator; the Trigger button toggles it too. It styles as the `sidebar` element: the .panel, .group-label labels, button.item rows (:checked while active), .badge labels and .sub submenus.
func NewSidebar ¶
NewSidebar returns an expanded sidebar beside content, collapsing off canvas.
func (*Sidebar) AddCollapsibleGroup ¶
func (s *Sidebar) AddCollapsibleGroup(label string, open bool, items ...SidebarItem)
AddCollapsibleGroup appends a group whose label folds its items (a collapsible group): clicking the label, or its chevron, shows and hides them, open to start with when open.
func (*Sidebar) AddGroup ¶
func (s *Sidebar) AddGroup(label string, items ...SidebarItem)
AddGroup appends a group of items under label ("" for none).
func (*Sidebar) Arrange ¶
Arrange evaluates the narrow breakpoint against the width, then lays the sidebar out.
func (*Sidebar) Children ¶
func (c *Sidebar) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Sidebar) CursorName ¶
CursorName is the resize cursor over the handle.
func (*Sidebar) HitTest ¶
HitTest takes the resize handle itself, and otherwise the panel and content as laid out.
func (*Sidebar) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*Sidebar) PressEnd ¶
func (s *Sidebar) PressEnd()
PressEnd ends a resize, reporting the new width.
func (*Sidebar) SetActive ¶
SetActive makes the item called id (its ID, else its Label) the active one, as a click would without running it, and shows it: its submenu and its collapsed group open. It reports whether an item has that id.
func (*Sidebar) SetCollapse ¶
func (s *Sidebar) SetCollapse(c SidebarCollapse)
SetCollapse picks how a wide sidebar collapses.
func (*Sidebar) SetExpanded ¶
SetExpanded expands or collapses the docked sidebar with a slide; a SidebarNone sidebar stays expanded.
func (*Sidebar) SetNarrowWidth ¶
SetNarrowWidth moves the breakpoint below which the sidebar is off canvas (768px by default): the sidebar measures its own width, so one inside a narrower region of a wide window wants a lower one.
func (*Sidebar) SetResizable ¶
SetResizable lets the user drag the docked panel's edge to resize it between min and max pixels (OnWidthChanged reports the result); a zero max turns it off.
func (*Sidebar) Toggle ¶
func (s *Sidebar) Toggle()
Toggle collapses or expands the docked sidebar, or below the narrow width opens or closes it over the content.
func (*Sidebar) ToggleAction ¶
func (s *Sidebar) ToggleAction() Activatable
ToggleAction is Toggle as an action, for an accelerator (Ctrl+B, say).
type SidebarCollapse ¶
type SidebarCollapse uint8
SidebarCollapse is how a Sidebar collapses on a wide window.
const ( // SidebarOffcanvas slides the sidebar away entirely. SidebarOffcanvas SidebarCollapse = iota // SidebarIcon narrows it to a rail of the items' icons. SidebarIcon // SidebarNone keeps it expanded. SidebarNone )
The collapse modes.
type SidebarItem ¶
type SidebarItem struct {
Label string
// ID names the item for SetActive; empty uses its Label.
ID string
// Icon leads the row and is what the icon rail shows; nil shows
// none.
Icon Widget
// Badge is a count or a note at the row's end; "" shows none.
Badge string
// Active marks the item as the current page.
Active bool
// OnActivate runs when the item is picked.
OnActivate func()
// Items are a submenu, shown under the item as it is toggled open.
Items []SidebarItem
}
SidebarItem is one entry of a Sidebar group.
type Size ¶
type Size struct {
W, H int
}
Size is a width and height in pixels.
func LayoutShownSize ¶
LayoutShownSize is the size w is shown at and whether it animates its layout: mid-motion the size its spring paints it at, else its laid-out size. A surface sized from its content (a popover shrinking) keeps its size until that is the content's new size, so the content springs down inside it before the surface follows.
func SizeWithin ¶
SizeWithin is the size w takes in a host that offers at most avail: its natural width capped to avail.W, then its natural height for that width capped to avail.H, neither below its minimum. A window sizes its root with it, a popover its content. The result exceeds avail where the widget's minimum does: w overflows rather than squeezing below what it needs.
func SizeWithinAsChild ¶
SizeWithinAsChild is SizeWithin for w measured as a child: a host sizing a tree's top by MeasureAsChild.
type SizeGroup ¶
type SizeGroup struct {
// contains filtered or unexported fields
}
SizeGroup makes widgets in different containers measure alike (GTK SizeGroup): every member requests the largest natural size of the group along the mode's axes - labels in separate rows line up. Add returns the wrapper to place in the tree in the member's stead; a member's size change relayouts every peer.
func NewSizeGroup ¶
func NewSizeGroup(mode SizeGroupMode) *SizeGroup
NewSizeGroup returns an empty group equalizing mode's axes.
type SizeGroupMode ¶
type SizeGroupMode uint8
SizeGroupMode picks the axes a SizeGroup equalizes.
const ( // SizeGroupHorizontal equalizes widths. SizeGroupHorizontal SizeGroupMode = 1 << iota // SizeGroupVertical equalizes heights. SizeGroupVertical // SizeGroupBoth equalizes both. SizeGroupBoth = SizeGroupHorizontal | SizeGroupVertical )
type Sizes ¶
type Sizes struct {
Min, Nat int
}
Sizes is a widget's size request along one axis, GTK's minimum and natural size: Min is the least it lays out at without clipping or overflowing what it shows, Nat the size it wants. 0 <= Min <= Nat.
func FixedSizes ¶
FixedSizes is a request that wants exactly n: a widget of one size along an axis.
func MeasureAsChild ¶
MeasureAsChild measures w as a container measures its child: its size request, programmatic margin and CSS sizes apply. A host that owns a tree's top (a popover around its content) measures through it so the top's own size request counts, as GTK honors a popover's.
type Slider ¶
type Slider struct {
// Pressed reports whether a drag is in progress.
Pressed bool
// OnChanged fires after every value change, including programmatic
// ones.
OnChanged func(v float64)
// contains filtered or unexported fields
}
Slider is a slider over [min, max] with an optional step, horizontal by default; SetAxis(Column) stands it up (GTK's orientation), the minimum at the top unless inverted (GTK's inverted, the volume-style minimum at the bottom). Pressing warps the value to the pointer and a drag follows it.
It is GtkScale's node tree: `scale` (its box, opacity, outline, and :hover while the pointer is over it) holding `trough` (background, radius, min-height, and min-width as the natural width) holding `highlight` (the filled part) and `slider` (the knob: background, radius, min size, opacity, box-shadow). Unstyled it keeps the theme's 4px trough and 14px knob. The scale carries .horizontal or .vertical; across a vertical scale the trough's min-width is its thickness and min-height its length.
func NewSlider ¶
NewSlider returns a horizontal slider over [min, max] at value, with changes snapped to step (0 disables snapping). The pointer turns to the hand over it, the way wayle's slider primitives ask.
func (*Slider) AccessibleName ¶
func (n *Slider) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Slider) AddClass ¶
func (n *Slider) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Slider) Arrange ¶
Arrange records the widget's rect. A rect that moved or resized from the previous frame also invalidates the old pixels, so partial damage does not leave the widget's old paint behind.
func (*Slider) AttachStylesheet ¶
func (n *Slider) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Slider) BindValue ¶
BindValue wires the binding two-way to the slider's value. SetValue clamps and snaps, and fires OnChanged only when the shown value moved, so a binding value off-grid settles on the snapped one without looping.
func (*Slider) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Slider) Classes ¶
func (n *Slider) Classes() []string
Classes returns a copy of the widget's classes.
func (*Slider) DebugName ¶
func (n *Slider) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Slider) DetachStylesheet ¶
func (n *Slider) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Slider) DragMove ¶
DragMove sets the value from the pointer position while pressed. Disabled sliders ignore the drag.
func (*Slider) Element ¶
func (n *Slider) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Slider) Enabled ¶
func (n *Slider) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Slider) HasState ¶
func (n *Slider) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Slider) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Slider) HoverWithin ¶
func (n *Slider) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Slider) InlineStyle ¶
func (n *Slider) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Slider) Invalidate ¶
func (n *Slider) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Slider) InvalidateLayout ¶
func (n *Slider) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Slider) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Slider) KeyAction ¶
KeyAction implements KeyActionHandler: arrows nudge the value by one step (or a tenth of the range without one), Home and End jump. Disabled sliders ignore keys.
func (*Slider) LayoutMotion ¶
func (n *Slider) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Slider) MaximumSize ¶
func (n *Slider) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Slider) Measure ¶
Measure wants the trough's length (200px unstyled) by the thicker of the trough and the knob, at least 18px, inside the scale's box.
func (*Slider) Paint ¶
Paint draws the trough, its highlight, and the knob, each from its node's style over the theme's colors. Disabled, the theme colors fade through the derived disabled colors (a stylesheet fades with its own :disabled rules).
func (*Slider) Parent ¶
func (n *Slider) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Slider) PressAt ¶
PressAt implements PressAter: the value warps to the press, and a drag carries on from there (GTK's primary-button warp). Disabled sliders ignore it.
func (*Slider) RemoveAttr ¶
func (n *Slider) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Slider) RemoveClass ¶
func (n *Slider) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Slider) SetAccessibleName ¶
func (n *Slider) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Slider) SetAttr ¶
func (n *Slider) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Slider) SetClasses ¶
func (n *Slider) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Slider) SetCursorName ¶
func (n *Slider) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Slider) SetDebugName ¶
func (n *Slider) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Slider) SetElement ¶
func (n *Slider) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Slider) SetEnabled ¶
func (n *Slider) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Slider) SetFocusOnClick ¶
func (n *Slider) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Slider) SetHAlign ¶
func (n *Slider) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Slider) SetHExpand ¶
func (n *Slider) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Slider) SetHovered ¶
SetHovered implements HoverSetter: `scale:hover` restyles the trough and knob (a knob shown only on hover).
func (*Slider) SetID ¶
func (n *Slider) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Slider) SetInlineStyle ¶
func (n *Slider) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Slider) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Slider) SetInverted ¶
SetInverted puts the minimum at the far end: the right of a horizontal slider, the bottom of a vertical one.
func (*Slider) SetLayoutMotion ¶
func (n *Slider) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Slider) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Slider) SetMaximumSize ¶
func (n *Slider) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Slider) SetOnClickWithin ¶
func (n *Slider) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Slider) SetOnFocusChanged ¶
func (n *Slider) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Slider) SetOnHoverWithin ¶
func (n *Slider) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Slider) SetOnPointer ¶
func (n *Slider) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Slider) SetOnScroll ¶
func (n *Slider) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Slider) SetPressed ¶
SetPressed implements PressSetter; the trough brightens while dragging.
func (*Slider) SetSharedElement ¶
func (n *Slider) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Slider) SetSizeRequest ¶
func (n *Slider) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Slider) SetState ¶
func (n *Slider) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Slider) SetTooltip ¶
func (n *Slider) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Slider) SetTooltipMarkup ¶
func (n *Slider) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Slider) SetVAlign ¶
func (n *Slider) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Slider) SetVExpand ¶
func (n *Slider) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Slider) SetValue ¶
SetValue clamps v to [min, max], snaps it to step, and fires OnChanged when it moved.
func (*Slider) SetVisible ¶
func (n *Slider) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Slider) SharedElement ¶
func (n *Slider) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Slider) SizeRequest ¶
func (n *Slider) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Slider) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Slider) TooltipText ¶
func (n *Slider) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type Spacer ¶
type Spacer struct {
// contains filtered or unexported fields
}
Spacer is empty layout space of a fixed size.
func (*Spacer) AccessibleName ¶
func (n *Spacer) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Spacer) AddClass ¶
func (n *Spacer) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Spacer) Arrange ¶
Arrange records the widget's rect. A rect that moved or resized from the previous frame also invalidates the old pixels, so partial damage does not leave the widget's old paint behind.
func (*Spacer) AttachStylesheet ¶
func (n *Spacer) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Spacer) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Spacer) Classes ¶
func (n *Spacer) Classes() []string
Classes returns a copy of the widget's classes.
func (*Spacer) DebugName ¶
func (n *Spacer) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Spacer) DetachStylesheet ¶
func (n *Spacer) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Spacer) Element ¶
func (n *Spacer) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Spacer) Enabled ¶
func (n *Spacer) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Spacer) HasState ¶
func (n *Spacer) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Spacer) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Spacer) HoverWithin ¶
func (n *Spacer) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Spacer) InlineStyle ¶
func (n *Spacer) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Spacer) Invalidate ¶
func (n *Spacer) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Spacer) InvalidateLayout ¶
func (n *Spacer) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Spacer) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Spacer) LayoutMotion ¶
func (n *Spacer) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Spacer) MaximumSize ¶
func (n *Spacer) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Spacer) Parent ¶
func (n *Spacer) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Spacer) RemoveAttr ¶
func (n *Spacer) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Spacer) RemoveClass ¶
func (n *Spacer) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Spacer) SetAccessibleName ¶
func (n *Spacer) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Spacer) SetAttr ¶
func (n *Spacer) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Spacer) SetClasses ¶
func (n *Spacer) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Spacer) SetCursorName ¶
func (n *Spacer) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Spacer) SetDebugName ¶
func (n *Spacer) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Spacer) SetElement ¶
func (n *Spacer) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Spacer) SetEnabled ¶
func (n *Spacer) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Spacer) SetFocusOnClick ¶
func (n *Spacer) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Spacer) SetHAlign ¶
func (n *Spacer) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Spacer) SetHExpand ¶
func (n *Spacer) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Spacer) SetID ¶
func (n *Spacer) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Spacer) SetInlineStyle ¶
func (n *Spacer) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Spacer) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Spacer) SetLayoutMotion ¶
func (n *Spacer) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Spacer) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Spacer) SetMaximumSize ¶
func (n *Spacer) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Spacer) SetOnClickWithin ¶
func (n *Spacer) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Spacer) SetOnFocusChanged ¶
func (n *Spacer) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Spacer) SetOnHoverWithin ¶
func (n *Spacer) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Spacer) SetOnPointer ¶
func (n *Spacer) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Spacer) SetOnScroll ¶
func (n *Spacer) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Spacer) SetSharedElement ¶
func (n *Spacer) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Spacer) SetSizeRequest ¶
func (n *Spacer) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Spacer) SetState ¶
func (n *Spacer) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Spacer) SetTooltip ¶
func (n *Spacer) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Spacer) SetTooltipMarkup ¶
func (n *Spacer) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Spacer) SetVAlign ¶
func (n *Spacer) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Spacer) SetVExpand ¶
func (n *Spacer) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Spacer) SetVisible ¶
func (n *Spacer) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Spacer) SharedElement ¶
func (n *Spacer) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Spacer) SizeRequest ¶
func (n *Spacer) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Spacer) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Spacer) TooltipText ¶
func (n *Spacer) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type SpinButton ¶
type SpinButton struct {
*Entry
// OnValueChanged fires when the user changed the value: a step
// or a commit that moved it. SetValue does not fire it, so a
// caller mirroring an external value never echoes it back.
OnValueChanged func(v float64)
// contains filtered or unexported fields
}
SpinButton is a numeric entry, GtkSpinButton: the text shows the value at Digits decimals; the drawn up/down steppers at its end and the Up and Down keys step it by Step, PageUp and PageDown by ten steps; Enter, or focus leaving the entry, commits the typed text. A commit clamps into [Min, Max] and rounds to Digits; text that does not parse as a number reverts to the value.
The value changes only through those paths and SetValue; the text between commits is the entry's own.
func NewSpinButton ¶
func NewSpinButton(face render.Font, sizePx float64, color render.Color, min, max, step float64, digits int) *SpinButton
NewSpinButton returns a spin button over [min, max] stepping by step (a step ≤ 0 is 1), showing digits decimals, starting at min.
func (SpinButton) AccessibleName ¶
func (n SpinButton) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (SpinButton) AddClass ¶
func (n SpinButton) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (SpinButton) AttachStylesheet ¶
func (n SpinButton) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*SpinButton) BindValue ¶
func (s *SpinButton) BindValue(b *Binding[float64]) (unbind func())
BindValue wires the binding two-way to the spin button's value. SetValue is silent - only user edits fire OnValueChanged - so the programmatic apply never echoes.
func (SpinButton) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (SpinButton) Classes ¶
func (n SpinButton) Classes() []string
Classes returns a copy of the widget's classes.
func (SpinButton) DebugName ¶
func (n SpinButton) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (SpinButton) DetachStylesheet ¶
func (n SpinButton) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (SpinButton) Element ¶
func (n SpinButton) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (SpinButton) Enabled ¶
func (n SpinButton) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (SpinButton) HAlign ¶
func (n SpinButton) HAlign() Align
HAlign returns the horizontal placement.
func (SpinButton) HasState ¶
func (n SpinButton) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (SpinButton) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (SpinButton) HoverWithin ¶
func (n SpinButton) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (SpinButton) ID ¶
func (n SpinButton) ID() string
ID returns the style id, empty when none is set.
func (SpinButton) InlineStyle ¶
func (n SpinButton) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (SpinButton) Invalidate ¶
func (n SpinButton) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (SpinButton) InvalidateLayout ¶
func (n SpinButton) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (SpinButton) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*SpinButton) KeyAction ¶
func (s *SpinButton) KeyAction(a KeyAction, mods Mods)
KeyAction steps on Up/Down and PageUp/PageDown; every other key edits the text.
func (SpinButton) LayoutMotion ¶
func (n SpinButton) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (SpinButton) MaximumSize ¶
func (n SpinButton) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (SpinButton) Parent ¶
func (n SpinButton) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*SpinButton) Range ¶
func (s *SpinButton) Range() (min, max float64)
Range reports the bounds.
func (SpinButton) RemoveAttr ¶
func (n SpinButton) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (SpinButton) RemoveClass ¶
func (n SpinButton) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (SpinButton) SetAccessibleName ¶
func (n SpinButton) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (SpinButton) SetAttr ¶
func (n SpinButton) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (SpinButton) SetClasses ¶
func (n SpinButton) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (SpinButton) SetCursorName ¶
func (n SpinButton) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (SpinButton) SetDebugName ¶
func (n SpinButton) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*SpinButton) SetDigits ¶
func (s *SpinButton) SetDigits(digits int)
SetDigits changes the shown decimals, re-rounding the value (silently, like SetValue).
func (SpinButton) SetElement ¶
func (n SpinButton) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (SpinButton) SetEnabled ¶
func (n SpinButton) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (SpinButton) SetFocusOnClick ¶
func (n SpinButton) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (SpinButton) SetHAlign ¶
func (n SpinButton) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (SpinButton) SetHExpand ¶
func (n SpinButton) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (SpinButton) SetID ¶
func (n SpinButton) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (SpinButton) SetInlineStyle ¶
func (n SpinButton) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (SpinButton) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (SpinButton) SetLayoutMotion ¶
func (n SpinButton) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (SpinButton) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (SpinButton) SetMaximumSize ¶
func (n SpinButton) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (SpinButton) SetOnClickWithin ¶
func (n SpinButton) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (SpinButton) SetOnFocusChanged ¶
func (n SpinButton) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (SpinButton) SetOnHoverWithin ¶
func (n SpinButton) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (SpinButton) SetOnPointer ¶
func (n SpinButton) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (SpinButton) SetOnScroll ¶
func (n SpinButton) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*SpinButton) SetRange ¶
func (s *SpinButton) SetRange(min, max float64)
SetRange changes the bounds, re-clamping the value (silently, like SetValue).
func (SpinButton) SetSharedElement ¶
func (n SpinButton) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (SpinButton) SetSizeRequest ¶
func (n SpinButton) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (SpinButton) SetState ¶
func (n SpinButton) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*SpinButton) SetStep ¶
func (s *SpinButton) SetStep(step float64)
SetStep changes how far a key steps (a step ≤ 0 is 1).
func (SpinButton) SetTooltip ¶
func (n SpinButton) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (SpinButton) SetTooltipMarkup ¶
func (n SpinButton) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (SpinButton) SetVAlign ¶
func (n SpinButton) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (SpinButton) SetVExpand ¶
func (n SpinButton) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*SpinButton) SetValue ¶
func (s *SpinButton) SetValue(v float64)
SetValue sets the value (clamped, rounded) and shows it, discarding uncommitted text; it does not fire OnValueChanged.
func (SpinButton) SetVisible ¶
func (n SpinButton) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (SpinButton) SharedElement ¶
func (n SpinButton) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (SpinButton) SizeRequest ¶
func (n SpinButton) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (SpinButton) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (SpinButton) TooltipText ¶
func (n SpinButton) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type SpinRow ¶
type SpinRow struct {
*ActionRow
// contains filtered or unexported fields
}
SpinRow is an ActionRow with a SpinButton in its end slot.
func NewSpinRow ¶
func NewSpinRow(face render.Font, sizePx float64, title, subtitle string, min, max, step float64, digits int, on func(v float64)) *SpinRow
NewSpinRow returns the row over [min, max] stepping by step with digits decimals; on, when set, receives user-committed changes.
func (SpinRow) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (SpinRow) Children ¶
func (c SpinRow) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (SpinRow) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (SpinRow) PackStart ¶
func (p SpinRow) PackStart(w Widget)
PackStart adds w to the leading slot.
func (*SpinRow) SetValue ¶
SetValue sets it silently - mirroring an external value never echoes back as a user change.
func (*SpinRow) SpinButton ¶
func (r *SpinRow) SpinButton() *SpinButton
SpinButton returns the embedded control.
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner is an indeterminate activity indicator (lucide's Loader2): a rotating open ring in the text color, the `spinner` element's color. The rotation is animation-clock driven — one frame invalidation per step, and no timer at all unless the spinner is both spinning and visible. A hidden or stopped spinner schedules no wake, so an idle app with a parked spinner costs nothing.
func NewSpinner ¶
NewSpinner returns a spinner sized size×size pixels.
func (*Spinner) AccessibleName ¶
func (n *Spinner) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Spinner) AddClass ¶
func (n *Spinner) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Spinner) AttachStylesheet ¶
func (n *Spinner) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Spinner) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Spinner) Classes ¶
func (n *Spinner) Classes() []string
Classes returns a copy of the widget's classes.
func (*Spinner) DebugName ¶
func (n *Spinner) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Spinner) DetachStylesheet ¶
func (n *Spinner) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Spinner) Element ¶
func (n *Spinner) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Spinner) Enabled ¶
func (n *Spinner) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Spinner) HasState ¶
func (n *Spinner) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Spinner) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Spinner) HoverWithin ¶
func (n *Spinner) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Spinner) InlineStyle ¶
func (n *Spinner) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Spinner) Invalidate ¶
func (n *Spinner) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Spinner) InvalidateLayout ¶
func (n *Spinner) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Spinner) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Spinner) LayoutMotion ¶
func (n *Spinner) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Spinner) MaximumSize ¶
func (n *Spinner) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Spinner) Parent ¶
func (n *Spinner) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Spinner) RemoveAttr ¶
func (n *Spinner) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Spinner) RemoveClass ¶
func (n *Spinner) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Spinner) SetAccessibleName ¶
func (n *Spinner) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Spinner) SetAttr ¶
func (n *Spinner) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Spinner) SetClasses ¶
func (n *Spinner) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Spinner) SetCursorName ¶
func (n *Spinner) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Spinner) SetDebugName ¶
func (n *Spinner) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Spinner) SetElement ¶
func (n *Spinner) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Spinner) SetEnabled ¶
func (n *Spinner) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Spinner) SetFocusOnClick ¶
func (n *Spinner) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Spinner) SetHAlign ¶
func (n *Spinner) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Spinner) SetHExpand ¶
func (n *Spinner) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Spinner) SetID ¶
func (n *Spinner) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Spinner) SetInlineStyle ¶
func (n *Spinner) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Spinner) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Spinner) SetLayoutMotion ¶
func (n *Spinner) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Spinner) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Spinner) SetMaximumSize ¶
func (n *Spinner) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Spinner) SetOnClickWithin ¶
func (n *Spinner) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Spinner) SetOnFocusChanged ¶
func (n *Spinner) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Spinner) SetOnHoverWithin ¶
func (n *Spinner) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Spinner) SetOnPointer ¶
func (n *Spinner) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Spinner) SetOnScroll ¶
func (n *Spinner) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Spinner) SetSharedElement ¶
func (n *Spinner) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Spinner) SetSizeRequest ¶
func (n *Spinner) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Spinner) SetSpinning ¶
SetSpinning turns the rotation on or off. Stopping cancels the tween at once — the frozen angle stays where it stopped and no wake remains scheduled. Starting takes effect once the spinner is on screen; until then nothing is scheduled.
func (*Spinner) SetState ¶
func (n *Spinner) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Spinner) SetTooltip ¶
func (n *Spinner) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Spinner) SetTooltipMarkup ¶
func (n *Spinner) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Spinner) SetVAlign ¶
func (n *Spinner) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Spinner) SetVExpand ¶
func (n *Spinner) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Spinner) SetVisible ¶
func (n *Spinner) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Spinner) SharedElement ¶
func (n *Spinner) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Spinner) SizeRequest ¶
func (n *Spinner) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Spinner) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Spinner) TooltipText ¶
func (n *Spinner) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type SplitButton ¶
type SplitButton struct {
// OnClick fires for the main half; OnMenu for the arrow, with the
// arrow as the popover anchor.
OnClick func()
OnMenu func(anchor Boundser)
// contains filtered or unexported fields
}
SplitButton is a button with a menu side (adw SplitButton): the main half fires OnClick, the arrow half reports its anchor through OnMenu - the app opens the menu popover there (app.AttachSplitButton), the same reporting shape a MenuBar's roots use.
func NewSplitButton ¶
func NewSplitButton(content Widget, sizePx float64) *SplitButton
NewSplitButton returns the pair over content (a label or ButtonContent).
func (*SplitButton) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*SplitButton) Arrow ¶
func (s *SplitButton) Arrow() Boundser
Arrow returns the menu half, the popover anchor.
func (*SplitButton) Children ¶
func (c *SplitButton) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
Stack holds named children and shows exactly one at a time, switching through its transition (none by default).
func (*Stack) AccessibleName ¶
func (n *Stack) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Stack) Add ¶
Add puts a child under name; adding an existing name replaces it. The replaced widget detaches like Stack.Remove — parent link cleared, removal hook fired — instead of staying parented to a stack it no longer belongs to.
func (*Stack) AddClass ¶
func (n *Stack) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Stack) ArrangeRoot ¶
ArrangeRoot records the stack's own rect.
func (*Stack) AttachStylesheet ¶
func (n *Stack) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Stack) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Stack) Classes ¶
func (n *Stack) Classes() []string
Classes returns a copy of the widget's classes.
func (*Stack) DebugName ¶
func (n *Stack) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Stack) DetachStylesheet ¶
func (n *Stack) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Stack) Element ¶
func (n *Stack) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Stack) Enabled ¶
func (n *Stack) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Stack) HasState ¶
func (n *Stack) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Stack) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Stack) Homogeneous ¶
Homogeneous reports whether the stack is as large as its largest page (SetHomogeneous).
func (*Stack) HoverWithin ¶
func (n *Stack) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Stack) InlineStyle ¶
func (n *Stack) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Stack) Insert ¶
Insert puts a child under name at position i of the page order (clamped), with Add's replacement rule for an existing name.
func (*Stack) InterpolateSize ¶
InterpolateSize reports whether a switch tweens the stack's size (SetInterpolateSize).
func (*Stack) Invalidate ¶
func (n *Stack) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Stack) InvalidateLayout ¶
func (n *Stack) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Stack) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Stack) LayoutMotion ¶
func (n *Stack) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Stack) MaximumSize ¶
func (n *Stack) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Stack) Measure ¶
Measure reports the widest request of its children - or, sized to its visible page, that page's, tweened from the page leaving while an interpolating switch runs - inside the stack's CSS box (GtkStack's padding, border and min sizes).
func (*Stack) Move ¶
Move moves the page under name to position i of the page order (clamped); the page stays attached. An unknown name is a no-op.
func (*Stack) Page ¶
Page is the child added under name, visible or not (GtkStack's get_child_by_name); nil for an unknown name.
func (*Stack) Paint ¶
Paint draws the stack's own CSS layers, then the visible child, or both pages mid-switch.
func (*Stack) Parent ¶
func (n *Stack) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Stack) Remove ¶
Remove deletes the child under name and reports whether there was one. Removing the visible child leaves the stack showing nothing — Visible reads "" until the next Show or Add names a child; removal never silently promotes a sibling (pinned). The removed widget's parent link clears and the removal hook fires, so routers drop it; an unknown name is a no-op.
func (*Stack) RemoveAttr ¶
func (n *Stack) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Stack) RemoveClass ¶
func (n *Stack) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Stack) SetAccessibleName ¶
func (n *Stack) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Stack) SetAttr ¶
func (n *Stack) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Stack) SetClasses ¶
func (n *Stack) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Stack) SetCursorName ¶
func (n *Stack) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Stack) SetDebugName ¶
func (n *Stack) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Stack) SetElement ¶
func (n *Stack) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Stack) SetEnabled ¶
SetEnabled turns the visible child on or off through the per-query enable walk, like Box (hidden children stay untouched; they paint nothing, so they need no repaint either).
func (*Stack) SetFocusOnClick ¶
func (n *Stack) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Stack) SetHAlign ¶
func (n *Stack) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Stack) SetHExpand ¶
func (n *Stack) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Stack) SetHomogeneous ¶
SetHomogeneous picks whether the stack is as large as its largest page (true, the default) or as its visible one (GTK's hhomogeneous and vhomogeneous off), so pages of different sizes resize what holds the stack.
func (*Stack) SetID ¶
func (n *Stack) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Stack) SetInlineStyle ¶
func (n *Stack) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Stack) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Stack) SetInterpolateSize ¶
SetInterpolateSize makes a stack sized to its visible page tween between the two pages' sizes through a switch, on the switch's own easing (GTK's interpolate-size); off, the size jumps.
func (*Stack) SetLayoutMotion ¶
func (n *Stack) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Stack) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Stack) SetMaximumSize ¶
func (n *Stack) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Stack) SetOnClickWithin ¶
func (n *Stack) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Stack) SetOnFocusChanged ¶
func (n *Stack) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Stack) SetOnHoverWithin ¶
func (n *Stack) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Stack) SetOnPointer ¶
func (n *Stack) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Stack) SetOnScroll ¶
func (n *Stack) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Stack) SetSharedElement ¶
func (n *Stack) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Stack) SetSizeRequest ¶
func (n *Stack) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Stack) SetState ¶
func (n *Stack) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Stack) SetTooltip ¶
func (n *Stack) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Stack) SetTooltipMarkup ¶
func (n *Stack) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Stack) SetTransition ¶
func (s *Stack) SetTransition(t StackTransition, d time.Duration)
SetTransition picks how later Show calls switch pages and how long a switch takes (GTK's stack transition type and duration); a zero duration switches at once.
func (*Stack) SetVAlign ¶
func (n *Stack) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Stack) SetVExpand ¶
func (n *Stack) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Stack) SetVisible ¶
func (n *Stack) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Stack) SharedElement ¶
func (n *Stack) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Stack) Show ¶
Show makes the child under name the visible one through the stack's transition; unknown names are ignored. A switch during a running one starts from the page then showing.
func (*Stack) SizeRequest ¶
func (n *Stack) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Stack) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Stack) TooltipText ¶
func (n *Stack) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type StackSwitcher ¶
type StackSwitcher struct {
*ViewSwitcher
}
StackSwitcher is GTK's classic stack switcher: a text-only ViewSwitcher, the variant for windows that title pages in words.
func NewStackSwitcher ¶
func NewStackSwitcher(face render.Font, sizePx float64, stack *Stack, titles map[string]string) *StackSwitcher
NewStackSwitcher returns a tab strip driving stack.
func (StackSwitcher) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (StackSwitcher) Baseline ¶
Baseline implements Baseliner: the root's, laid over the whole rect.
func (StackSwitcher) Children ¶
func (c StackSwitcher) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
type StackSwitcherPolicy ¶
type StackSwitcherPolicy uint8
StackSwitcherPolicy decides what switcher toggles show.
const ( // SwitcherAll shows icon and title where both exist. SwitcherAll StackSwitcherPolicy = iota // SwitcherText titles only (no icons), the narrow variant. SwitcherText // SwitcherIcons icons only, the bottom-bar variant. SwitcherIcons )
Switcher policies.
type StackTransition ¶
type StackTransition uint8
StackTransition is how a Stack moves between pages.
const ( // StackNone switches at once. StackNone StackTransition = iota // StackCrossfade cross-fades the old page into the new one. StackCrossfade // StackSlideLeftRight slides the pages sideways: a page added // later comes in from the right, an earlier one from the left. StackSlideLeftRight )
type StateAction ¶
type StateAction[S comparable] struct { // contains filtered or unexported fields }
StateAction is a named action holding a state, relm4's stateful RelmAction: activating one of its targets sets the state, and every proxy shows the state it holds. A bool state is a toggle (Toggle); any comparable state can drive a radio group (Target).
func NewStateAction ¶
func NewStateAction[S comparable](name string, initial S, onChange func(S)) *StateAction[S]
NewStateAction returns an enabled action at initial; onChange, when not nil, hears every change of state.
func (*StateAction) Enabled ¶
func (c *StateAction) Enabled() bool
Enabled reports whether the action may be activated.
func (*StateAction) SetEnabled ¶
func (c *StateAction) SetEnabled(on bool)
SetEnabled enables or disables the action and every proxy bound to it.
func (*StateAction[S]) SetState ¶
func (a *StateAction[S]) SetState(s S)
SetState changes the state, notifying onChange and every proxy; an equal state does nothing. It applies even while the action is disabled, since disabling gates the user, not the program.
func (*StateAction) Subscribe ¶
func (c *StateAction) Subscribe(fn func()) (cancel func())
Subscribe registers fn for every enabled or state change; the returned cancel removes it.
func (*StateAction[S]) Target ¶
func (a *StateAction[S]) Target(v S) Checkable
Target is the Checkable that sets the state to v: one radio item of the group the action's states form.
type StateFlags ¶
type StateFlags uint8
StateFlags are the widget states a stylesheet matches that no router drives: an application sets them to reflect its own model.
const ( // StateChecked matches :checked — a toggled-on control, or a menu // button whose popup is open. StateChecked StateFlags = 1 << iota // StateSelected matches :selected. StateSelected // StateIndeterminate matches :indeterminate. StateIndeterminate // StateBackdrop matches :backdrop — the widget's window is inactive. StateBackdrop // StateTarget matches :target — the widget an in-app navigation // points at, the role a URL fragment's element plays on the web. StateTarget )
The application-driven states.
type StatusPage ¶
type StatusPage struct {
// contains filtered or unexported fields
}
StatusPage is the empty/error state page (adw StatusPage): an icon on a muted tile, a title, a wrapped description, and an optional content area (a call-to-action button), centered in whatever space it gets. It styles as the `statuspage` element with .icon, .title and .description parts.
func NewStatusPage ¶
func NewStatusPage(face render.Font, iconName, title, description string) *StatusPage
NewStatusPage returns the page; empty icon or description drops it.
func (*StatusPage) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*StatusPage) Children ¶
func (c *StatusPage) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*StatusPage) Measure ¶
func (p *StatusPage) Measure(axis Axis, forSize int) Sizes
Measure is the page's content request, wanting the column's full width: a page fills the space it gets up to statusPageWidth, its content centered in it, aligned or not.
func (*StatusPage) SetChild ¶
func (p *StatusPage) SetChild(w Widget)
SetChild adds w (a call-to-action button, typically) to the content area under the description; successive children stack.
func (*StatusPage) SetIcon ¶
func (p *StatusPage) SetIcon(w Widget)
SetIcon shows w (an icon, typically 24px) centered on the muted tile above the title; nil drops the tile.
type Stylesheet ¶
type Stylesheet struct {
// contains filtered or unexported fields
}
Stylesheet is one parsed stylesheet at a priority, reloadable in place. Installed with AddStylesheet it applies to every widget; created with NewStylesheet and attached to widgets (AttachStylesheet) it applies to those subtrees only — one surface's styling that must not reach another's. The zero value is not usable.
func AddStylesheet ¶
func AddStylesheet(css string, priority int) *Stylesheet
AddStylesheet parses css and installs it at priority, above or below the other stylesheets by priority and, at equal priority, after every earlier one. The next frame repaints with it; call it from the event-loop goroutine, like SetTheme. Malformed rules are skipped with a warning on the library logger — the valid remainder still applies.
func AddStylesheetFile ¶
func AddStylesheetFile(path string, priority int) (*Stylesheet, error)
AddStylesheetFile loads a stylesheet from path and installs it at priority as its own Stylesheet, with hot reload on it: a change to the file reloads it off the loop, and Remove stops that. A file that cannot be read or whose parse reports a problem fails with an error naming the path, instead of half-loading.
func NewStylesheet ¶
func NewStylesheet(css string, priority int) *Stylesheet
NewStylesheet parses css into a stylesheet at priority without installing it: attach it to the widgets whose subtrees it styles.
func NewStylesheetFile ¶
func NewStylesheetFile(path string, priority int) (*Stylesheet, error)
NewStylesheetFile reads the stylesheet at path into a scoped sheet at priority, like NewStylesheet: attach it to the widgets whose subtrees it styles. Its @import rules resolve relative to path, and the hot reload AddStylesheetFile starts reloads it on change until Remove. A file that cannot be read or whose parse reports a problem fails with an error naming the path.
func (*Stylesheet) Load ¶
func (s *Stylesheet) Load(css string)
Load replaces the stylesheet's rules with css, keeping its priority and position, and stops its hot reload: the sheet is string-backed from here on. Loading into an installed stylesheet that was removed (and is attached nowhere) reinstalls it; a NewStylesheet sheet stays scoped, styling only the subtrees it is attached to. It parses on the calling goroutine; LoadParsed takes a sheet ParseStylesheet parsed elsewhere.
func (*Stylesheet) LoadParsed ¶ added in v0.2.5
func (s *Stylesheet) LoadParsed(p *ParsedStylesheet)
LoadParsed is Load with the parse already done: installing p costs no parse, and restyles exactly what Load of the same text would.
func (*Stylesheet) Priority ¶
func (s *Stylesheet) Priority() int
Priority returns the priority the stylesheet was installed at.
func (*Stylesheet) Remove ¶
func (s *Stylesheet) Remove()
Remove uninstalls the stylesheet and stops its hot reload (a scoped NewStylesheetFile sheet keeps styling where it is attached, but no longer reloads); removing twice is a no-op.
type StylesheetWatcher ¶ added in v0.2.5
StylesheetWatcher reports changes in dirs: changed runs on the event-loop goroutine after anything in them changed, until stop.
type Stylus ¶
type Stylus struct {
Tool StylusTool
At Point
Pressure, Distance float64
TiltX, TiltY float64
Rotation float64
Down bool
Button uint32
Pressed bool
}
Stylus is one tablet tool sample: where the tool is, its axes, and whether its tip is down. Pressure and Distance are 0..1; tilt and rotation are degrees. Button reports a stylus button that changed with this sample (0: none) and Pressed its state.
type StylusHandler ¶
type StylusHandler interface {
Stylus(s Stylus)
}
StylusHandler takes tablet samples - a canvas drawing with pressure, a slider dragging finer with a light touch. The tool also drives the pointer (hover, press, drag), so widgets that ignore pressure just work under a pen.
type StylusTool ¶
type StylusTool uint8
StylusTool is a tablet tool's kind.
const ( StylusPen StylusTool = iota StylusEraser StylusBrush StylusPencil StylusAirbrush StylusFinger StylusMouse StylusLens )
Stylus tools.
type SurfaceHost ¶
type SurfaceHost interface {
// OpenMenu opens items as a popup menu beside anchor, whose bounds
// are in the tree's coordinates, painted with face at sizePx.
OpenMenu(anchor Boundser, face render.Font, sizePx float64, items []MenuItem, opts MenuOptions)
// OpenPopover opens content in a popover beside anchor, and returns
// what closes it.
OpenPopover(anchor Boundser, content Widget, opts PopoverOptions) (close func())
// Focus moves the surface's keyboard focus to w, failing as
// Router.SetFocus does.
Focus(w Widget) error
}
SurfaceHost is what a widget tree's surface does for its widgets: the application attaches one to every surface's root (SetSurfaceHost), and the widgets reach it through OpenMenu, OpenPopover and GrabFocus. The host owns the surface plumbing and reports its own failures.
type SwatchPicker ¶
type SwatchPicker struct {
// OnPicked runs when a swatch is clicked.
OnPicked func(c render.Color)
// OnEdited runs on every change in the expanded chooser.
OnEdited func(c render.Color)
// contains filtered or unexported fields
}
SwatchPicker picks a color from a grid of preset swatches, one click each, the current one ringed; an optional custom row lists the user's own colors under the presets, and a Custom entry opens the full ColorChooser in place. OnPicked hears a swatch pick, OnEdited every change the chooser makes.
func NewSwatchPicker ¶
func NewSwatchPicker(face render.Font, sizePx float64, presets []render.Color, current render.Color) *SwatchPicker
NewSwatchPicker returns a picker over presets with current ringed.
func (*SwatchPicker) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*SwatchPicker) Baseline ¶
Baseline implements Baseliner: the root's, laid over the whole rect.
func (*SwatchPicker) Children ¶
func (c *SwatchPicker) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*SwatchPicker) Color ¶
func (p *SwatchPicker) Color() render.Color
Color returns the current color.
func (*SwatchPicker) Expanded ¶
func (p *SwatchPicker) Expanded() bool
Expanded reports whether the full chooser is open.
func (*SwatchPicker) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*SwatchPicker) SetColor ¶
func (p *SwatchPicker) SetColor(c render.Color)
SetColor makes c current, ringing its swatch.
func (*SwatchPicker) SetCustom ¶
func (p *SwatchPicker) SetCustom(colors []render.Color)
SetCustom shows colors as a row under the presets; none hides it.
type SwipeDismiss ¶
type SwipeDismiss struct {
// OnDismiss fires once, as the child leaves: dir is -1 out to the
// left, 1 to the right.
OnDismiss func(dir int)
// contains filtered or unexported fields
}
SwipeDismiss lets its child be swiped away sideways, as a notification is: a press that travels sideways past a small slop takes the gesture from whatever it landed on (a button under it does not click), and the child follows the pointer, fading as it goes. A release past 40% of the width, or a fling, sends it out on a spring and fires OnDismiss once; any shorter swipe springs it back. A release inside the slop is an ordinary click for the child. A sideways two-finger touchpad scroll drags it the same way, its end settling it.
func NewSwipeDismiss ¶
func NewSwipeDismiss(child Widget) *SwipeDismiss
NewSwipeDismiss wraps child.
func (*SwipeDismiss) AccessibleName ¶
func (n *SwipeDismiss) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*SwipeDismiss) AddClass ¶
func (n *SwipeDismiss) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*SwipeDismiss) Arrange ¶
func (s *SwipeDismiss) Arrange(r render.Rect)
Arrange places the child at r, shifted by the swipe.
func (*SwipeDismiss) AttachStylesheet ¶
func (n *SwipeDismiss) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*SwipeDismiss) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*SwipeDismiss) ClaimPixels ¶
func (s *SwipeDismiss) ClaimPixels(dx, dy float64) bool
ClaimPixels implements PixelClaimer: a sideways finger scroll drags the child as the pointer does.
func (*SwipeDismiss) Classes ¶
func (n *SwipeDismiss) Classes() []string
Classes returns a copy of the widget's classes.
func (*SwipeDismiss) DebugName ¶
func (n *SwipeDismiss) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*SwipeDismiss) DetachStylesheet ¶
func (n *SwipeDismiss) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*SwipeDismiss) DragMove ¶
func (s *SwipeDismiss) DragMove(p Point)
DragMove implements DragMover: the child follows the pointer.
func (*SwipeDismiss) Element ¶
func (n *SwipeDismiss) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*SwipeDismiss) Enabled ¶
func (n *SwipeDismiss) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*SwipeDismiss) HAlign ¶
func (n *SwipeDismiss) HAlign() Align
HAlign returns the horizontal placement.
func (*SwipeDismiss) HasState ¶
func (n *SwipeDismiss) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*SwipeDismiss) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*SwipeDismiss) HitTest ¶
func (s *SwipeDismiss) HitTest(p Point) Widget
HitTest is the child, else the wrapper within its bounds.
func (*SwipeDismiss) HoverWithin ¶
func (n *SwipeDismiss) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*SwipeDismiss) ID ¶
func (n *SwipeDismiss) ID() string
ID returns the style id, empty when none is set.
func (*SwipeDismiss) InlineStyle ¶
func (n *SwipeDismiss) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*SwipeDismiss) InterceptDrag ¶
func (s *SwipeDismiss) InterceptDrag(from, at Point) bool
InterceptDrag implements DragInterceptor: a press that travelled past the slop, more sideways than up or down, becomes a swipe.
func (*SwipeDismiss) Invalidate ¶
func (n *SwipeDismiss) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*SwipeDismiss) InvalidateLayout ¶
func (n *SwipeDismiss) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*SwipeDismiss) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*SwipeDismiss) LayoutMotion ¶
func (n *SwipeDismiss) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*SwipeDismiss) MaximumSize ¶
func (n *SwipeDismiss) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*SwipeDismiss) Measure ¶
func (s *SwipeDismiss) Measure(axis Axis, forSize int) Sizes
Measure is the child's size.
func (*SwipeDismiss) Offset ¶
func (s *SwipeDismiss) Offset() float64
Offset is how far, in logical pixels, the child sits off its place.
func (*SwipeDismiss) Paint ¶
func (s *SwipeDismiss) Paint(cv *render.Canvas)
Paint draws the child, fading with its offset.
func (*SwipeDismiss) Parent ¶
func (n *SwipeDismiss) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*SwipeDismiss) PressEnd ¶
func (s *SwipeDismiss) PressEnd()
PressEnd implements PressEnder: the release settles the swipe.
func (*SwipeDismiss) RemoveAttr ¶
func (n *SwipeDismiss) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*SwipeDismiss) RemoveClass ¶
func (n *SwipeDismiss) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*SwipeDismiss) ScrollEnd ¶
func (s *SwipeDismiss) ScrollEnd()
ScrollEnd implements ScrollEnder: lifting the fingers settles it.
func (*SwipeDismiss) SetAccessibleName ¶
func (n *SwipeDismiss) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*SwipeDismiss) SetAttr ¶
func (n *SwipeDismiss) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*SwipeDismiss) SetClasses ¶
func (n *SwipeDismiss) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*SwipeDismiss) SetCursorName ¶
func (n *SwipeDismiss) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*SwipeDismiss) SetDebugName ¶
func (n *SwipeDismiss) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*SwipeDismiss) SetElement ¶
func (n *SwipeDismiss) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*SwipeDismiss) SetEnabled ¶
func (n *SwipeDismiss) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*SwipeDismiss) SetFocusOnClick ¶
func (n *SwipeDismiss) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*SwipeDismiss) SetHAlign ¶
func (n *SwipeDismiss) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*SwipeDismiss) SetHExpand ¶
func (n *SwipeDismiss) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*SwipeDismiss) SetID ¶
func (n *SwipeDismiss) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*SwipeDismiss) SetInlineStyle ¶
func (n *SwipeDismiss) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*SwipeDismiss) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*SwipeDismiss) SetLayoutMotion ¶
func (n *SwipeDismiss) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*SwipeDismiss) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*SwipeDismiss) SetMaximumSize ¶
func (n *SwipeDismiss) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*SwipeDismiss) SetOnClickWithin ¶
func (n *SwipeDismiss) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*SwipeDismiss) SetOnFocusChanged ¶
func (n *SwipeDismiss) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*SwipeDismiss) SetOnHoverWithin ¶
func (n *SwipeDismiss) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*SwipeDismiss) SetOnPointer ¶
func (n *SwipeDismiss) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*SwipeDismiss) SetOnScroll ¶
func (n *SwipeDismiss) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*SwipeDismiss) SetSharedElement ¶
func (n *SwipeDismiss) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*SwipeDismiss) SetSizeRequest ¶
func (n *SwipeDismiss) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*SwipeDismiss) SetState ¶
func (n *SwipeDismiss) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*SwipeDismiss) SetTooltip ¶
func (n *SwipeDismiss) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*SwipeDismiss) SetTooltipMarkup ¶
func (n *SwipeDismiss) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*SwipeDismiss) SetVAlign ¶
func (n *SwipeDismiss) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*SwipeDismiss) SetVExpand ¶
func (n *SwipeDismiss) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*SwipeDismiss) SetVisible ¶
func (n *SwipeDismiss) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*SwipeDismiss) SharedElement ¶
func (n *SwipeDismiss) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*SwipeDismiss) SizeRequest ¶
func (n *SwipeDismiss) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*SwipeDismiss) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*SwipeDismiss) TooltipText ¶
func (n *SwipeDismiss) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type Switch ¶
type Switch struct {
// OnChanged fires after every state change, including programmatic
// ones.
OnChanged func(on bool)
// contains filtered or unexported fields
}
Switch is a boolean toggle painted as a pill with a sliding knob. A stylesheet restyles it the GTK way: `switch` is the track (background, border-radius, min-width/min-height, the box layers; `:checked` while on) and `switch slider` the knob (min size, margin, background, radius, shadow). Unstyled, it is the theme's 40x22 pill. A flip slides the knob and blends the colors over the theme's medium motion.
func NewSwitch ¶
NewSwitch returns a switch in the given state. The pointer turns to the hand over it, the way wayle's switch primitive asks.
func (*Switch) AccessibleName ¶
func (n *Switch) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Switch) AddClass ¶
func (n *Switch) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Switch) Arrange ¶
Arrange keeps the border box inside the margins, at the track's natural size: a taller or wider slot (a row's cross stretch) centers the pill across and keeps it at the start, the way a checkbox keeps its indicator, instead of stretching the knob with it. The knob takes its place here, not in Paint, so a first paint leaves nothing for the next frame to repaint.
func (*Switch) AttachStylesheet ¶
func (n *Switch) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Switch) BindAction ¶
BindAction makes the switch a proxy of c, like ToggleButton.BindAction.
func (*Switch) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Switch) Classes ¶
func (n *Switch) Classes() []string
Classes returns a copy of the widget's classes.
func (*Switch) ClickAt ¶
ClickAt toggles the switch; the Router invokes it on press+release. Disabled switches ignore clicks.
func (*Switch) DebugName ¶
func (n *Switch) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Switch) DetachStylesheet ¶
func (n *Switch) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Switch) Element ¶
func (n *Switch) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Switch) Enabled ¶
func (n *Switch) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Switch) HasState ¶
func (n *Switch) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Switch) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Switch) HoverWithin ¶
func (n *Switch) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Switch) InlineStyle ¶
func (n *Switch) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Switch) InsertRune ¶
InsertRune implements RuneHandler: Space toggles, the other half of the GTK activation pair. Disabled switches ignore it.
func (*Switch) Invalidate ¶
func (n *Switch) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Switch) InvalidateLayout ¶
func (n *Switch) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Switch) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Switch) KeyAction ¶
KeyAction implements KeyActionHandler: Enter toggles when focused, which makes the switch reachable and activatable by keyboard only. Disabled switches ignore keys.
func (*Switch) LayoutMotion ¶
func (n *Switch) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Switch) MaximumSize ¶
func (n *Switch) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Switch) Measure ¶
Measure wants the 32x18 pill, floored by the stylesheet's min size, inside its CSS box.
func (*Switch) Paint ¶
Paint draws the track and knob. The knob sits at the right when on, in the accent's foreground over the accent track; off, the track is the input color under a knob that contrasts it (the window background on a light palette, the text color on a dark one). A flip blends the two by progress. Disabled, the theme's on-track and knob fade through the derived disabled colors (a stylesheet fades with its own :disabled rules).
func (*Switch) Parent ¶
func (n *Switch) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Switch) RemoveAttr ¶
func (n *Switch) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Switch) RemoveClass ¶
func (n *Switch) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Switch) SetAccessibleName ¶
func (n *Switch) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Switch) SetAttr ¶
func (n *Switch) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Switch) SetClasses ¶
func (n *Switch) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Switch) SetCursorName ¶
func (n *Switch) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Switch) SetDebugName ¶
func (n *Switch) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Switch) SetElement ¶
func (n *Switch) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Switch) SetEnabled ¶
func (n *Switch) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Switch) SetFocusOnClick ¶
func (n *Switch) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Switch) SetHAlign ¶
func (n *Switch) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Switch) SetHExpand ¶
func (n *Switch) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Switch) SetID ¶
func (n *Switch) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Switch) SetInlineStyle ¶
func (n *Switch) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Switch) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Switch) SetLayoutMotion ¶
func (n *Switch) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Switch) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Switch) SetMaximumSize ¶
func (n *Switch) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Switch) SetOnClickWithin ¶
func (n *Switch) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Switch) SetOnFocusChanged ¶
func (n *Switch) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Switch) SetOnHoverWithin ¶
func (n *Switch) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Switch) SetOnPointer ¶
func (n *Switch) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Switch) SetOnScroll ¶
func (n *Switch) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Switch) SetPressed ¶
SetPressed is a no-op: the switch has no pressed visual.
func (*Switch) SetSharedElement ¶
func (n *Switch) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Switch) SetSizeRequest ¶
func (n *Switch) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Switch) SetState ¶
func (n *Switch) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Switch) SetTooltip ¶
func (n *Switch) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Switch) SetTooltipMarkup ¶
func (n *Switch) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Switch) SetVAlign ¶
func (n *Switch) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Switch) SetVExpand ¶
func (n *Switch) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Switch) SetVisible ¶
func (n *Switch) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Switch) SharedElement ¶
func (n *Switch) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Switch) SizeRequest ¶
func (n *Switch) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Switch) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Switch) TooltipText ¶
func (n *Switch) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type SwitchRow ¶
type SwitchRow struct {
*ActionRow
// contains filtered or unexported fields
}
SwitchRow is an ActionRow with a Switch in its end slot: the subtitle typically explains the consequence of flipping.
func NewSwitchRow ¶
func NewSwitchRow(face render.Font, sizePx float64, title, subtitle string, on func(on bool)) *SwitchRow
NewSwitchRow returns the row; on, when set, fires after flips, whatever the source (GTK toggled).
func (SwitchRow) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (SwitchRow) Children ¶
func (c SwitchRow) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (SwitchRow) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (SwitchRow) PackEnd ¶
func (p SwitchRow) PackEnd(w Widget)
PackEnd adds w to the trailing slot.
func (SwitchRow) PackStart ¶
func (p SwitchRow) PackStart(w Widget)
PackStart adds w to the leading slot.
type Symbol ¶
type Symbol struct {
// contains filtered or unexported fields
}
Symbol paints one SymbolKind in a size x size box, stroked in the cascade's color over the theme's muted text. Styled as `image`.
func NewSymbol ¶
func NewSymbol(kind SymbolKind, size int) *Symbol
NewSymbol returns a symbol of kind in a size-pixel box.
func (*Symbol) AccessibleName ¶
func (n *Symbol) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Symbol) AddClass ¶
func (n *Symbol) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Symbol) AttachStylesheet ¶
func (n *Symbol) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Symbol) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Symbol) Classes ¶
func (n *Symbol) Classes() []string
Classes returns a copy of the widget's classes.
func (*Symbol) DebugName ¶
func (n *Symbol) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Symbol) DetachStylesheet ¶
func (n *Symbol) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Symbol) Element ¶
func (n *Symbol) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Symbol) Enabled ¶
func (n *Symbol) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Symbol) HasState ¶
func (n *Symbol) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Symbol) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Symbol) HoverWithin ¶
func (n *Symbol) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Symbol) InlineStyle ¶
func (n *Symbol) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Symbol) Invalidate ¶
func (n *Symbol) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Symbol) InvalidateLayout ¶
func (n *Symbol) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Symbol) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Symbol) LayoutMotion ¶
func (n *Symbol) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Symbol) MaximumSize ¶
func (n *Symbol) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Symbol) Parent ¶
func (n *Symbol) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Symbol) RemoveAttr ¶
func (n *Symbol) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Symbol) RemoveClass ¶
func (n *Symbol) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Symbol) SetAccessibleName ¶
func (n *Symbol) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Symbol) SetAttr ¶
func (n *Symbol) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Symbol) SetClasses ¶
func (n *Symbol) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Symbol) SetCursorName ¶
func (n *Symbol) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Symbol) SetDebugName ¶
func (n *Symbol) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Symbol) SetElement ¶
func (n *Symbol) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Symbol) SetEnabled ¶
func (n *Symbol) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Symbol) SetFocusOnClick ¶
func (n *Symbol) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Symbol) SetHAlign ¶
func (n *Symbol) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Symbol) SetHExpand ¶
func (n *Symbol) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Symbol) SetID ¶
func (n *Symbol) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Symbol) SetInlineStyle ¶
func (n *Symbol) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Symbol) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Symbol) SetKind ¶
func (s *Symbol) SetKind(kind SymbolKind)
SetKind changes the glyph (a disclosure turning, a sort flipping).
func (*Symbol) SetLayoutMotion ¶
func (n *Symbol) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Symbol) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Symbol) SetMaximumSize ¶
func (n *Symbol) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Symbol) SetOnClickWithin ¶
func (n *Symbol) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Symbol) SetOnFocusChanged ¶
func (n *Symbol) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Symbol) SetOnHoverWithin ¶
func (n *Symbol) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Symbol) SetOnPointer ¶
func (n *Symbol) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Symbol) SetOnScroll ¶
func (n *Symbol) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Symbol) SetSharedElement ¶
func (n *Symbol) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Symbol) SetSizeRequest ¶
func (n *Symbol) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Symbol) SetState ¶
func (n *Symbol) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Symbol) SetTooltip ¶
func (n *Symbol) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Symbol) SetTooltipMarkup ¶
func (n *Symbol) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Symbol) SetVAlign ¶
func (n *Symbol) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Symbol) SetVExpand ¶
func (n *Symbol) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Symbol) SetVisible ¶
func (n *Symbol) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Symbol) SharedElement ¶
func (n *Symbol) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Symbol) SizeRequest ¶
func (n *Symbol) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Symbol) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Symbol) TooltipText ¶
func (n *Symbol) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type SymbolKind ¶
type SymbolKind uint8
SymbolKind names one of the vector glyphs the toolkit draws for its own chrome - disclosure arrows, sort indicators, window controls - instead of text glyphs, which fonts (the bundled fixture face among them) often lack and which then render as missing-glyph boxes.
const ( // SymbolChevronRight is a right-pointing chevron (collapsed, next). SymbolChevronRight SymbolKind = iota // SymbolChevronDown is a down-pointing chevron (expanded, descending). SymbolChevronDown // SymbolChevronLeft is a left-pointing chevron (back). SymbolChevronLeft // SymbolChevronUp is an up-pointing chevron (ascending). SymbolChevronUp // SymbolClose is a diagonal cross. SymbolClose // SymbolMinimize is a low horizontal bar. SymbolMinimize // SymbolMaximize is an outlined square. SymbolMaximize // SymbolCrosshair is a picker's crosshair. SymbolCrosshair // SymbolDoubleLeft is two left chevrons (a bigger step back). SymbolDoubleLeft // SymbolDoubleRight is two right chevrons (a bigger step forward). SymbolDoubleRight // SymbolEllipsis is three dots in a row (more, collapsed items). SymbolEllipsis // SymbolMinus is a centered horizontal bar (a separator, less). SymbolMinus // SymbolCheck is a check mark (selected, done). SymbolCheck // SymbolChevronsUpDown is an up chevron over a down one (a picker // that opens a list). SymbolChevronsUpDown // SymbolSearch is a magnifying glass. SymbolSearch // SymbolCalendar is a calendar page (a date field). SymbolCalendar // SymbolPanelLeft is a window with a left pane (a sidebar toggle). SymbolPanelLeft // SymbolArrowLeft is a left-pointing arrow (previous). SymbolArrowLeft // SymbolArrowRight is a right-pointing arrow (next). SymbolArrowRight // SymbolUser is a head over shoulders (a person, an account). SymbolUser // SymbolFolder is a folder with its tab (a project, a directory). SymbolFolder )
Symbol kinds.
type TabBar ¶
type TabBar struct {
// contains filtered or unexported fields
}
TabBar is libadwaita's AdwTabBar: the tabs of a TabView in a row. Clicking a tab selects it, its close button closes it (pinned tabs have none), and dragging a tab drops it at a position in this bar or in another window's, which moves the page there. Tabs show an icon (or a spinner while loading), the title, an attention mark, and the page's indicator. It styles as `tabbar` with `tab` children.
func (*TabBar) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*TabBar) Children ¶
func (c *TabBar) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*TabBar) Detach ¶
func (b *TabBar) Detach()
Detach stops following the view; the bar keeps its last tabs.
func (*TabBar) Drop ¶
Drop moves the dropped tab's page to the position under p: a reorder within this bar's view, a transfer from another.
func (*TabBar) DropAction ¶
DropAction moves.
func (*TabBar) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
type TabOverview ¶
type TabOverview struct {
// OnOpenChanged runs when the overview opens or closes.
OnOpenChanged func(open bool)
// contains filtered or unexported fields
}
TabOverview is libadwaita's AdwTabOverview: while open it replaces its child with a grid of the view's pages as thumbnails; clicking one selects it and closes the overview.
func NewTabOverview ¶
NewTabOverview returns an overview of view around child (usually the window content holding the TabView).
func (*TabOverview) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*TabOverview) Children ¶
func (c *TabOverview) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*TabOverview) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*TabOverview) Open ¶
func (o *TabOverview) Open() bool
Open reports whether the overview shows.
func (*TabOverview) SetOpen ¶
func (o *TabOverview) SetOpen(on bool)
SetOpen opens or closes the overview. Opening snapshots every page at the view's current size.
type TabPage ¶
type TabPage struct {
// OnIndicator runs when the tab's indicator icon is clicked (a mute
// button on a playing tab).
OnIndicator func()
// contains filtered or unexported fields
}
TabPage is one page of a TabView: its child and what its tab shows.
func (*TabPage) NeedsAttention ¶
NeedsAttention reports the attention mark.
func (*TabPage) SetIndicator ¶
SetIndicator sets the indicator icon shown beside the title by theme name; "" shows none. OnIndicator hears clicks on it.
func (*TabPage) SetLoading ¶
SetLoading shows a spinner in place of the icon while on.
func (*TabPage) SetNeedsAttention ¶
SetNeedsAttention marks the tab until it is selected.
func (*TabPage) SetTooltip ¶
SetTooltip sets the tab's tooltip.
type TabTrapper ¶
type TabTrapper interface {
// TrapTab inserts the widget's tab or indent and reports true.
TrapTab(ctrl bool) bool
}
TabTrapper lets a focused widget absorb a plain Tab press as indentation. When the focused widget implements it and TrapTab returns true, focus stays; ctrl+Tab and shift+Tab always move focus regardless of this interface.
type TabView ¶
type TabView struct {
// OnSelect runs when the selected page changes.
OnSelect func(p *TabPage)
// OnClosePage, when set, decides whether p closes: return false to
// keep it (an unsaved-changes prompt).
OnClosePage func(p *TabPage) bool
// OnPageAttached and OnPageDetached run when a page joins or leaves
// this view, by insertion, close or a transfer between views.
OnPageAttached func(p *TabPage)
OnPageDetached func(p *TabPage)
// contains filtered or unexported fields
}
TabView is libadwaita's AdwTabView: a stack of pages, one visible, whose tabs a TabBar (and a TabOverview) present. Pinned pages sit first. Closing asks OnClosePage, which may veto.
func (*TabView) AccessibleName ¶
func (n *TabView) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*TabView) AddClass ¶
func (n *TabView) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*TabView) AttachStylesheet ¶
func (n *TabView) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*TabView) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*TabView) Classes ¶
func (n *TabView) Classes() []string
Classes returns a copy of the widget's classes.
func (*TabView) ClosePage ¶
ClosePage closes p unless OnClosePage vetoes, and reports whether it closed. The page after it, else before it, becomes visible.
func (*TabView) DebugName ¶
func (n *TabView) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*TabView) DetachStylesheet ¶
func (n *TabView) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*TabView) Element ¶
func (n *TabView) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*TabView) Enabled ¶
func (n *TabView) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*TabView) HasState ¶
func (n *TabView) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*TabView) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*TabView) HoverWithin ¶
func (n *TabView) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*TabView) InlineStyle ¶
func (n *TabView) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*TabView) Invalidate ¶
func (n *TabView) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*TabView) InvalidateLayout ¶
func (n *TabView) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*TabView) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*TabView) LayoutMotion ¶
func (n *TabView) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*TabView) MaximumSize ¶
func (n *TabView) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*TabView) Measure ¶
Measure is the widest page's request, so switching tabs does not resize the window.
func (*TabView) Parent ¶
func (n *TabView) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*TabView) RemoveAttr ¶
func (n *TabView) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*TabView) RemoveClass ¶
func (n *TabView) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*TabView) SelectIndex ¶
SelectIndex shows the page at i; out of range does nothing.
func (*TabView) SelectNext ¶
func (v *TabView) SelectNext()
SelectNext shows the next page, wrapping to the first.
func (*TabView) SelectPrevious ¶
func (v *TabView) SelectPrevious()
SelectPrevious shows the previous page, wrapping to the last.
func (*TabView) SetAccessibleName ¶
func (n *TabView) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*TabView) SetAttr ¶
func (n *TabView) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*TabView) SetClasses ¶
func (n *TabView) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*TabView) SetCursorName ¶
func (n *TabView) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*TabView) SetDebugName ¶
func (n *TabView) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*TabView) SetElement ¶
func (n *TabView) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*TabView) SetEnabled ¶
func (n *TabView) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*TabView) SetFocusOnClick ¶
func (n *TabView) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*TabView) SetHAlign ¶
func (n *TabView) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*TabView) SetHExpand ¶
func (n *TabView) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*TabView) SetID ¶
func (n *TabView) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*TabView) SetInlineStyle ¶
func (n *TabView) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*TabView) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*TabView) SetLayoutMotion ¶
func (n *TabView) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*TabView) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*TabView) SetMaximumSize ¶
func (n *TabView) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*TabView) SetOnClickWithin ¶
func (n *TabView) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*TabView) SetOnFocusChanged ¶
func (n *TabView) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*TabView) SetOnHoverWithin ¶
func (n *TabView) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*TabView) SetOnPointer ¶
func (n *TabView) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*TabView) SetOnScroll ¶
func (n *TabView) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*TabView) SetPinned ¶
SetPinned pins or unpins p: pinned pages move to the end of the pinned run, unpinned ones to the start of the rest.
func (*TabView) SetSharedElement ¶
func (n *TabView) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*TabView) SetSizeRequest ¶
func (n *TabView) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*TabView) SetState ¶
func (n *TabView) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*TabView) SetTooltip ¶
func (n *TabView) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*TabView) SetTooltipMarkup ¶
func (n *TabView) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*TabView) SetVAlign ¶
func (n *TabView) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*TabView) SetVExpand ¶
func (n *TabView) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*TabView) SetVisible ¶
func (n *TabView) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*TabView) SharedElement ¶
func (n *TabView) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*TabView) SizeRequest ¶
func (n *TabView) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*TabView) Subscribe ¶
func (v *TabView) Subscribe(fn func()) (cancel func())
Subscribe registers fn for every change of pages, order, selection or page state: what a TabBar redraws from.
func (*TabView) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*TabView) TooltipText ¶
func (n *TabView) TooltipText() string
TooltipText returns the hover text, empty when none is set.
func (*TabView) TransferPage ¶
TransferPage moves p from its view into this one at position i, keeping its child, as a tab dragged between windows. The page is selected in its new view.
type TableColumn ¶
type TableColumn[T any] struct { Title string // Width is the cell's minimum width (the header's too, so columns // line up); Expand shares leftover table width across the // expanding columns, Box-style. Width int Expand bool // Cell builds the cell's widget for one row value; nil renders the // zero label. Cell func(T) Widget // Sort, when non-nil, makes the header clickable and orders rows: // negative puts a first. Equal values keep source order (stable). Sort func(a, b T) int // Head, when set, is the header cell instead of Title's button: a // select-all check. Head Widget }
TableColumn is one typed table column: how a cell renders, how wide it sits, and whether the header sorts by it.
type TextArea ¶
type TextArea struct {
// MaxWidth caps the natural width Measure reports when not
// wrapping: a long line stops growing the layout at the cap and
// pans inside it instead — the text widgets' counterpart of
// Scroll's bounded natural size. Zero (the default) reports the
// content-hugging width. Set it before the first Measure, or
// follow with InvalidateLayout.
MaxWidth int
// OnChanged fires after the contents change, whatever the source:
// typing, editing keys, paste, undo and redo, or SetText (GTK's
// TextBuffer changed). Text reads the new contents.
OnChanged func()
// contains filtered or unexported fields
}
TextArea is a multi-line editor: logical lines split on newlines, per-line cursor motion with a sticky preferred column, and a selection model shared with Entry. With wrap enabled (the default) long logical lines flow across visual rows built from shaped advance widths; editing and Text stay logical regardless.
Example ¶
package main
import (
"fmt"
"log"
"github.com/stubbedev/lys-lib/render"
"golang.org/x/image/font/gofont/goregular"
"github.com/stubbedev/lys-ui/widget"
)
func face() *render.Typeface {
tf, err := render.LoadFont(goregular.TTF)
if err != nil {
log.Fatal(err)
}
return tf
}
func main() {
// A text area holds logical lines and soft-wraps them at the
// offered width by default (SetWrap(false) restores one row per
// line). Editing stays in logical coordinates; Text reports them.
notes := widget.NewTextArea(face(), 14, widget.Current().Text)
notes.SetText("wrap me softly\nline two")
fmt.Println(notes.Text())
fmt.Println("--")
// Place the caret on the second line, after "two", and type.
notes.SetCursor(1, 8)
notes.InsertRune('!')
fmt.Println(notes.Text())
}
Output: wrap me softly line two -- wrap me softly line two!
func NewTextArea ¶
NewTextArea returns an empty area painted with face at sizePx. Face may be a render.Chain for mixed-script fallback. A nil face panics here (see requireFace) instead of failing later, in shaping.
func (*TextArea) AccessibleName ¶
func (n *TextArea) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*TextArea) AddClass ¶
func (n *TextArea) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*TextArea) Arrange ¶
Arrange pins the rect and re-pans the caret's line: a resize changes the visible width, so the caret may need pulling back into view. Stale pans on other lines re-clamp when read.
func (*TextArea) AttachStylesheet ¶
func (n *TextArea) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*TextArea) AutoIndent ¶
AutoIndent reports SetAutoIndent.
func (*TextArea) Backspace ¶
func (t *TextArea) Backspace()
Backspace removes the selection, or one grapheme cluster/line break backward — an emoji family, a flag, a base rune with its marks go as one whole (#57); one undo entry per call. Blocked while disabled or read-only.
func (*TextArea) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*TextArea) CharExtents ¶
CharExtents implements TextGeometry. A line's newline reports a zero-width box at the line's end.
func (*TextArea) Classes ¶
func (n *TextArea) Classes() []string
Classes returns a copy of the widget's classes.
func (*TextArea) ClickAt ¶
ClickAt places the cursor (and anchor) at the clicked position, dropping the composing display.
func (*TextArea) Composing ¶
Composing reports whether composing (input-method preedit) text is on show.
func (*TextArea) CursorName ¶
CursorName reports the text caret shape while hovered.
func (*TextArea) DebugName ¶
func (n *TextArea) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*TextArea) Delete ¶
func (t *TextArea) Delete()
Delete removes the selection, or one grapheme cluster/line break forward (#57); one undo entry per call. Blocked while disabled or read-only.
func (*TextArea) DeleteWordBackward ¶
func (t *TextArea) DeleteWordBackward()
DeleteWordBackward removes the word before the cursor — ctrl+ backspace, with alt+backspace as the macOS alias — or the selection when one is active; the whole word is one undo entry. At a line start it is a no-op: word deletion stays inside the line, it never joins the previous one. Blocked while disabled or read-only.
func (*TextArea) DeleteWordForward ¶
func (t *TextArea) DeleteWordForward()
DeleteWordForward removes the word after the cursor — ctrl+delete — or the selection when one is active; the whole word is one undo entry. At a line end it is a no-op, the mirror of DeleteWordBackward at a line start. Blocked while disabled or read-only.
func (*TextArea) DetachStylesheet ¶
func (n *TextArea) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*TextArea) DoubleClickAt ¶
DoubleClickAt selects the same-class run under the pointer, over the shared word segmentation — the same words the ctrl+arrows steps land on.
func (*TextArea) DragMove ¶
DragMove extends the selection to the dragged position, dropping the composing display. A motion past the field's left or right edge auto-pans the clicked line one step so the drag can reach text outside the viewport.
func (*TextArea) Element ¶
func (n *TextArea) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*TextArea) Enabled ¶
func (n *TextArea) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*TextArea) HAlign ¶
func (n *TextArea) HAlign() Align
HAlign returns the horizontal placement.
func (*TextArea) HasState ¶
func (n *TextArea) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*TextArea) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*TextArea) HoverWithin ¶
func (n *TextArea) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*TextArea) ID ¶
func (n *TextArea) ID() string
ID returns the style id, empty when none is set.
func (*TextArea) IMECursorRect ¶
IMECursorRect implements IMETracker: the caret rectangle in root coordinates, for the input method's candidate window. Pan-aware so the window tracks the caret on a panned unwrapped line, on either direction's reading edge.
func (*TextArea) IMEDelete ¶
IMEDelete implements IMEClient: input-method deletion of up to before bytes before and after bytes after the caret, possibly across line breaks. Blocked while disabled or read-only.
func (*TextArea) IMEMultiline ¶
IMEMultiline implements IMETracker.
func (*TextArea) IMEPreedit ¶
IMEPreedit implements IMEClient. A disabled or read-only area never enters composing (see Entry.IMEPreedit).
func (*TextArea) IMERevision ¶ added in v0.2.5
func (t *TextArea) IMERevision() IMERevision
IMERevision implements IMETracker.
func (*TextArea) IMESurrounding ¶
IMESurrounding implements IMETracker.
func (*TextArea) InlineStyle ¶
func (n *TextArea) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*TextArea) Insert ¶
Insert inserts s at the cursor; an active selection is replaced, and the whole insertion — a paste, a drop, a committed composition — is one undo entry. Blocked while disabled or read-only.
func (*TextArea) InsertRune ¶
InsertRune implements RuneHandler. Typed runes coalesce into one undo entry until a word boundary, an idle gap, or a different edit breaks the run. Blocked while disabled or read-only.
func (*TextArea) Invalidate ¶
func (n *TextArea) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*TextArea) InvalidateLayout ¶
func (n *TextArea) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*TextArea) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*TextArea) KeyAction ¶
KeyAction implements KeyActionHandler. Shift-extended motion grows the selection from its anchor; ctrl turns arrows and backspace/delete word-wise, alt+backspace aliasing ctrl+backspace. The bare keys edit one grapheme cluster per press (#57), so emoji and accented pairs edit whole. Interaction order: while composing, the input method owns the text and the bare backspace unwinds the composing display one rune first — that is compose state (#54), orthogonal to committed text; after it, ctrl/alt make backspace and delete word-wise over the cluster-refined words (#56); the bare keys apply to the contents one cluster at a time. A disabled area ignores keys outright; a read-only one keeps the motion and selection keys and drops only the mutating ones.
func (*TextArea) LayoutMotion ¶
func (n *TextArea) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*TextArea) LineNumbers ¶
LineNumbers reports SetLineNumbers.
func (*TextArea) MaximumSize ¶
func (n *TextArea) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*TextArea) Measure ¶
Measure reports the widest line by the line count, or, when wrapping at the width given, the wrapped row count, the text insets (CSS box, text node, gutter) around it and the stylesheet's min-* floors under it. Composing text counts toward the widest line and the row count. MaxWidth caps the wanted width — a long line then stops widening the layout at the cap and pans inside it. A wrapping area needs no width of its text's: it wraps into what it gets.
func (*TextArea) MoveWord ¶
MoveWord moves the cursor one visual word within its line: the word edge the direction points at, gaps (whitespace, punctuation runs) skipped whole. An active selection collapses to the visually- directed edge first, without moving; the line boundaries are no-ops.
func (*TextArea) MoveWordExtending ¶
MoveWordExtending is MoveWord with shift held: the selection extends from its anchor to the word edge.
func (*TextArea) Paint ¶
Paint draws the wrapped rows, the selection highlight, the composing text with its underline, and the cursor. An unwrapped line wider than the viewport pans: its content draws at -panX[line], clipped to the inner rect, per logical line. The placeholder only shows on an empty area and never pans. State colors follow Entry: disabled fills with the derived disabled surface and fades the text; read-only keeps the text and fades only the caret. The stylesheet's background-color, color, and border-radius override the theme's.
func (*TextArea) Parent ¶
func (n *TextArea) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*TextArea) Placeholder ¶
Placeholder returns the text shown when the area is empty.
func (*TextArea) Redo ¶
Redo reapplies the most recently undone edit, reporting whether there was one. Like Undo it is a user edit and no-ops while disabled or read-only.
func (*TextArea) RemoveAttr ¶
func (n *TextArea) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*TextArea) RemoveClass ¶
func (n *TextArea) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*TextArea) SelectAll ¶
func (t *TextArea) SelectAll()
SelectAll selects the entire document; the pan follows the caret to the end of the last line.
func (*TextArea) SelectedText ¶
SelectedText implements SelectedTexter.
func (*TextArea) SetAccessibleName ¶
func (n *TextArea) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*TextArea) SetAttr ¶
func (n *TextArea) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*TextArea) SetAutoIndent ¶
SetAutoIndent makes Enter start the new line with the current line's leading whitespace (GtkSourceView's auto-indent).
func (*TextArea) SetClasses ¶
func (n *TextArea) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*TextArea) SetCursor ¶
SetCursor places the cursor and anchor at a line/column, clearing any selection. Columns beyond the line clamp.
func (*TextArea) SetCursorName ¶
func (n *TextArea) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*TextArea) SetDebugName ¶
func (n *TextArea) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*TextArea) SetDirection ¶
SetDirection selects the base paragraph direction every line resolves and lays out with — each line is one paragraph. DirectionAuto (the default) reads it off the line's first strong character; DirectionRTL additionally starts short lines at the right edge and mirrors the pan. Arrow and word motion always move visually, through the same resolution the paint uses, while cursor, anchor, and selection stay logical line/column positions. Changing the direction drops the row cache and re-pans.
func (*TextArea) SetElement ¶
func (n *TextArea) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*TextArea) SetEnabled ¶
func (n *TextArea) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*TextArea) SetFocusOnClick ¶
func (n *TextArea) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*TextArea) SetHAlign ¶
func (n *TextArea) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*TextArea) SetHExpand ¶
func (n *TextArea) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*TextArea) SetHighlighter ¶
func (t *TextArea) SetHighlighter(h Highlighter, scheme TextScheme)
SetHighlighter styles the text with h through scheme; a nil h paints it plain.
func (*TextArea) SetID ¶
func (n *TextArea) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*TextArea) SetIndent ¶
SetIndent sets how many spaces Tab inserts while focused; zero (the default) inserts a tab character.
func (*TextArea) SetInlineStyle ¶
func (n *TextArea) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*TextArea) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*TextArea) SetLayoutMotion ¶
func (n *TextArea) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*TextArea) SetLineNumbers ¶
SetLineNumbers shows the line-number gutter at the text's left.
func (*TextArea) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*TextArea) SetMaximumSize ¶
func (n *TextArea) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*TextArea) SetOnClickWithin ¶
func (n *TextArea) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*TextArea) SetOnFocusChanged ¶
func (n *TextArea) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*TextArea) SetOnHoverWithin ¶
func (n *TextArea) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*TextArea) SetOnPointer ¶
func (n *TextArea) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*TextArea) SetOnScroll ¶
func (n *TextArea) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*TextArea) SetPlaceholder ¶
SetPlaceholder sets the text shown when the area is empty.
func (*TextArea) SetReadOnly ¶
SetReadOnly toggles the read-only mode — the same contract as Entry.SetReadOnly: user edits (typing, paste, composition, delete, undo/redo, and Tab indentation through TrapTab) no-op, while selection, copy, caret motion, and pan keep working. A history built before the flip waits untouched. The visual distinguishes itself from disabled the same way: normal text, muted caret.
func (*TextArea) SetScheme ¶
func (t *TextArea) SetScheme(scheme TextScheme)
SetScheme replaces the scheme, keeping the highlighter (a palette change).
func (*TextArea) SetSharedElement ¶
func (n *TextArea) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*TextArea) SetSizeRequest ¶
func (n *TextArea) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*TextArea) SetState ¶
func (n *TextArea) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*TextArea) SetText ¶
SetText replaces the contents, splitting on newlines, and clears the selection and composing display. An app-driven replacement is not an edit to back out of: the undo history starts fresh.
func (*TextArea) SetTooltip ¶
func (n *TextArea) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*TextArea) SetTooltipMarkup ¶
func (n *TextArea) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*TextArea) SetVAlign ¶
func (n *TextArea) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*TextArea) SetVExpand ¶
func (n *TextArea) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*TextArea) SetVariants ¶
func (t *TextArea) SetVariants(v VariantFunc)
SetVariants installs the faces bold and italic styles shape with (RichLabel's VariantFunc); without, they draw with the regular face.
func (*TextArea) SetVisible ¶
func (n *TextArea) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*TextArea) SharedElement ¶
func (n *TextArea) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*TextArea) SizeRequest ¶
func (n *TextArea) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*TextArea) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*TextArea) TooltipText ¶
func (n *TextArea) TooltipText() string
TooltipText returns the hover text, empty when none is set.
func (*TextArea) TrapTab ¶
TrapTab implements the tab-trap rule: a plain Tab inside the area inserts indentation instead of moving focus. Ctrl and shift variants are routed to focus movement before this is asked. Read-only and disabled areas decline the trap, so Tab moves focus instead.
func (*TextArea) Undo ¶
Undo restores the state before the most recent edit — contents, caret, and selection included — reporting whether there was anything to undo. Composing text drops first, like before any other edit. Undo is a user edit: disabled or read-only, it no-ops and returns false while the history waits untouched.
type TextGeometry ¶
type TextGeometry interface {
// CharExtents is the box of the character at offset; false outside
// the text or when nothing is drawn (a hidden password).
CharExtents(offset int) (render.Rect, bool)
// OffsetAt is the offset of the character under p, -1 outside the
// text area.
OffsetAt(p Point) int
}
TextGeometry reports where a text widget draws each character, in root coordinates: what a screen reader's review cursor and magnifiers follow.
type TextInserter ¶
type TextInserter interface {
// Insert inserts s at the caret, replacing the selection.
Insert(s string)
}
TextInserter is an editable text widget that accepts pasted text: Insert places s at the caret, replacing any active selection, and reports the change through OnChanged. Entry and TextArea implement it; primary-selection pastes (middle click) target it.
type TextScheme ¶
type TextScheme map[string]SchemeStyle
TextScheme maps style ids to styles: the highlighter's span classes, and "text", "cursor", "selection" and "line-numbers" for the view itself (a GtkSourceView style scheme).
func (TextScheme) Style ¶
func (s TextScheme) Style(class string) (SchemeStyle, bool)
Style is class's style, following the def.lang map to the nearest style the scheme has; false when none is styled.
type TextSelector ¶
type TextSelector interface {
// SetCaret moves the caret to offset, collapsing any selection.
SetCaret(offset int)
// Select selects start..end, the caret at end.
Select(start, end int)
}
TextSelector is a text widget whose caret and selection code - and assistive technologies, through the AT-SPI bridge - can set, in rune offsets into its Text (the offsets A11yState reports). Positions snap to grapheme-cluster starts, composing text is dropped, and the view pans to the caret.
type TextSpan ¶
TextSpan styles runes [Start, End) of a line with the scheme's style for Class (a GtkSourceView style id, such as def:string).
type TextStyle ¶
type TextStyle struct {
// Bold and Italic select the face variant a run shapes with.
Bold, Italic bool
// Weight is the numeric weight (100 to 1000) a variable face shapes
// the run at, zero the label's; markup keeps Bold in step with it
// (600 and up), so a static family picks its bold variant.
Weight int
// Family is the font family the run shapes in, "" the label's.
Family string
// SizePx is the run's absolute size in pixels, zero the label's;
// Scale multiplies it, zero meaning 1: Pango's absolute and
// relative sizes, relative ones compounding as they nest.
SizePx, Scale float64
// Shift lifts the run off the baseline by that fraction of its size
// (superscript up, subscript down).
Shift float64
// Underline and Strikethrough draw the decoration lines over the
// run (Pango's <u> and <s>), in the run's color; UnderlineStyle is
// the underline's line (double, or wavy for Pango's error).
Underline, Strikethrough bool
UnderlineStyle render.DecorationStyle
// Color overrides the label color while non-zero. Premultiplied,
// like every render.Color.
Color render.Color
// Alpha scales the run's opacity, in (0, 1]; zero leaves it.
Alpha float64
// Background fills behind the run while non-zero.
Background render.Color
// LetterSpacing adds pixels after each of the run's characters.
LetterSpacing float64
// Features are the OpenType features the run shapes with, in the
// canonical tag=value;tag=value form.
Features string
// Href is the link target of a run; empty for plain text.
Href string
}
TextStyle is the style state markup tags accumulate over a run of text. The zero value is the plain label style.
type Theme ¶
type Theme struct {
// Bg is the window background; Surface fills controls at rest.
Bg, Surface Color
// SurfaceHover and SurfacePressed restyle controls under the
// pointer or while pressed. Leave them unset and HoverSurface
// and PressedSurface derive them from Surface.
SurfaceHover, SurfacePressed Color
// Text paints primary labels; TextMuted groups and hints. Leave
// TextMuted unset and DisabledText derives it from Text.
Text, TextMuted Color
// SurfaceDisabled fills disabled controls. Leave it unset and
// DisabledSurface derives it from Surface and Bg.
SurfaceDisabled Color
// Accent drives fills that express state: progress, switches on,
// sliders. HoverAccent derives the translucent hover wash from it.
Accent Color
// OnAccent paints glyphs and knobs on top of Accent.
OnAccent Color
// Border strokes control outlines.
Border Color
// Card fills cards and Popover floating surfaces (menus,
// popovers, dropdown lists). Leave them unset and CardColor and
// PopoverColor derive them from Surface.
Card, Popover Color
// Muted fills quiet regions: tab lists, skeletons, table headers,
// code spans. Leave it unset and MutedColor derives it from
// Surface.
Muted Color
// Secondary fills the secondary button and badge: a fill of its
// own, so an app that paints panels in Surface can keep the
// button visible on them. Leave it unset and SecondaryColor
// derives it from MutedColor.
Secondary Color
// Sidebar fills an application sidebar. Leave it unset and
// SidebarColor derives it from Surface.
Sidebar Color
// Chart colors a chart's series, chart-1 to chart-5; an
// unset one is ChartColor's fallback (Accent).
Chart [5]Color
// Input strokes the borders of text fields and other inputs.
// Leave it unset and InputColor derives it from Border.
Input Color
// Ring paints the focus ring around the focused control. Leave it
// unset and RingColor derives it from Accent.
Ring Color
// Destructive, Success, Warning, and Error are the status fills
// (destructive-action buttons, banners, the @*_bg_color names).
// Leave them unset to derive the Adwaita defaults for the
// palette's polarity - the zero-falls-back-to-derived rule.
Destructive, Success, Warning, Error Color
// ShadowColor paints floating surfaces' box shadows (menus,
// popovers, tooltips, toasts, dialogs). Leave it unset to derive
// the default (neutral black at 110 alpha), the usual zero-falls-
// back-to-derived rule.
ShadowColor Color
// ShadowBlur is the shadow's falloff radius in pixels around every
// floating surface, and the on/off switch: zero disables client
// shadows entirely — for compositors that already blur under
// translucent surfaces, where a client shadow would double up.
ShadowBlur int
// Radius is the default corner rounding; Spacing and Padding are
// layout defaults.
Radius int
Spacing int
Padding int
// TextSize is the default label size in pixels.
TextSize float64
// MotionShort, MotionMedium and MotionLong are the motion tokens:
// the durations of a state change (hover, press), a surface opening
// or closing, and a large move. Stylesheets read them as
// var(--lys-duration-short) and friends. Leave them unset for the
// toolkit's (anim.DurationShort and friends).
MotionShort, MotionMedium, MotionLong time.Duration
// Animations gates the animated enter/exit (and open/reveal) motion:
// surface tweens, toast slides, dropdown lists. False collapses the
// durations to zero — the reduced-motion switch beside
// LYS_UI_NO_ANIM=1 and surfx.SetEnabled(false); state machines run
// unchanged, only the motion goes away.
Animations bool
}
Theme holds the palette and metrics widgets paint with. Colors left at zero on a widget fall back to the theme at paint time, so replacing the theme restyles everything on the next frame.
A Theme is an immutable value: the With* methods return a fresh copy and never touch the receiver, so chains compose from any preset —
widget.SetTheme(widget.DarkTheme().WithAccent(green).WithPadding(10))
Colors arrive from config files as hex strings; parse them with ParseColor or set them with WithAccentHex, which errors on malformed input instead of defaulting silently.
func DarkTheme ¶
func DarkTheme() *Theme
DarkTheme returns the default dark palette: a neutral one, a light primary on near-black, translucent hairlines.
func HighContrastTheme ¶
func HighContrastTheme() *Theme
HighContrastTheme returns the high-contrast preset (#88): pure black on pure white, no muted tones, hairline chrome replaced by a solid border - the palette the desktop's contrast preference asks for. The WCAG guard in SetTheme is its acceptance test by construction: every pair passes AA with room to spare. Shadows and animations stay off; the point is legibility, not depth.
func LightTheme ¶
func LightTheme() *Theme
LightTheme returns the default light palette: a neutral one, a near-black primary on white.
func (*Theme) ChartColor ¶
ChartColor returns series i's color, cycling through the five chart colors; an unset one is Accent.
func (*Theme) DestructiveColor ¶
DestructiveColor returns the destructive fill (Destructive when set).
func (*Theme) DisabledAccent ¶
DisabledAccent returns the accent fill (a switch's on-track, a slider's fill, a checkbox's tick) while the control ignores input: Accent faded to disabledFade, the same fade DisabledText applies to Text.
func (*Theme) DisabledSurface ¶
DisabledSurface returns the fill of a control that ignores input: the explicit SurfaceDisabled when set, otherwise Surface mixed halfway toward Bg — the control recedes into the window on any palette, the inert counterpart of PressedSurface.
func (*Theme) DisabledText ¶
DisabledText returns the color for rows and labels that ignore input: the explicit TextMuted when set, otherwise Text faded to disabledFade alpha.
func (*Theme) DrawShadow ¶
DrawShadow paints the theme's box shadow around r — a widget's arranged bounds — rounding at the given corner radius. It is the one elevation helper every floating surface paints through; disabled or fully transparent shadows paint nothing.
func (*Theme) ErrorColor ¶
ErrorColor returns the error fill (Error when set).
func (*Theme) HoverAccent ¶
HoverAccent returns the translucent accent wash rows and items paint under the pointer: Accent at alpha 70, the same derivation every highlighter uses.
func (*Theme) HoverSurface ¶
HoverSurface returns the control fill under the pointer: the explicit SurfaceHover when set, otherwise Surface mixed 8% toward Text. The text pole carries the palette's polarity, so the shift lightens dark palettes and darkens light ones.
func (*Theme) InputColor ¶
InputColor returns the input border color: Input when set, otherwise Border.
func (*Theme) IsDark ¶
IsDark reports the palette's polarity: a background darker than mid-grey luminance.
func (*Theme) MotionDurations ¶
MotionDurations returns the motion tokens in effect: the theme's, the toolkit's where unset, and zero throughout when Moves is false.
func (*Theme) Moves ¶ added in v0.2.1
Moves reports whether this theme's motion runs: Animations, unless the desktop asks for reduced motion (SetReducedMotion).
func (*Theme) MutedColor ¶
MutedColor returns the quiet-region fill: Muted when set, otherwise Surface.
func (*Theme) PopoverColor ¶
PopoverColor returns the floating-surface fill: Popover when set, otherwise Surface.
func (*Theme) PressedSurface ¶
PressedSurface returns the control fill while pressed: the explicit SurfacePressed when set, otherwise Surface mixed 20% toward black — the surface recedes under a press on any palette.
func (*Theme) SecondaryColor ¶
SecondaryColor returns the secondary variant's fill: Secondary when set, otherwise MutedColor.
func (*Theme) ShadowGutter ¶
ShadowGutter reports how much room a surface must reserve around its content for the theme's shadow: the blur when shadows paint, else zero. Popups grow their surface by it on every side and dialogs inset their card by it; content size, placement, and hit-testing stay on the un-guttered logical rect.
func (*Theme) ShadowRing ¶
ShadowRing returns the rect the shadow around r covers: the damage ring a floating widget owes beyond its bounds (the blur plus the anti-aliasing rim, matching the raster's box). Empty when the shadow is disabled, which callers treat as "no extra pixels owed".
func (*Theme) SidebarColor ¶
SidebarColor returns the sidebar fill: Sidebar when set, otherwise Surface.
func (*Theme) SuccessColor ¶
SuccessColor returns the success fill (Success when set).
func (*Theme) TitleSize ¶
TitleSize is the size of a title over text at TextSize: a card's, a dialog's or a window's heading.
func (*Theme) WarningColor ¶
WarningColor returns the warning fill (Warning when set).
func (*Theme) WithAccent ¶
WithAccent returns a copy with the accent color set.
func (*Theme) WithAccentHex ¶
WithAccentHex returns a copy with the accent parsed from a hex string (#rgb, #rrggbb, #rrggbbaa). A malformed string is an error, never a silent default — theme construction is where a config mistake must surface.
func (*Theme) WithAnimations ¶
WithAnimations returns a copy with the animated-motion gate set; false is the theme-level reduced-motion switch (see Animations).
func (*Theme) WithBorder ¶
WithBorder returns a copy with the outline color set.
func (*Theme) WithMotion ¶
WithMotion returns a copy with the motion tokens set; zero keeps a token at the toolkit's duration.
func (*Theme) WithOnAccent ¶
WithOnAccent returns a copy with the on-accent glyph color set.
func (*Theme) WithPadding ¶
WithPadding returns a copy with the default control padding set.
func (*Theme) WithPopover ¶
WithPopover returns a copy with the floating-surface fill set.
func (*Theme) WithRadius ¶
WithRadius returns a copy with the default corner rounding set.
func (*Theme) WithSecondary ¶
WithSecondary returns a copy with the secondary variant's fill set.
func (*Theme) WithShadowBlur ¶
WithShadowBlur returns a copy with the shadow falloff radius set; zero disables client shadows (see ShadowBlur).
func (*Theme) WithShadowColor ¶
WithShadowColor returns a copy with the box-shadow color set. The zero color means unset (derive the default), the theme-wide convention.
func (*Theme) WithSidebar ¶
WithSidebar returns a copy with the sidebar fill set.
func (*Theme) WithSpacing ¶
WithSpacing returns a copy with the default layout gap set.
func (*Theme) WithSurface ¶
WithSurface returns a copy with the control fill set.
func (*Theme) WithSurfaceDisabled ¶
WithSurfaceDisabled returns a copy with the disabled-control fill set; unset, the copy derives one (DisabledSurface).
func (*Theme) WithSurfaceHover ¶
WithSurfaceHover returns a copy with the hover shade set; unset, the copy derives one (HoverSurface).
func (*Theme) WithSurfacePressed ¶
WithSurfacePressed returns a copy with the pressed shade set; unset, the copy derives one (PressedSurface).
func (*Theme) WithTextMuted ¶
WithTextMuted returns a copy with the secondary text color set.
func (*Theme) WithTextSize ¶
WithTextSize returns a copy with the default label size set.
type TimeOfDay ¶
type TimeOfDay struct {
Hour, Minute int
}
TimeOfDay is a wall-clock time: an hour 0-23 and a minute 0-59.
type Toast ¶
type Toast struct {
OnAction func()
// OnDismissed fires once when the toast finished going away — the
// exit fade landed, or Dismiss hit a toast that was out of the
// tree. The host detaches it inside.
OnDismissed func()
// contains filtered or unexported fields
}
Toast is a transient feedback card: a line of text, an optional muted description under it, an optional action button, an auto-dismiss timer that hover pauses (hovering cancels the pending dismissal — even a mid-exit toast snaps back — and leaving arms a fresh full timeout), and a slide-and-fade entrance plus fade-out exit, all on the animation clock. A toast out of the tree is inert: it holds no timer, so a detached toast costs no wakeups.
The host learns the toast is gone from OnDismissed, which fires exactly once when the exit fade lands, and detaches it there.
func NewToast ¶
NewToast returns a toast showing text. A positive timeout auto-dismisses the card once it is on screen; zero or negative keeps it until Dismiss. Face may be a render.Chain for mixed-script fallback. A nil face panics here (see requireFace) instead of failing later, in shaping.
func (*Toast) AccessibleName ¶
func (n *Toast) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*Toast) AddClass ¶
func (n *Toast) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*Toast) Arrange ¶
Arrange records the rect. The first visible arrangement starts the entrance and arms the auto-dismiss timer; going off screen stops both — nothing animates while hidden.
func (*Toast) AttachStylesheet ¶
func (n *Toast) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*Toast) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*Toast) Classes ¶
func (n *Toast) Classes() []string
Classes returns a copy of the widget's classes.
func (*Toast) ClickAt ¶
ClickAt fires the action when the release landed on it, dismissing the toast; clicks elsewhere are inert.
func (*Toast) Close ¶
func (t *Toast) Close()
Close tears the toast down without a fade and without firing OnDismissed — the host calling this is already detaching it.
func (*Toast) DebugName ¶
func (n *Toast) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*Toast) Description ¶
Description returns the line under the text, empty when there is none.
func (*Toast) DetachStylesheet ¶
func (n *Toast) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*Toast) Dismiss ¶
func (t *Toast) Dismiss()
Dismiss starts the exit fade now. A toast out of the tree has no pixels to fade, so it finishes on the spot.
func (*Toast) Element ¶
func (n *Toast) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*Toast) Enabled ¶
func (n *Toast) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*Toast) HasState ¶
func (n *Toast) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*Toast) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*Toast) HitTest ¶
HitTest returns the toast when p is inside its bounds; the toast handles its own action clicks.
func (*Toast) HoverWithin ¶
func (n *Toast) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*Toast) InlineStyle ¶
func (n *Toast) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*Toast) Invalidate ¶
func (n *Toast) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*Toast) InvalidateLayout ¶
func (n *Toast) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*Toast) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*Toast) LayoutMotion ¶
func (n *Toast) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*Toast) MaximumSize ¶
func (n *Toast) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*Toast) Measure ¶
Measure wants the text plus the action at the theme text size, padded to a card, and needs only the action and the padding: the host clamps the width and the text clips.
func (*Toast) Paint ¶
Paint draws the card, its text, and the action button at the current reveal: alpha fades with progress, and the entrance rise is masked to the paint extent — the card's bounds, widened by the theme shadow ring plus the slide when one is owed — so the animation never paints outside its damage rect. The shadow rides the card (it shifts with the same dy), which is why it clips to the extent, not the bounds. The stylesheet's box-shadow, background-color, border, border-radius, and color override the theme's; the action is Sonner's small button on the primary fill.
func (*Toast) Parent ¶
func (n *Toast) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*Toast) RemoveAttr ¶
func (n *Toast) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*Toast) RemoveClass ¶
func (n *Toast) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*Toast) SetAccessibleName ¶
func (n *Toast) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*Toast) SetAction ¶
SetAction attaches the optional action button; an empty label removes it. Firing the action dismisses the toast, the standard toast contract.
func (*Toast) SetAttr ¶
func (n *Toast) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*Toast) SetClasses ¶
func (n *Toast) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*Toast) SetCursorName ¶
func (n *Toast) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*Toast) SetDebugName ¶
func (n *Toast) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*Toast) SetDescription ¶
SetDescription sets the muted line under the text; empty removes it.
func (*Toast) SetElement ¶
func (n *Toast) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*Toast) SetEnabled ¶
func (n *Toast) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*Toast) SetFocusOnClick ¶
func (n *Toast) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*Toast) SetHAlign ¶
func (n *Toast) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*Toast) SetHExpand ¶
func (n *Toast) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*Toast) SetHovered ¶
SetHovered implements HoverSetter: hover cancels the pending dismissal — the timer goes away and a mid-exit toast snaps back — and leaving arms a fresh full timeout.
func (*Toast) SetID ¶
func (n *Toast) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*Toast) SetInlineStyle ¶
func (n *Toast) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*Toast) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*Toast) SetLayoutMotion ¶
func (n *Toast) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*Toast) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*Toast) SetMaximumSize ¶
func (n *Toast) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*Toast) SetOnClickWithin ¶
func (n *Toast) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*Toast) SetOnFocusChanged ¶
func (n *Toast) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*Toast) SetOnHoverWithin ¶
func (n *Toast) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*Toast) SetOnPointer ¶
func (n *Toast) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*Toast) SetOnScroll ¶
func (n *Toast) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*Toast) SetSharedElement ¶
func (n *Toast) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*Toast) SetSizeRequest ¶
func (n *Toast) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*Toast) SetState ¶
func (n *Toast) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*Toast) SetTooltip ¶
func (n *Toast) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*Toast) SetTooltipMarkup ¶
func (n *Toast) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*Toast) SetVAlign ¶
func (n *Toast) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*Toast) SetVExpand ¶
func (n *Toast) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*Toast) SetVisible ¶
func (n *Toast) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*Toast) SharedElement ¶
func (n *Toast) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*Toast) SizeRequest ¶
func (n *Toast) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*Toast) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*Toast) TooltipText ¶
func (n *Toast) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type ToggleButton ¶
type ToggleButton struct {
Button
// OnToggled fires after every change of the active state, from a
// click, a key, SetActive, or a group peer taking over.
OnToggled func(active bool)
// contains filtered or unexported fields
}
ToggleButton is a button that stays pressed (GTK ToggleButton): clicking flips its active state, painted with the selected fill and :checked. In a group (SetGroup) it behaves as a radio: activating it releases the others and a click on the active one keeps it active. The embedded Button's OnClick drives the toggle; observe OnToggled. Assistive technology reads it as a toggle button, pressed while active.
func NewToggleButton ¶
func NewToggleButton(child Widget, padding, radius int) *ToggleButton
NewToggleButton returns an inactive toggle around child. It styles as GTK's toggle, button.toggle.
func (*ToggleButton) AccessibleName ¶
func (n *ToggleButton) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*ToggleButton) AddClass ¶
func (n *ToggleButton) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*ToggleButton) AttachStylesheet ¶
func (n *ToggleButton) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*ToggleButton) BindAction ¶
func (t *ToggleButton) BindAction(c Checkable) (unbind func())
BindAction makes the toggle a proxy of c: it shows c's checked state, a click activates c, and it is enabled exactly while c is.
func (*ToggleButton) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*ToggleButton) Classes ¶
func (n *ToggleButton) Classes() []string
Classes returns a copy of the widget's classes.
func (*ToggleButton) DebugName ¶
func (n *ToggleButton) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*ToggleButton) DetachStylesheet ¶
func (n *ToggleButton) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*ToggleButton) Element ¶
func (n *ToggleButton) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*ToggleButton) Enabled ¶
func (n *ToggleButton) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*ToggleButton) HAlign ¶
func (n *ToggleButton) HAlign() Align
HAlign returns the horizontal placement.
func (*ToggleButton) HasState ¶
func (n *ToggleButton) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*ToggleButton) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*ToggleButton) HoverWithin ¶
func (n *ToggleButton) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*ToggleButton) ID ¶
func (n *ToggleButton) ID() string
ID returns the style id, empty when none is set.
func (*ToggleButton) InlineStyle ¶
func (n *ToggleButton) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*ToggleButton) Invalidate ¶
func (n *ToggleButton) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*ToggleButton) InvalidateLayout ¶
func (n *ToggleButton) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*ToggleButton) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*ToggleButton) LayoutMotion ¶
func (n *ToggleButton) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*ToggleButton) MaximumSize ¶
func (n *ToggleButton) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*ToggleButton) Parent ¶
func (n *ToggleButton) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*ToggleButton) RemoveAttr ¶
func (n *ToggleButton) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*ToggleButton) RemoveClass ¶
func (n *ToggleButton) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*ToggleButton) SetAccessibleName ¶
func (n *ToggleButton) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*ToggleButton) SetActive ¶
func (t *ToggleButton) SetActive(on bool)
SetActive changes the state, firing OnToggled when it flipped.
func (*ToggleButton) SetAttr ¶
func (n *ToggleButton) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*ToggleButton) SetClasses ¶
func (n *ToggleButton) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*ToggleButton) SetCursorName ¶
func (n *ToggleButton) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*ToggleButton) SetDebugName ¶
func (n *ToggleButton) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*ToggleButton) SetElement ¶
func (n *ToggleButton) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*ToggleButton) SetEnabled ¶
func (n *ToggleButton) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*ToggleButton) SetFocusOnClick ¶
func (n *ToggleButton) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*ToggleButton) SetGroup ¶
func (t *ToggleButton) SetGroup(other *ToggleButton)
SetGroup makes t a radio peer of other (joining other's group).
func (*ToggleButton) SetHAlign ¶
func (n *ToggleButton) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*ToggleButton) SetHExpand ¶
func (n *ToggleButton) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*ToggleButton) SetID ¶
func (n *ToggleButton) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*ToggleButton) SetInlineStyle ¶
func (n *ToggleButton) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*ToggleButton) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*ToggleButton) SetLayoutMotion ¶
func (n *ToggleButton) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*ToggleButton) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*ToggleButton) SetMaximumSize ¶
func (n *ToggleButton) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*ToggleButton) SetOnClickWithin ¶
func (n *ToggleButton) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*ToggleButton) SetOnFocusChanged ¶
func (n *ToggleButton) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*ToggleButton) SetOnHoverWithin ¶
func (n *ToggleButton) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*ToggleButton) SetOnPointer ¶
func (n *ToggleButton) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*ToggleButton) SetOnScroll ¶
func (n *ToggleButton) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*ToggleButton) SetSharedElement ¶
func (n *ToggleButton) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*ToggleButton) SetSizeRequest ¶
func (n *ToggleButton) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*ToggleButton) SetState ¶
func (n *ToggleButton) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*ToggleButton) SetTooltip ¶
func (n *ToggleButton) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*ToggleButton) SetTooltipMarkup ¶
func (n *ToggleButton) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*ToggleButton) SetVAlign ¶
func (n *ToggleButton) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*ToggleButton) SetVExpand ¶
func (n *ToggleButton) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*ToggleButton) SetVisible ¶
func (n *ToggleButton) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*ToggleButton) SharedElement ¶
func (n *ToggleButton) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*ToggleButton) SizeRequest ¶
func (n *ToggleButton) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*ToggleButton) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*ToggleButton) TooltipText ¶
func (n *ToggleButton) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type ToggleGroup ¶
type ToggleGroup struct {
// OnChanged fires after every change of the active toggle, from a
// click, a key, or SetActive.
OnChanged func(i int)
// contains filtered or unexported fields
}
ToggleGroup is the segmented control (adw 1.7): a pill of ToggleButtons in one radio group, exactly one active. Clicks and Left/Right activate; SetActive drives it from code. ViewSwitcher is a ToggleGroup bound to a Stack.
func NewToggleGroup ¶
func NewToggleGroup(items ...Widget) *ToggleGroup
NewToggleGroup returns a group over items (labels, ButtonContents, icons), the first active.
func (*ToggleGroup) Active ¶
func (g *ToggleGroup) Active() int
Active reports the active toggle (-1 when empty).
func (*ToggleGroup) Append ¶
func (g *ToggleGroup) Append(content Widget)
Append adds a toggle; the first one appended is active. Appending never announces: OnChanged reports user and SetActive changes only.
func (*ToggleGroup) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*ToggleGroup) Children ¶
func (c *ToggleGroup) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*ToggleGroup) KeyAction ¶
func (g *ToggleGroup) KeyAction(a KeyAction, _ Mods)
KeyAction moves the active toggle with Left/Right.
func (*ToggleGroup) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*ToggleGroup) SetActive ¶
func (g *ToggleGroup) SetActive(i int)
SetActive activates toggle i (clamped); OnChanged fires when it moved.
type ToolbarStyle ¶
type ToolbarStyle uint8
ToolbarStyle is how a ToolbarView's bars sit against the content.
const ( // ToolbarFlat draws the bars flush with the content. ToolbarFlat ToolbarStyle = iota // ToolbarRaised raises the bars with a shadow. ToolbarRaised // ToolbarRaisedBorder raises the bars and draws a border. ToolbarRaisedBorder )
type ToolbarView ¶
type ToolbarView struct {
// contains filtered or unexported fields
}
ToolbarView is libadwaita's AdwToolbarView: top and bottom bars around a content widget. The bars reveal and hide with a slide, take a flat, raised or raised-with-border style, and the content can extend under them (under translucent bars, scrolling beneath them). It styles as `toolbarview` with `.top-bar` and `.bottom-bar` parts carrying the style as a class.
func NewToolbarView ¶
func NewToolbarView(content Widget) *ToolbarView
NewToolbarView returns a toolbar view around content.
func (*ToolbarView) AddBottomBar ¶
func (t *ToolbarView) AddBottomBar(bar Widget)
AddBottomBar appends a bar to the bottom stack.
func (*ToolbarView) AddTopBar ¶
func (t *ToolbarView) AddTopBar(bar Widget)
AddTopBar appends a bar to the top stack.
func (*ToolbarView) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*ToolbarView) Children ¶
func (c *ToolbarView) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*ToolbarView) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*ToolbarView) RevealBottomBars ¶
func (t *ToolbarView) RevealBottomBars() bool
RevealBottomBars reports whether the bottom bars are shown.
func (*ToolbarView) RevealTopBars ¶
func (t *ToolbarView) RevealTopBars() bool
RevealTopBars reports whether the top bars are shown.
func (*ToolbarView) SetBottomBarStyle ¶
func (t *ToolbarView) SetBottomBarStyle(s ToolbarStyle)
SetBottomBarStyle sets the bottom bars' style.
func (*ToolbarView) SetContent ¶
func (t *ToolbarView) SetContent(w Widget)
SetContent replaces the content.
func (*ToolbarView) SetExtendContentToBottomEdge ¶
func (t *ToolbarView) SetExtendContentToBottomEdge(on bool)
SetExtendContentToBottomEdge lets the content run under the bottom bars.
func (*ToolbarView) SetExtendContentToTopEdge ¶
func (t *ToolbarView) SetExtendContentToTopEdge(on bool)
SetExtendContentToTopEdge lets the content run under the top bars.
func (*ToolbarView) SetRevealBottomBars ¶
func (t *ToolbarView) SetRevealBottomBars(on bool)
SetRevealBottomBars shows or hides the bottom bars with a slide.
func (*ToolbarView) SetRevealTopBars ¶
func (t *ToolbarView) SetRevealTopBars(on bool)
SetRevealTopBars shows or hides the top bars with a slide.
func (*ToolbarView) SetTopBarStyle ¶
func (t *ToolbarView) SetTopBarStyle(s ToolbarStyle)
SetTopBarStyle sets the top bars' style.
type TooltipAnchorer ¶
TooltipAnchorer is a widget whose tooltip belongs to a part of it, a calendar's hovered day: the tooltip centers under that rect, in the tree's coordinates, rather than under the widget's bounds.
type TooltipMarkupper ¶
TooltipMarkupper is a widget whose tooltip may be RichLabel markup; every node is one (SetTooltipMarkup).
type TooltipTexter ¶
type TooltipTexter interface {
// TooltipText returns the tooltip, empty when none is set.
TooltipText() string
}
TooltipTexter exposes a widget's hover tooltip text.
type TouchPointer ¶
type TouchPointer interface {
TouchMove(p Point)
TouchPress(p Point)
TouchRelease(p Point)
// TouchCancel ends the emulated press without a click: a gesture
// took the contact over.
TouchCancel()
}
TouchPointer receives a touch contact's pointer emulation: the host routes it through its own pointer path (window-frame grabs and drag sources included), or RouterPointer drives the router directly.
type TouchTracker ¶
type TouchTracker struct {
Router *Router
Pointer TouchPointer
// contains filtered or unexported fields
}
TouchTracker turns touch contacts into input the rest of the toolkit already speaks. One contact emulates the pointer - a tap clicks, a drag drags, a hold past the long-press delay offers GestureLongPress - through Pointer. A second contact cancels that and makes the pair a gesture: a pinch (scale and rotation) for a widget that claims GesturePinch, otherwise a two-finger scroll down the precise-axis path, ending in a kinetic glide when the fingers lift.
func (*TouchTracker) Cancel ¶
func (t *TouchTracker) Cancel()
Cancel drops every contact: the compositor took the sequence.
func (*TouchTracker) Down ¶
func (t *TouchTracker) Down(id int32, p Point)
Down adds a contact at p.
func (*TouchTracker) Motion ¶
func (t *TouchTracker) Motion(id int32, p Point)
Motion moves contact id to p.
type TypedFactory ¶
type TypedFactory[T any] struct { Setup func() Widget Bind func(item T, row Widget) // Unbind, when set, runs when a row's item scrolls out; the row // goes back to the pool and is Bound to whatever scrolls in next. Unbind func(item T, row Widget) }
TypedFactory is how a typed view materializes rows, relm4's RelmListItem/RelmGridItem: Setup builds a row once, Bind fills it for one item every time it scrolls into view, Unbind releases it when it scrolls out. Rows recycle: only the visible ones exist, and Setup runs about as often as the viewport holds rows.
type TypedGrid ¶
TypedGrid is a virtualized grid over typed items, relm4's TypedGridView: a TypedList flowing left to right in as many columns of the cell width as the width fits, recycling, sorting, filters and typed selection all inherited. It styles as `gridview` with `child` cells.
func NewTypedGrid ¶
func NewTypedGrid[T any](model ColumnModel[T], factory TypedFactory[T], cellWidth, cellHeight int) *TypedGrid[T]
NewTypedGrid returns a grid over model with cells of at least cellWidth by cellHeight pixels, between 1 and 7 columns (GTK's defaults).
func (*TypedGrid) AccessibleName ¶
func (n *TypedGrid) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*TypedGrid) AddClass ¶
func (n *TypedGrid) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*TypedGrid) AttachStylesheet ¶
func (n *TypedGrid) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*TypedGrid) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*TypedGrid) Classes ¶
func (n *TypedGrid) Classes() []string
Classes returns a copy of the widget's classes.
func (*TypedGrid) DebugName ¶
func (n *TypedGrid) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*TypedGrid) DetachStylesheet ¶
func (n *TypedGrid) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*TypedGrid) Element ¶
func (n *TypedGrid) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*TypedGrid) Enabled ¶
func (n *TypedGrid) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*TypedGrid) HAlign ¶
func (n *TypedGrid) HAlign() Align
HAlign returns the horizontal placement.
func (*TypedGrid) HasState ¶
func (n *TypedGrid) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*TypedGrid) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*TypedGrid) HoverWithin ¶
func (n *TypedGrid) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*TypedGrid) ID ¶
func (n *TypedGrid) ID() string
ID returns the style id, empty when none is set.
func (*TypedGrid) InlineStyle ¶
func (n *TypedGrid) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*TypedGrid) Invalidate ¶
func (n *TypedGrid) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*TypedGrid) InvalidateLayout ¶
func (n *TypedGrid) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*TypedGrid) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*TypedGrid) LayoutMotion ¶
func (n *TypedGrid) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*TypedGrid[T]) MaxColumns ¶
MaxColumns returns the column cap, zero for none.
func (*TypedGrid) MaximumSize ¶
func (n *TypedGrid) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*TypedGrid[T]) MinColumns ¶
MinColumns returns the column floor.
func (*TypedGrid) Parent ¶
func (n *TypedGrid) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*TypedGrid) RemoveAttr ¶
func (n *TypedGrid) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*TypedGrid) RemoveClass ¶
func (n *TypedGrid) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*TypedGrid) Select ¶
func (s *TypedGrid) Select(i int)
Select moves the selection to item i (clamped, -1 clears). In multiple mode it collapses the set to the one item (-1 clears it); in none mode it does nothing.
func (*TypedGrid) SelectAll ¶
func (s *TypedGrid) SelectAll()
SelectAll selects every item. It is the ctrl+a target through Router.SelectAll and does nothing outside multiple mode, where "all" is not a representable selection.
func (*TypedGrid) SelectRows ¶
func (s *TypedGrid) SelectRows(rows ...int)
SelectRows makes rows the multiple-mode selection (out-of-range rows are dropped) and notifies; outside multiple mode it does nothing.
func (*TypedGrid) Selected ¶
func (s *TypedGrid) Selected() int
Selected returns the selected item in single and browse mode; in multiple mode the anchor the last gesture or Select settled on, -1 when the set is empty. Selection reports the whole set.
func (*TypedGrid) Selection ¶
func (s *TypedGrid) Selection() []int
Selection returns the whole selected set, ascending; empty when nothing is selected.
func (*TypedGrid) SelectionMode ¶
func (s *TypedGrid) SelectionMode() SelectionMode
SelectionMode returns the current selection model.
func (*TypedGrid) SetAccessibleName ¶
func (n *TypedGrid) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*TypedGrid) SetAttr ¶
func (n *TypedGrid) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*TypedGrid) SetClasses ¶
func (n *TypedGrid) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*TypedGrid) SetCursorName ¶
func (n *TypedGrid) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*TypedGrid) SetDebugName ¶
func (n *TypedGrid) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*TypedGrid) SetElement ¶
func (n *TypedGrid) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*TypedGrid) SetEnabled ¶
func (n *TypedGrid) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*TypedGrid) SetFocusOnClick ¶
func (n *TypedGrid) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*TypedGrid) SetHAlign ¶
func (n *TypedGrid) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*TypedGrid) SetHExpand ¶
func (n *TypedGrid) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*TypedGrid) SetID ¶
func (n *TypedGrid) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*TypedGrid) SetInlineStyle ¶
func (n *TypedGrid) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*TypedGrid) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*TypedGrid) SetLayoutMotion ¶
func (n *TypedGrid) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*TypedGrid) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*TypedGrid[T]) SetMaxColumns ¶
SetMaxColumns sets the most columns the grid lays out; zero lifts the cap.
func (*TypedGrid) SetMaximumSize ¶
func (n *TypedGrid) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*TypedGrid[T]) SetMinColumns ¶
SetMinColumns sets the fewest columns the grid lays out, even when cells end up narrower than their width.
func (*TypedGrid) SetOnClickWithin ¶
func (n *TypedGrid) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*TypedGrid) SetOnFocusChanged ¶
func (n *TypedGrid) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*TypedGrid) SetOnHoverWithin ¶
func (n *TypedGrid) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*TypedGrid) SetOnPointer ¶
func (n *TypedGrid) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*TypedGrid) SetOnScroll ¶
func (n *TypedGrid) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*TypedGrid) SetSelectionMode ¶
func (s *TypedGrid) SetSelectionMode(mode SelectionMode)
SetSelectionMode switches the selection model. Leaving multiple mode keeps the lowest selected item as the single selection (or clears it when the set was empty); entering it seeds the set with the current selection and anchors there. The change notification fires when the switch changes the set.
func (*TypedGrid) SetSharedElement ¶
func (n *TypedGrid) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*TypedGrid) SetSizeRequest ¶
func (n *TypedGrid) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*TypedGrid) SetState ¶
func (n *TypedGrid) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*TypedGrid) SetTooltip ¶
func (n *TypedGrid) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*TypedGrid) SetTooltipMarkup ¶
func (n *TypedGrid) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*TypedGrid) SetVAlign ¶
func (n *TypedGrid) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*TypedGrid) SetVExpand ¶
func (n *TypedGrid) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*TypedGrid) SetVisible ¶
func (n *TypedGrid) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*TypedGrid) SharedElement ¶
func (n *TypedGrid) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*TypedGrid) SizeRequest ¶
func (n *TypedGrid) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*TypedGrid) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*TypedGrid) TooltipText ¶
func (n *TypedGrid) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type TypedItems ¶
type TypedItems[T any] struct { // contains filtered or unexported fields }
TypedItems is the typed item model the typed views sit on, relm4's DynamicIndex analog: a slice of T with CRUD, insertion in sort order, and change notification - wholesale through SetRefresh/Notify, one edited item in place through SetItemRefresh/NotifyItem. It is a ColumnModel, so it feeds TypedList, TypedGrid and ColumnView alike.
func NewTypedItems ¶
func NewTypedItems[T any](items ...T) *TypedItems[T]
NewTypedItems returns a model over items.
func (*TypedItems[T]) Clear ¶
func (m *TypedItems[T]) Clear()
Clear drops every item and notifies the refresh.
func (*TypedItems[T]) Insert ¶
func (m *TypedItems[T]) Insert(i int, item T)
Insert adds item at i and notifies the refresh.
func (*TypedItems[T]) InsertSorted ¶
func (m *TypedItems[T]) InsertSorted(item T, cmp func(a, b T) int) int
InsertSorted adds item at the position cmp keeps the slice sorted at (the first among equals) and returns where it landed.
func (*TypedItems[T]) Notify ¶
func (m *TypedItems[T]) Notify()
Notify reports the model changed; the view recomputes - resorting, refiltering and rebinding in the process.
func (*TypedItems[T]) NotifyItem ¶
func (m *TypedItems[T]) NotifyItem(i int)
NotifyItem reports item i was edited in place; a visible row rebinds to the new value, and nothing else moves.
func (*TypedItems[T]) RemoveAt ¶
func (m *TypedItems[T]) RemoveAt(i int)
RemoveAt drops item i and notifies the refresh.
func (*TypedItems[T]) Set ¶
func (m *TypedItems[T]) Set(i int, item T)
Set replaces item i in place and notifies the item refresh, so a visible row rebinds to the new value without rebuilding the view.
func (*TypedItems[T]) SetItemRefresh ¶
func (m *TypedItems[T]) SetItemRefresh(fn func(i int))
SetItemRefresh installs the per-item hook NotifyItem runs.
func (*TypedItems[T]) SetRefresh ¶
func (m *TypedItems[T]) SetRefresh(fn func())
SetRefresh installs the wholesale-change hook Notify runs.
type TypedList ¶
type TypedList[T any] struct { List // OnSelectionChanged fires with the selected items, in visible // order, once per gesture. OnSelectionChanged func(items []T) // OnActivate fires with the activated row's item. OnActivate func(item T) // contains filtered or unexported fields }
TypedList is a virtualized list over typed items, relm4's TypedListView: the model layer sorts and filters without touching the source, rows are built once by the factory's Setup and filled per item by Bind (Unbind on the way out), so only the visible rows exist, and selection is typed - it reports items and follows them through sorting and filtering. List underneath does what List is for: SetSelectionMode, Select, keyboard and scrolling come from it and act on visible rows.
func NewTypedList ¶
func NewTypedList[T any](model ColumnModel[T], factory TypedFactory[T], rowHeight int) *TypedList[T]
NewTypedList returns a list over model whose rows the factory builds and fills; rowHeight is the uniform row height in pixels, zero to derive it from the first row.
func (*TypedList) AccessibleName ¶
func (n *TypedList) AccessibleName() string
AccessibleName returns the name SetAccessibleName set.
func (*TypedList) AddClass ¶
func (n *TypedList) AddClass(names ...string)
AddClass adds style classes; a widget matches `.class` selectors naming any of them. Adding a class already present is a no-op. The change restyles the widget (and, when a selector tests the class on an ancestor or sibling, the widgets that depend on it) on the next read.
func (*TypedList[T]) AddFilter ¶
func (l *TypedList[T]) AddFilter(keep func(T) bool) *ViewFilter[T]
AddFilter appends a filter to the stack and returns its handle; every enabled filter must accept an item for it to show.
func (*TypedList) AttachStylesheet ¶
func (n *TypedList) AttachStylesheet(s *Stylesheet)
AttachStylesheet applies s to this widget and its descendants, on top of the installed stylesheets (a tie at equal priority and specificity goes to the attached one). Attaching the same stylesheet twice is a no-op; one stylesheet can style many subtrees, and a Load restyles them all.
func (*TypedList) Bounds ¶
Bounds returns the last arranged rect. Before the first Arrange — and that includes a widget built but never put in a tree — it is the zero rect, a defined value, never a panic and never stale geometry.
func (*TypedList) Classes ¶
func (n *TypedList) Classes() []string
Classes returns a copy of the widget's classes.
func (*TypedList[T]) ClearFilters ¶
func (l *TypedList[T]) ClearFilters()
ClearFilters drops every filter.
func (*TypedList) DebugName ¶
func (n *TypedList) DebugName() string
DebugName returns the widget's debug name, empty when none is set.
func (*TypedList) DetachStylesheet ¶
func (n *TypedList) DetachStylesheet(s *Stylesheet)
DetachStylesheet stops s from styling this subtree; detaching one that is not attached is a no-op.
func (*TypedList) Element ¶
func (n *TypedList) Element() string
Element returns the element name the widget matches: the override set with SetElement, else the lowercased Go type name.
func (*TypedList) Enabled ¶
func (n *TypedList) Enabled() bool
Enabled reports the widget's own flag, NOT the effective state: a widget inside a disabled container still reads true here. Input paths and Paint must consult widget.IsEnabled, which folds the ancestors in.
func (*TypedList) HAlign ¶
func (n *TypedList) HAlign() Align
HAlign returns the horizontal placement.
func (*TypedList) HasState ¶
func (n *TypedList) HasState(flags StateFlags) bool
HasState reports whether every flag in flags is on.
func (*TypedList) HitLeaf ¶
HitLeaf is the leaf hit test every widget without children routes through: the widget itself inside its bounds, unless it is hidden or the pointer passes through it (pointer-events: none on it or an ancestor).
func (*TypedList) HoverWithin ¶
func (n *TypedList) HoverWithin() bool
HoverWithin reports whether the pointer is over the widget or a descendant.
func (*TypedList) ID ¶
func (n *TypedList) ID() string
ID returns the style id, empty when none is set.
func (*TypedList) InlineStyle ¶
func (n *TypedList) InlineStyle() string
InlineStyle returns the inline declarations as set.
func (*TypedList) Invalidate ¶
func (n *TypedList) Invalidate()
Invalidate schedules a repaint of the widget's arranged bounds. Call it after any state change that alters what Paint draws. Layout is untouched; mutations that change the wanted size need InvalidateLayout.
func (*TypedList) InvalidateLayout ¶
func (n *TypedList) InvalidateLayout()
InvalidateLayout drops the cached Measure result here and in every ancestor, so the next frame remeasures the affected branch only, and schedules a repaint of the bounds (a size change usually alters the painting too).
func (*TypedList) InvalidateRect ¶
InvalidateRect schedules a repaint of r, an arbitrary rect in root coordinates - for widgets that owe pixels outside their arranged bounds, such as a scrollbar strip beside a viewport. Unlike Invalidate it does not mark the arranged bounds themselves.
func (*TypedList[T]) ItemChanged ¶
ItemChanged rebinds the row showing source item i, when one is showing. The hook a TypedItems model reports an in-place edit through.
func (*TypedList) LayoutMotion ¶
func (n *TypedList) LayoutMotion() LayoutMotion
LayoutMotion returns the programmatic layout motion.
func (*TypedList) MaximumSize ¶
func (n *TypedList) MaximumSize() Size
MaximumSize returns the size cap (zero axes unbounded).
func (*TypedList) Parent ¶
func (n *TypedList) Parent() Widget
Parent returns the container that arranged this widget, or nil for the tree root.
func (*TypedList[T]) PopFilter ¶
func (l *TypedList[T]) PopFilter()
PopFilter drops the most recently added filter.
func (*TypedList[T]) Refresh ¶
func (l *TypedList[T]) Refresh()
Refresh re-reads the model: the order is rebuilt under the current sort and filters and the visible rows rebind. The hook a TypedItems model reports wholesale changes through.
func (*TypedList) RemoveAttr ¶
func (n *TypedList) RemoveAttr(name string)
RemoveAttr drops one data attribute; dropping one the widget does not carry is a no-op.
func (*TypedList) RemoveClass ¶
func (n *TypedList) RemoveClass(names ...string)
RemoveClass drops style classes; dropping one the widget does not carry is a no-op.
func (*TypedList) Select ¶
func (s *TypedList) Select(i int)
Select moves the selection to item i (clamped, -1 clears). In multiple mode it collapses the set to the one item (-1 clears it); in none mode it does nothing.
func (*TypedList) SelectAll ¶
func (s *TypedList) SelectAll()
SelectAll selects every item. It is the ctrl+a target through Router.SelectAll and does nothing outside multiple mode, where "all" is not a representable selection.
func (*TypedList) SelectRows ¶
func (s *TypedList) SelectRows(rows ...int)
SelectRows makes rows the multiple-mode selection (out-of-range rows are dropped) and notifies; outside multiple mode it does nothing.
func (*TypedList) Selected ¶
func (s *TypedList) Selected() int
Selected returns the selected item in single and browse mode; in multiple mode the anchor the last gesture or Select settled on, -1 when the set is empty. Selection reports the whole set.
func (*TypedList[T]) SelectedItem ¶
SelectedItem returns the selected item; in multiple mode the anchor the last gesture settled on, false when nothing is selected.
func (*TypedList[T]) SelectedItems ¶
func (l *TypedList[T]) SelectedItems() []T
SelectedItems returns the selection as items, in visible order.
func (*TypedList) Selection ¶
func (s *TypedList) Selection() []int
Selection returns the whole selected set, ascending; empty when nothing is selected.
func (*TypedList) SelectionMode ¶
func (s *TypedList) SelectionMode() SelectionMode
SelectionMode returns the current selection model.
func (*TypedList) SetAccessibleName ¶
func (n *TypedList) SetAccessibleName(name string)
SetAccessibleName names the widget for assistive technology, over its tooltip and the name its content gives it: an icon button's "Close", a page link's "Go to page 3". Empty restores those.
func (*TypedList) SetAttr ¶
func (n *TypedList) SetAttr(name, value string)
SetAttr sets one data attribute, the `[attr]` and `[attr=value]` selectors' subject — app-attached metadata, GTK has no analog. An empty name is a no-op; an empty value sets a present-but-empty attribute. The change restyles the widget and, conservatively, its subtree.
func (*TypedList) SetClasses ¶
func (n *TypedList) SetClasses(names ...string)
SetClasses replaces the class list wholesale — the GTK set_css_classes idiom for widgets whose modifiers are recomputed at once. Order is irrelevant to matching.
func (*TypedList) SetCursorName ¶
func (n *TypedList) SetCursorName(s string)
SetCursorName requests the pointer shape while hovered, an xcursor name ("pointer", "text" — what set_cursor_from_name takes); empty falls back to the widget default. A widget's own CursorName implementation outranks it.
func (*TypedList) SetDebugName ¶
func (n *TypedList) SetDebugName(name string)
SetDebugName labels the widget for the inspector: the tree dump and the overlay show it, so bug reports can point at "the save button" instead of "*widget.Button #3". Names are plain data: nothing in the toolkit reads them, and text or state updates never touch them.
func (*TypedList) SetElement ¶
func (n *TypedList) SetElement(name string)
SetElement overrides the element name the widget matches in stylesheets. The default is the widget's own type name lowercased; the app-level surfaces (dialog, popover, tooltip, toast) name themselves with this in their constructors.
func (*TypedList) SetEnabled ¶
func (n *TypedList) SetEnabled(enabled bool)
SetEnabled turns the widget's own interactivity on or off; every node-embedding widget inherits it. The zero state is enabled.
Propagation model (pinned): a container's flag does NOT rewrite its children's. Disable a Box and the whole subtree reads as disabled through widget.IsEnabled, the per-query ancestor walk — the same shape as IsInteractive. Per-query beats a recursive flag because it keeps every widget's own decision intact: re-enabling the container never resurrects a child the app disabled on purpose, and a child disabled after its container keeps its state when the container comes back. Each widget's own flag only ever changes through its own SetEnabled.
The flip invalidates self and — for containers that expose Children, which override this with invalidateTree — every descendant, so the muted paint lands on the next frame without a relayout: enabled state changes what Paint draws, never what Measure wants. The style marks go stale with the flags: :disabled rules may match now.
func (*TypedList[T]) SetFilterStatus ¶
func (l *TypedList[T]) SetFilterStatus(f *ViewFilter[T], on bool)
SetFilterStatus turns a filter AddFilter returned on or off without dropping it.
func (*TypedList) SetFocusOnClick ¶
func (n *TypedList) SetFocusOnClick(on bool)
SetFocusOnClick decides whether a press on the widget moves the keyboard focus to it (GTK's focus-on-click, on by default): a command palette's rows leave it in the search entry.
func (*TypedList) SetHAlign ¶
func (n *TypedList) SetHAlign(a Align)
SetHAlign places the widget horizontally inside the space its parent gives it, GTK's halign: AlignFill (the default) stretches it, the others keep its natural width at the start, center or end.
func (*TypedList) SetHExpand ¶
func (n *TypedList) SetHExpand(on bool)
SetHExpand says whether the widget wants extra horizontal space, GTK's hexpand: a row Box gives it a share of its leftover width. Unset, a widget wants it when a visible child does.
func (*TypedList) SetID ¶
func (n *TypedList) SetID(id string)
SetID sets the widget's style id, which `#id` selectors match. It is distinct from the accessible name: a11y names stay semantic text, not style hooks. Empty clears.
func (*TypedList) SetInlineStyle ¶
func (n *TypedList) SetInlineStyle(css string)
SetInlineStyle sets the widget's inline declarations — `color: red; --accent: #f80` — the widget-scoped provider GTK attaches per widget. They apply to this widget alone (custom properties then inherit into its subtree) at StylePriorityUser, with no specificity. Empty clears. Malformed declarations are skipped with a warning.
func (*TypedList) SetInlineStylePriority ¶
SetInlineStylePriority is SetInlineStyle at an explicit priority.
func (*TypedList) SetLayoutMotion ¶
func (n *TypedList) SetLayoutMotion(m LayoutMotion)
SetLayoutMotion animates the widget's moves and resizes on m: when layout puts it somewhere new, it springs there from where it was shown. Layout itself runs once, at the destination; the frames in between paint the laid-out widget translated to the spring's position and clipped to its size, so text never stretches. A widget inserted into an already shown parent grows in from no height.
func (*TypedList) SetMargin ¶
SetMargin sets the space kept clear around the widget inside its parent's allocation, GTK's margin-*. It adds to a stylesheet margin.
func (*TypedList) SetMaximumSize ¶
func (n *TypedList) SetMaximumSize(w, h int)
SetMaximumSize caps the widget's size, the typed max-width and max-height: a container never measures it larger than w x h (its border box) and holds a wider slot to it by its alignment, fill reading as start. What the content paints past the cap is clipped. A zero axis is unbounded; negative values are zero. The size request wins where the two cross, so equal values pin an exact size.
func (*TypedList[T]) SetModel ¶
func (l *TypedList[T]) SetModel(m ColumnModel[T])
SetModel replaces the data source, keeping the sort and the filters.
func (*TypedList) SetOnClickWithin ¶
func (n *TypedList) SetOnClickWithin(fn func())
SetOnClickWithin registers fn to hear a click (press and release on the same widget) anywhere in the widget that nothing nearer takes: GTK's GestureClick on a container. A button, entry or other clicking widget inside keeps its own clicks, so a card can open on a click and still hold a working close button. The nearest registered ancestor of the clicked widget hears it; nil unregisters.
func (*TypedList) SetOnFocusChanged ¶
func (n *TypedList) SetOnFocusChanged(fn func(focused bool))
SetOnFocusChanged registers fn to hear the widget gain or lose keyboard focus, however focus moved (a click elsewhere, Tab, a programmatic SetFocus, the window losing the focused widget): an entry that commits its text when the user leaves it. nil unregisters.
func (*TypedList) SetOnHoverWithin ¶
func (n *TypedList) SetOnHoverWithin(fn func(on bool))
SetOnHoverWithin registers fn to hear the pointer enter or leave the widget or any descendant (the :hover chain; GTK's motion controller on a container): a row that reveals its actions on hover whichever child the pointer is over. nil unregisters.
func (*TypedList) SetOnPointer ¶
func (n *TypedList) SetOnPointer(fn func(e PointerEvent) bool)
SetOnPointer registers fn to see every button press on the widget or a descendant that is not a control of its own (a button inside keeps its presses), any button with its click count and modifiers. A true return consumes the press: no click, focus move, context menu or drag follows. The nearest registered widget sees it first. nil unregisters.
func (*TypedList) SetOnScroll ¶
func (n *TypedList) SetOnScroll(fn func(e ScrollEvent) bool)
SetOnScroll registers fn to see the wheel steps over the widget or a descendant before any scroller between them; a true return consumes the step, false lets it scroll on. nil unregisters.
func (*TypedList) SetSelectionMode ¶
func (s *TypedList) SetSelectionMode(mode SelectionMode)
SetSelectionMode switches the selection model. Leaving multiple mode keeps the lowest selected item as the single selection (or clears it when the set was empty); entering it seeds the set with the current selection and anchors there. The change notification fires when the switch changes the set.
func (*TypedList) SetSharedElement ¶
func (n *TypedList) SetSharedElement(tag string)
SetSharedElement tags the widget as one end of a shared-element transition. A tag names one widget shown at a time: when a widget paints after another widget with its tag was shown in its stead - a stack page switch, a card opening into its detail view - it morphs out of the other: its bounds and corner radius travel from the other's to its own on a spring while the other's last rendering fades out and its own fades in, both scaled into the moving rounded shape, so fill, border and content blend across. Reduced motion cross-fades in place. An empty tag removes it.
func (*TypedList) SetSizeRequest ¶
func (n *TypedList) SetSizeRequest(w, h int)
SetSizeRequest sets the widget's minimum size, GTK's set_size_request: a container never measures it smaller than w x h (its border box: padding and border inside, margin outside). A zero axis leaves that axis to the widget; negative values are zero.
func (*TypedList[T]) SetSort ¶
SetSort orders the view by cmp (nil returns to the source order); equal items keep source order. The sort applies now and to every later rebuild, so items appended or inserted land where cmp puts them.
func (*TypedList) SetState ¶
func (n *TypedList) SetState(flags StateFlags, on bool)
SetState turns application-driven state flags on or off. The widget restyles when the set changed.
func (*TypedList) SetTooltip ¶
func (n *TypedList) SetTooltip(s string)
SetTooltip sets hover text shown after a dwell; empty clears it.
func (*TypedList) SetTooltipMarkup ¶
func (n *TypedList) SetTooltipMarkup(markup string)
SetTooltipMarkup sets a tooltip in RichLabel markup (bold, italic, links' look): the card renders it rich, while TooltipText - the accessible name - is its plain text. Markup ParseMarkup rejects shows literally.
func (*TypedList) SetVAlign ¶
func (n *TypedList) SetVAlign(a Align)
SetVAlign is SetHAlign for the vertical axis.
func (*TypedList) SetVExpand ¶
func (n *TypedList) SetVExpand(on bool)
SetVExpand is SetHExpand for vertical space.
func (*TypedList) SetVisible ¶
func (n *TypedList) SetVisible(visible bool)
SetVisible hides or shows the widget in its container's layout. An invisible widget measures and arranges to zero, paints nothing, and drops out of hit testing - the container's other children reclaim the space. State changes what the container does with the widget, so the parent relayouts.
func (*TypedList) SharedElement ¶
func (n *TypedList) SharedElement() string
SharedElement returns the widget's shared-element tag.
func (*TypedList) SizeRequest ¶
func (n *TypedList) SizeRequest() Size
SizeRequest returns the size request (zero axes unset).
func (*TypedList) TooltipMarkup ¶
TooltipMarkup returns the tooltip's markup and whether it was set as markup (TooltipMarkupper).
func (*TypedList) TooltipText ¶
func (n *TypedList) TooltipText() string
TooltipText returns the hover text, empty when none is set.
type Undoer ¶
Undoer is an editable widget with an undo history. Undo restores the state before the most recent edit, Redo reapplies the most recently undone one; both report whether anything changed.
type VariantFunc ¶
VariantFunc returns the face a bold or italic run shapes with. It must never return nil; returning the base face for a variant the platform lacks is the expected downgrade and renders fine.
func BaseVariants ¶
func BaseVariants(base *render.Typeface) VariantFunc
BaseVariants serves base for every style. Use it when only one face is loaded: markup bold and italic then render with the base face. lys-ui never synthesizes faux bold or italic outlines. Apps that load real variants wire them here, e.g. via internal/sysfont's Variant.
type Video ¶
type Video struct {
// contains filtered or unexported fields
}
Video is GTK's GtkVideo: a media.Stream's frames fitted into the bounds by the scale policy (ImageFit by default), with MediaControls along the bottom that show while the pointer is over the video or the stream is not playing. The Video does not own the stream; whoever made it closes it. It styles as `video`.
func NewVideo ¶
NewVideo returns a video showing stream (nil for none), its controls in face at sizePx.
func (*Video) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*Video) Children ¶
func (c *Video) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*Video) Controls ¶
func (v *Video) Controls() *MediaControls
Controls returns the video's MediaControls.
func (*Video) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*Video) SetAutoplay ¶
SetAutoplay plays every stream as soon as it is shown, the current one included.
func (*Video) SetScale ¶
func (v *Video) SetScale(s ImageScale)
SetScale selects how frames fill the bounds: ImageFit (the default), ImageCover, ImageStretch, ImageScaleDown or ImageNone.
type ViewFilter ¶
type ViewFilter[T any] struct { // contains filtered or unexported fields }
ViewFilter is one filter in a viewModel's stack: a predicate over items, on or off. AddFilter hands one out; SetFilterStatus toggles it without dropping it.
func (*ViewFilter[T]) Enabled ¶
func (f *ViewFilter[T]) Enabled() bool
Enabled reports whether the filter currently applies.
type ViewSwitcher ¶
type ViewSwitcher struct {
*ToggleGroup
// contains filtered or unexported fields
}
ViewSwitcher is a ToggleGroup bound to a Stack: one toggle per page (title, and an icon when given), the visible page's toggle active, activating a toggle showing its page - the adw pill for bottom bars and headers alike.
func NewViewSwitcher ¶
func NewViewSwitcher(face render.Font, sizePx float64, stack *Stack, titles, icons map[string]string) *ViewSwitcher
NewViewSwitcher returns a strip driving stack; titles names the pages (missing names fall back to the page names), icons is optional.
func (ViewSwitcher) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (ViewSwitcher) Children ¶
func (c ViewSwitcher) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (ViewSwitcher) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*ViewSwitcher) ReflectVisible ¶
func (v *ViewSwitcher) ReflectVisible()
ReflectVisible activates the visible page's toggle after a programmatic stack.Show (the app drives, the switcher shows).
func (*ViewSwitcher) SetPolicy ¶
func (v *ViewSwitcher) SetPolicy(p StackSwitcherPolicy)
SetPolicy changes what the toggles show and rebuilds.
func (*ViewSwitcher) Sync ¶
func (v *ViewSwitcher) Sync()
Sync rebuilds the toggles over the stack's pages (the stack has no signal: the app calls this after adding pages).
type Widget ¶
type Widget interface {
// Measure reports the widget's request along axis - its width for
// Row, its height for Column - given forSize, its extent across
// that axis, or Unknown: GTK's height-for-width measure. The
// request never depends on the room a parent will offer; the
// parent decides at Arrange (docs/architecture.md).
Measure(axis Axis, forSize int) Sizes
// Arrange assigns the widget's final pixel rect and recurses into
// children.
Arrange(r render.Rect)
// Paint draws the widget, honoring any clip already set on the
// canvas.
Paint(cv *render.Canvas)
// HitTest returns the deepest widget whose area contains p, or nil
// when p misses the tree below this widget.
HitTest(p Point) Widget
}
Widget is one node in the retained widget tree. Measure reports what a widget asks for, Arrange gives it its final rect, Paint draws it. A container measures its children where it arranges them, so a root needs only Arrange.
func AnchorWidget ¶
AnchorWidget is the widget a popup opened against anchor styles under, nil for a bare rect: the anchor itself, or the item a menubar's menu opens beneath.
func FocusRingOwner ¶
FocusRingOwner is the widget the focus ring of a focused w goes around: what w or its nearest claiming ancestor names, else w.
func HitChild ¶
HitChild hit-tests a container's child at p, PaintChild's counterpart: nil for a child hidden by SetVisible or display: none, whoever its container is, else the child's own HitTest. Containers defined outside the kit call it for their children too.
func StyleAnchor ¶
StyleAnchor is the widget w's tree is anchored to (SetStyleAnchor), nil when none.
type WindowControls ¶
type WindowControls struct {
// OnClose, OnMinimize, and OnMaximize fire for the corresponding
// button; the app wires them to its window.
OnClose func()
OnMinimize func()
OnMaximize func()
// contains filtered or unexported fields
}
WindowControls are the CSD frame buttons: close, minimize, maximize. Each is shown only when asked - the compositor's capabilities decide which an app offers - and each fires its hook on click.
func NewWindowControls ¶
func NewWindowControls(face render.Font, sizePx float64) *WindowControls
NewWindowControls returns a controls cluster with every button hidden; Show* turns them on.
func (*WindowControls) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*WindowControls) Baseline ¶
Baseline implements Baseliner: the root's, laid over the whole rect.
func (*WindowControls) Children ¶
func (c *WindowControls) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*WindowControls) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*WindowControls) ShowClose ¶
func (c *WindowControls) ShowClose(on bool)
ShowClose shows the close button (a cross), wired to OnClose.
func (*WindowControls) ShowMaximize ¶
func (c *WindowControls) ShowMaximize(on bool)
ShowMaximize shows the maximize button (a square), wired to OnMaximize.
func (*WindowControls) ShowMinimize ¶
func (c *WindowControls) ShowMinimize(on bool)
ShowMinimize shows the minimize button (an underscore), wired to OnMinimize.
func (*WindowControls) Shown ¶
func (c *WindowControls) Shown() (closeBtn, minimize, maximize bool)
Shown reports which buttons are shown.
type WindowDoubleClickable ¶
type WindowDoubleClickable interface {
// WindowDoubleClick fires on the second press inside the grab
// interval; the widget routes it where it wants (HeaderBar's
// OnDoubleClick hook).
WindowDoubleClick()
}
WindowDoubleClickable is the optional second half of WindowMover: a double press inside the grab area maximizes, GTK header style.
type WindowMover ¶
type WindowMover interface {
// WindowMoveGrab reports whether a press on the widget itself (not
// its children) should move the window.
WindowMoveGrab() bool
}
WindowMover is implemented by widgets whose background area is a drag handle for moving the window: a press that resolves into the widget (not a deeper control) starts the compositor's move grab. HeaderBar carries it; a stylesheet's custom header can too.
type WindowTitle ¶
type WindowTitle struct {
// contains filtered or unexported fields
}
WindowTitle is libadwaita's AdwWindowTitle: a title over a smaller, muted subtitle, centered in a header bar, each ellipsized; an empty subtitle takes no space. It styles as `windowtitle` with `.title` and `.subtitle` labels.
func NewWindowTitle ¶
func NewWindowTitle(face render.Font, sizePx float64, title, subtitle string) *WindowTitle
NewWindowTitle returns the title pair in face at sizePx, the subtitle a step smaller.
func (*WindowTitle) Arrange ¶
Arrange lays the root over the content box, as its parent: inside its margins and held to its CSS sizes, matching Measure.
func (*WindowTitle) Children ¶
func (c *WindowTitle) Children() []Widget
Children is the root, so focus traversal, the damage walk and the accessibility tree reach the widgets a composite is built from.
func (*WindowTitle) Measure ¶
Measure is the root's request inside the insets, its width pinned under fixedWidth and its height floored at minHeight.
func (*WindowTitle) SetSubtitle ¶
func (w *WindowTitle) SetSubtitle(s string)
SetSubtitle sets the subtitle; empty hides it.
func (*WindowTitle) Subtitle ¶
func (w *WindowTitle) Subtitle() string
Subtitle returns the subtitle.
Source Files
¶
- a11y.go
- accordion.go
- action.go
- actionrow.go
- adaptive.go
- adw.go
- adwaita.go
- alert.go
- animations.go
- assetload.go
- bar.go
- base.go
- baseline.go
- bell.go
- bgimage.go
- binding.go
- borderimage.go
- box.go
- breadcrumb.go
- button.go
- calendar.go
- card.go
- caretblink.go
- centerbox.go
- chart.go
- chip.go
- chrome.go
- codeview.go
- colorchooser.go
- colorswatch.go
- columnview.go
- combobox.go
- command.go
- completion.go
- composite.go
- containers.go
- contextmenu.go
- controlrows.go
- cssbox.go
- cssflex.go
- cssflow.go
- cssgrid.go
- csspos.go
- csssize.go
- damage.go
- datatable.go
- date.go
- datepicker.go
- debug.go
- departure.go
- depthstack.go
- dialogbuttons.go
- direction.go
- display.go
- dragstack.go
- drawingarea.go
- drawsurface.go
- dropdown.go
- echo.go
- editablelabel.go
- effects.go
- entry.go
- expander.go
- eyedrop.go
- face.go
- fader.go
- field.go
- filechooser.go
- fixed.go
- floatingpanel.go
- flowbox.go
- fontfallback.go
- form.go
- frame.go
- fuzzy.go
- gesture.go
- gpuarea.go
- grid.go
- gridview.go
- hovercard.go
- icon.go
- iconscale.go
- image.go
- image_anim.go
- ime.go
- input.go
- inputgroup.go
- inputotp.go
- inscription.go
- interaction.go
- item.go
- kinetic.go
- label.go
- labelcolor.go
- layers.go
- layoutmotion.go
- layoutprops.go
- levelbar.go
- list.go
- listbox.go
- loop.go
- markup.go
- measure.go
- measuretrace.go
- mediacontrols.go
- menu.go
- menubar.go
- menustack.go
- message.go
- meter.go
- morph.go
- navigation.go
- navmenu.go
- notebook.go
- opacity.go
- owner.go
- pagination.go
- paintink.go
- pan.go
- paned.go
- pango.go
- pile.go
- pointerhook.go
- prefs.go
- prefsview.go
- progressbar.go
- progressring.go
- radio.go
- reveal.go
- revealer.go
- richlabel.go
- scrollbar.go
- scrollcss.go
- scrollshift.go
- search.go
- segmentdrop.go
- selection.go
- separator.go
- shadow.go
- shared.go
- sheet.go
- shortcuts.go
- sidebar.go
- slider.go
- spin.go
- spinner.go
- style.go
- stylepart.go
- surfacehost.go
- swipedismiss.go
- symbol.go
- tabbar.go
- tabview.go
- textapi.go
- textarea.go
- theme.go
- thread.go
- toast.go
- toggle.go
- toolbarview.go
- tooltipcard.go
- touch.go
- transition.go
- tree.go
- typeahead.go
- typedview.go
- undo.go
- video.go
- widget.go
- windowtitle.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package css names libadwaita's style classes and named colors - the relm4-css analog (#95) - so application code spells them as constants and stylesheets written for GTK port over verbatim:
|
Package css names libadwaita's style classes and named colors - the relm4-css analog (#95) - so application code spells them as constants and stylesheets written for GTK port over verbatim: |