Documentation
¶
Overview ¶
Package giode is a UI library built on Gio that brings the ease of retained-mode APIs to immediate mode: interfaces are described with simple composable functions, styled with CSS-like properties and wired up with plain Go callbacks, while raw Gio remains fully available for low-level customization.
The package re-exports the public API of its subpackages (styles/properties, elements, components, router) for single-import ergonomics; the subpackages remain importable directly.
The re-exports live in package ui, which a custom host (a GLFW window, see docs/low-level.md) imports instead to get the same names without App and Gio's window layer; reexport.go is generated from it.
Index ¶
- Constants
- Variables
- func BoldText() bool
- func ContextActionCLSID(prefix, id string) string
- func DragAccept[T any]() func(payload any) bool
- func DragPayload[T any](payload any) (T, bool)
- func EncodeWAV(samples []float32, sampleRate int) []byte
- func Haptic(k HapticKind)
- func HighContrast() bool
- func InsertItem[T any](s []T, i int, v T) []T
- func IsElevated() bool
- func Keyed[T any](scope, key any, init func() T) T
- func LaunchedAtLogin() bool
- func MoveItem[T any](s []T, from, to int) int
- func ReducedMotion() bool
- func RemoveItem[T any](s []T, i int) []T
- func SafeArea() properties.Inset
- func SystemBoldText() (bool, error)
- func SystemDarkMode() (bool, error)
- func SystemHighContrast() (bool, error)
- func SystemReducedMotion() (bool, error)
- func SystemTextScale() (float32, error)
- func TraySupported() bool
- type AccordionElement
- type Align
- type App
- func (a *App) AlwaysOnTop() bool
- func (a *App) Auth(p auth.Provider) *auth.Session
- func (a *App) Center()
- func (a *App) Close()
- func (a *App) CloseToTray() bool
- func (a *App) ContextActions() []ContextAction
- func (a *App) CreatePasskey(ctx context.Context, options []byte) ([]byte, error)
- func (a *App) Dictate(ctx context.Context, lang string) (<-chan Transcript, error)
- func (a *App) FileDrag() (d FileDrag, ok bool)
- func (a *App) Focused() bool
- func (a *App) Frame() (Rect, error)
- func (a *App) FrameStats() FrameStats
- func (a *App) Fullscreen() bool
- func (a *App) Haptic(k HapticKind)
- func (a *App) HideKeyboard()
- func (a *App) HideWindow()
- func (a *App) InstallContextActions() error
- func (a *App) Invalidate()
- func (a *App) KeepAlive(reason string) (release func(), err error)
- func (a *App) KeepScreenOn(on bool) error
- func (a *App) LaunchAtLogin() bool
- func (a *App) MCPAddress() string
- func (a *App) MCPServer() *mcp.Server
- func (a *App) MCPTool(t mcp.Tool)
- func (a *App) MaxFPS() int
- func (a *App) Maximize()
- func (a *App) Maximized() bool
- func (a *App) Minimize()
- func (a *App) MinimizeToTray() bool
- func (a *App) MoveTo(c Corner, margin float32) error
- func (a *App) NativeHandle() uintptr
- func (a *App) NativeView() app.ViewEvent
- func (a *App) Notify(title, body string) error
- func (a *App) OpenDownloads(ctx context.Context, folder string) error
- func (a *App) OpenFile(ctx context.Context, filter ...FileFilter) (io.ReadCloser, error)
- func (a *App) OpenFiles(ctx context.Context, filter ...FileFilter) ([]io.ReadCloser, error)
- func (a *App) OpenFolder(ctx context.Context, path string) error
- func (a *App) OpenPortal(opts PortalOptions, view func() Element) *PortalWindow
- func (a *App) OpenURL(ctx context.Context, rawURL string) error
- func (a *App) OpenWith(ctx context.Context, path string) error
- func (a *App) PickFiles(ctx context.Context, opts PickOptions) ([]PickedFile, error)
- func (a *App) PickFolder(ctx context.Context, opts FolderOptions) (string, error)
- func (a *App) PickMedia(ctx context.Context, opts MediaOptions) ([]PickedFile, error)
- func (a *App) PickPhoto(ctx context.Context, opts PhotoOptions) (PickedFile, error)
- func (a *App) PickPhotos(ctx context.Context, opts PhotoOptions, limit int) ([]PickedFile, error)
- func (a *App) PlaySound(wav []byte) error
- func (a *App) Portals() []*PortalWindow
- func (a *App) Post(fn func())
- func (a *App) Quit()
- func (a *App) Raise()
- func (a *App) ReadClipboard(fn func(text string))
- func (a *App) ReadClipboardImage(ctx context.Context) (image.Image, error)
- func (a *App) RequestClose()
- func (a *App) RequestNotificationPermission(ctx context.Context) (bool, error)
- func (a *App) ResetFrameStats()
- func (a *App) RestartElevated(args ...string) error
- func (a *App) Run(view func() Element) error
- func (a *App) RunOnUI(ctx context.Context, fn func()) error
- func (a *App) RunRaw(view func(gtx layout.Context) layout.Dimensions) error
- func (a *App) SaveFile(ctx context.Context, name string) (io.WriteCloser, error)
- func (a *App) SaveToDownloads(ctx context.Context, path, folder string) (string, error)
- func (a *App) SaveToPhotos(ctx context.Context, path, album string) error
- func (a *App) Screen() (Screen, error)
- func (a *App) SetAlwaysOnTop(on bool)
- func (a *App) SetBoldText(p Preference)
- func (a *App) SetClipboard(text string)
- func (a *App) SetCloseToTray(on bool)
- func (a *App) SetContextMenu(m *menu.Menu)
- func (a *App) SetContrast(p Preference)
- func (a *App) SetFullscreen(v bool)
- func (a *App) SetLaunchAtLogin(on bool) error
- func (a *App) SetMaxFPS(fps int)
- func (a *App) SetMenuBar(menus ...MenuBarMenu)
- func (a *App) SetMinimizeToTray(on bool)
- func (a *App) SetMotion(p MotionPreference)
- func (a *App) SetPosition(x, y float32) error
- func (a *App) SetSize(w, h int)
- func (a *App) SetTextScale(scale float32)
- func (a *App) SetTitle(title string)
- func (a *App) Share(ctx context.Context, item Shareable) error
- func (a *App) ShowWindow()
- func (a *App) SignInWithPasskey(ctx context.Context, options []byte) ([]byte, error)
- func (a *App) TextScale() float32
- func (a *App) Title() string
- func (a *App) ToggleMaximize()
- func (a *App) Tray() *Tray
- func (a *App) UninstallContextActions() error
- func (a *App) Unmaximize()
- func (a *App) Window() *app.Window
- func (a *App) WindowState() WindowState
- func (a *App) WindowVisible() bool
- type AppShellConfig
- type AppShellSlot
- type AutofillKind
- type AvatarElement
- type BackgroundFit
- type BackgroundImage
- type BadgeElement
- type BoxElement
- type BoxShadow
- type Breakpoint
- type ButtonElement
- type ButtonVariant
- type CalendarEvent
- type CalendarMode
- type CalendarViewElement
- type CanvasPath
- type ChartAxis
- type ChartBand
- type ChartElement
- type ChartKind
- type ChartLegend
- type ChartPoint
- type ChartSeries
- type CheckState
- type ChipElement
- type ClickEvent
- type ClickSource
- type Color
- type ColorStop
- type ComboOption
- type ComboSource
- type ComboboxElement
- type ComboboxList
- type CommandPaletteElement
- type Config
- type Constraints
- type Context
- type ContextAction
- type ContextMenu
- type Contextual
- type CopyButtonElement
- type Corner
- type Corners
- type Cursor
- type DataGridColumn
- type DataGridColumnLayout
- type DataGridEditorKind
- type DataGridElement
- type DataGridExportFormat
- type DataGridFilter
- type DataGridFilterer
- type DataGridKeyer
- type DataGridLayout
- type DataGridLoader
- type DataGridSliceSource
- type DataGridSortKey
- type DataGridSorter
- type DataGridSource
- type DateCalendarElement
- type DatePickerElement
- type DateRangePickerElement
- type DateTimeFieldElement
- type Detent
- type DeviceClass
- type DeviceInfo
- type DialogElement
- type Dimensions
- type Display
- type DividerElement
- type DocTab
- type DocTabsElement
- type DragAxis
- type DragEvent
- type DragExportData
- type DragResult
- type DragSourceStyle
- type DragState
- type DraggableElement
- type DrawerElement
- type DropEvent
- type DropState
- type DropTargetElement
- type DroppedFiles
- type Easing
- type Element
- type Emoji
- type EmojiPickerElement
- type ExpandState
- type FileDrag
- type FileDragKind
- type FileFilter
- type Fit
- type FlexDirection
- type FolderOptions
- type FontFile
- type FontStyle
- type FontWeight
- type FrameStats
- type FrameTiming
- type GPUAPI
- type GPUTarget
- type HapticKind
- type IconButtonElement
- type IconButtonVariant
- type IconDocument
- type IconPath
- type IconRegistry
- type IconSource
- type IconVGIcon
- type ImageElement
- type InputAPI
- type Inset
- type IntlOptions
- type Justify
- type KeyEvent
- type KeyModifiers
- type KeyName
- type KeyShortcut
- type KeyState
- type Keyboard
- type KeyboardInputElement
- type KeyedCache
- type Keyframe
- type KeyframeAnimation
- type Landmark
- type LazyAlign
- type LazyAnchor
- type LazyListElement
- type License
- type LicensesElement
- type LinearGradient
- type LiveMode
- type LogLevel
- type Logger
- type MCPOptions
- type MarkdownOptions
- type MaxLines
- type MediaOptions
- type MemoCache
- type MentionsElement
- type MenuBarItem
- type MenuBarMenu
- type MenuElement
- type MenuItem
- type MenuRole
- type Mode
- type MotionPreference
- type MouseButton
- type MultiSelectElement
- type NamedKey
- type Orientation
- type OutOfFlow
- type Overflow
- type PaginationElement
- type Painter
- type Palette
- type PaletteCommand
- type PhotoOptions
- type PhotoSource
- type PickOptions
- type PickedFile
- type Placement
- type Platform
- type PlatformViews
- type PortalFrame
- type PortalOptions
- type PortalWindow
- func (w *PortalWindow) Close()
- func (w *PortalWindow) Closed() bool
- func (w *PortalWindow) Focused() bool
- func (w *PortalWindow) Invalidate()
- func (w *PortalWindow) Maximized() bool
- func (w *PortalWindow) Minimize()
- func (w *PortalWindow) Raise()
- func (w *PortalWindow) SetTitle(title string)
- func (w *PortalWindow) Title() string
- func (w *PortalWindow) ToggleMaximize()
- func (w *PortalWindow) Window() *app.Window
- type Position
- type Preference
- type PressState
- type PressableElement
- type ProgressElement
- type RawFunc
- type Rect
- type Renderer
- type RichEditorElement
- type RichSubmitMode
- type RichSuggester
- type RichSuggestion
- type RichTextElement
- type RichTextSpan
- type Route
- type Router
- type Screen
- type ScrollAlign
- type ScrollAnchor
- type ScrollAxis
- type ScrollBar
- type SecureStorage
- type SemanticContainer
- type SemanticKind
- type SemanticNode
- type ShareFile
- type ShareFiles
- type ShareText
- type Shareable
- type SharedContent
- type SheetElement
- type SheetMode
- type Side
- type SingleInstanceLock
- type SkipLinkElement
- type SpinnerElement
- type StartInTray
- type State
- type StyleTransition
- type Styles
- type SubmitMode
- type SwipeAction
- type SwipeableElement
- type Tab
- type TabWidth
- type TabsElement
- type TerminalElement
- type TerminalPalette
- type TextAlign
- type TextAnchor
- type TextDecoration
- type TextElement
- type TextOverflow
- type TextTransform
- type TimeOfDay
- type TimePickerElement
- type TitleBarButton
- type TitleBarElement
- type TitleBarPlacement
- type TitleBarVariant
- type TitleBarWindow
- type ToastKind
- type ToastPlacement
- type ToasterElement
- type TooltipElement
- type Transcript
- type Transform
- type TransitionElement
- type TransitionKind
- type Tray
- type TrayItem
- type TreeNode
- type TreeRowState
- type TreeViewElement
- type VirtualListElement
- type Visibility
- type Watch
- type WindowStartState
- type WindowState
- type Wrap
- type ZoomElement
Constants ¶
const ( SemanticText = ui.SemanticText SemanticButton = ui.SemanticButton SemanticInput = ui.SemanticInput SemanticCheckbox = ui.SemanticCheckbox SemanticSlider = ui.SemanticSlider SemanticSelect = ui.SemanticSelect SemanticTab = ui.SemanticTab SemanticMenuItem = ui.SemanticMenuItem SemanticLink = ui.SemanticLink SemanticImage = ui.SemanticImage SemanticScroll = ui.SemanticScroll SemanticCustom = ui.SemanticCustom SemanticHeading = ui.SemanticHeading SemanticSwitch = ui.SemanticSwitch SemanticRadio = ui.SemanticRadio SemanticProgress = ui.SemanticProgress SemanticGroup = ui.SemanticGroup SemanticList = ui.SemanticList SemanticListItem = ui.SemanticListItem SemanticTable = ui.SemanticTable SemanticRow = ui.SemanticRow SemanticCell = ui.SemanticCell SemanticColumnHeader = ui.SemanticColumnHeader SemanticDialog = ui.SemanticDialog SemanticAlert = ui.SemanticAlert SemanticStatus = ui.SemanticStatus SemanticMenu = ui.SemanticMenu SemanticMenuBar = ui.SemanticMenuBar SemanticTabList = ui.SemanticTabList SemanticTabPanel = ui.SemanticTabPanel SemanticTree = ui.SemanticTree SemanticTreeItem = ui.SemanticTreeItem SemanticComboBox = ui.SemanticComboBox SemanticToolbar = ui.SemanticToolbar SemanticRegion = ui.SemanticRegion )
Semantic roles, for SemanticNode.Kind; see accessibility.md.
const ( NotCheckable = ui.NotCheckable Unchecked = ui.Unchecked Checked = ui.Checked Mixed = ui.Mixed NotExpandable = ui.NotExpandable Collapsed = ui.Collapsed Expanded = ui.Expanded LiveOff = ui.LiveOff LivePolite = ui.LivePolite LiveAssertive = ui.LiveAssertive )
Accessibility states (SemanticNode.Checked, Expanded, Live).
const ( // The platforms; combine them with |. PlatformLinux includes other // Unix desktops; PlatformDesktop is Windows, macOS and Linux, // PlatformMobile Android and iOS. PlatformWindows = ui.PlatformWindows PlatformMacOS = ui.PlatformMacOS PlatformLinux = ui.PlatformLinux PlatformAndroid = ui.PlatformAndroid PlatformIOS = ui.PlatformIOS PlatformWeb = ui.PlatformWeb PlatformDesktop = ui.PlatformDesktop PlatformMobile = ui.PlatformMobile // CurrentPlatform is the platform the app was built for: a // constant. CurrentPlatform = ui.CurrentPlatform )
const ( // DragSourceDim fades a dragged Draggable in its place (the // default), DragSourceHide leaves its space empty, DragSourceKeep // draws it as it is. DragSourceDim = ui.DragSourceDim DragSourceHide = ui.DragSourceHide DragSourceKeep = ui.DragSourceKeep // DragAxisVertical and DragAxisHorizontal: a list's axis // (DropTarget.List), or the one a preview keeps to // (Draggable.LockAxis). DragAxisBoth = ui.DragAxisBoth DragAxisVertical = ui.DragAxisVertical DragAxisHorizontal = ui.DragAxisHorizontal )
const ( VariantContained = ui.VariantContained VariantOutlined = ui.VariantOutlined VariantGhost = ui.VariantGhost IconButtonContained = ui.IconButtonContained IconButtonOutlined = ui.IconButtonOutlined IconButtonGhost = ui.IconButtonGhost )
const ( ChartLine = ui.ChartLine ChartArea = ui.ChartArea ChartBar = ui.ChartBar ChartHorizontalBar = ui.ChartHorizontalBar ChartScatter = ui.ChartScatter ChartPie = ui.ChartPie ChartDonut = ui.ChartDonut ChartFunnel = ui.ChartFunnel ChartGauge = ui.ChartGauge ChartHeatmap = ui.ChartHeatmap )
Chart kinds.
const ( ChartLegendAuto = ui.ChartLegendAuto ChartLegendNone = ui.ChartLegendNone ChartLegendTop = ui.ChartLegendTop ChartLegendBottom = ui.ChartLegendBottom )
Chart legend positions.
const ( RichSubmitNone = ui.RichSubmitNone RichSubmitEnter = ui.RichSubmitEnter RichSubmitShortcut = ui.RichSubmitShortcut )
What Enter does in a RichEditor.
const ( CalendarMonth = ui.CalendarMonth CalendarWeek = ui.CalendarWeek CalendarDay = ui.CalendarDay CalendarAgenda = ui.CalendarAgenda )
const ( SheetNever = ui.SheetNever SheetCompact = ui.SheetCompact SheetAlways = ui.SheetAlways )
const ( Vertical = ui.Vertical Horizontal = ui.Horizontal AnchorTop = ui.AnchorTop AnchorBottom = ui.AnchorBottom )
const ( SubmitDefault = ui.SubmitDefault SubmitEnter = ui.SubmitEnter SubmitEnterUnlessShift = ui.SubmitEnterUnlessShift SubmitNever = ui.SubmitNever )
const ( DetentFit = ui.DetentFit DetentMedium = ui.DetentMedium DetentLarge = ui.DetentLarge )
const ( KeyboardText = ui.KeyboardText KeyboardNumeric = ui.KeyboardNumeric KeyboardEmail = ui.KeyboardEmail KeyboardURL = ui.KeyboardURL KeyboardPhone = ui.KeyboardPhone )
const ( SideLeft = ui.SideLeft SideRight = ui.SideRight // SideStart and SideEnd follow the reading direction: left and // right, swapped in a right-to-left locale. SideStart = ui.SideStart SideEnd = ui.SideEnd )
const ( ModeLight = ui.ModeLight ModeDark = ui.ModeDark )
const ( TitleBarWindows = ui.TitleBarWindows TitleBarMac = ui.TitleBarMac TitleBarMinimize = ui.TitleBarMinimize TitleBarMaximize = ui.TitleBarMaximize TitleBarClose = ui.TitleBarClose // Where the title goes; see TitleBar.TitlePlacement. TitleBarTitleAuto = ui.TitleBarTitleAuto TitleBarTitleStart = ui.TitleBarTitleStart TitleBarTitleCenter = ui.TitleBarTitleCenter )
const ( ToastInfo = ui.ToastInfo ToastSuccess = ui.ToastSuccess ToastWarning = ui.ToastWarning ToastError = ui.ToastError ToastBottomRight = ui.ToastBottomRight ToastBottomLeft = ui.ToastBottomLeft ToastBottomCenter = ui.ToastBottomCenter ToastTopRight = ui.ToastTopRight ToastTopLeft = ui.ToastTopLeft ToastTopCenter = ui.ToastTopCenter // ToastBottomEnd (the default), ToastBottomStart, ToastTopEnd and // ToastTopStart follow the reading direction. ToastBottomEnd = ui.ToastBottomEnd ToastBottomStart = ui.ToastBottomStart ToastTopEnd = ui.ToastTopEnd ToastTopStart = ui.ToastTopStart )
const ( // PlaceAuto puts it below the trigger, or above when it doesn't fit. PlaceAuto = ui.PlaceAuto PlaceBelow = ui.PlaceBelow PlaceAbove = ui.PlaceAbove )
const ( ScrollAlignNearest = ui.ScrollAlignNearest ScrollAlignStart = ui.ScrollAlignStart ScrollAlignCenter = ui.ScrollAlignCenter ScrollAlignEnd = ui.ScrollAlignEnd )
const ( LazyAnchorTop = ui.LazyAnchorTop LazyAnchorBottom = ui.LazyAnchorBottom LazyAlignStart = ui.LazyAlignStart LazyAlignCenter = ui.LazyAlignCenter LazyAlignEnd = ui.LazyAlignEnd )
const ( Fade = ui.Fade SlideUp = ui.SlideUp SlideDown = ui.SlideDown SlideLeft = ui.SlideLeft SlideRight = ui.SlideRight Enlarge = ui.Enlarge Shrink = ui.Shrink Rotate = ui.Rotate Collapse = ui.Collapse CollapseWidth = ui.CollapseWidth FadeUp = ui.FadeUp Zoom = ui.Zoom Pop = ui.Pop TransitionFast = ui.TransitionFast TransitionNormal = ui.TransitionNormal TransitionSlow = ui.TransitionSlow )
const ( FlexDirectionRow = ui.FlexDirectionRow FlexDirectionColumn = ui.FlexDirectionColumn WrapNoWrap = ui.WrapNoWrap WrapWrap = ui.WrapWrap AlignStart = ui.AlignStart AlignCenter = ui.AlignCenter AlignEnd = ui.AlignEnd AlignStretch = ui.AlignStretch // AlignBaseline lines a row's children up on their baselines. AlignBaseline = ui.AlignBaseline JustifyStart = ui.JustifyStart JustifyCenter = ui.JustifyCenter JustifyEnd = ui.JustifyEnd JustifySpaceBetween = ui.JustifySpaceBetween JustifySpaceAround = ui.JustifySpaceAround JustifySpaceEvenly = ui.JustifySpaceEvenly TextAlignStart = ui.TextAlignStart TextAlignCenter = ui.TextAlignCenter TextAlignEnd = ui.TextAlignEnd FontWeightThin = ui.FontWeightThin FontWeightExtraLight = ui.FontWeightExtraLight FontWeightLight = ui.FontWeightLight FontWeightNormal = ui.FontWeightNormal FontWeightMedium = ui.FontWeightMedium FontWeightSemiBold = ui.FontWeightSemiBold FontWeightBold = ui.FontWeightBold FontWeightExtraBold = ui.FontWeightExtraBold FontWeightBlack = ui.FontWeightBlack FontStyleNormal = ui.FontStyleNormal FontStyleItalic = ui.FontStyleItalic CursorDefault = ui.CursorDefault CursorNone = ui.CursorNone CursorText = ui.CursorText CursorPointer = ui.CursorPointer CursorCrosshair = ui.CursorCrosshair CursorGrab = ui.CursorGrab CursorGrabbing = ui.CursorGrabbing CursorNotAllowed = ui.CursorNotAllowed CursorWait = ui.CursorWait CursorProgress = ui.CursorProgress CursorMove = ui.CursorMove CursorVertical = ui.CursorVertical CursorColResize = ui.CursorColResize CursorRowResize = ui.CursorRowResize CursorEWResize = ui.CursorEWResize CursorNSResize = ui.CursorNSResize CursorNESWResize = ui.CursorNESWResize CursorNWSEResize = ui.CursorNWSEResize CursorNResize = ui.CursorNResize CursorSResize = ui.CursorSResize CursorEResize = ui.CursorEResize CursorWResize = ui.CursorWResize CursorNEResize = ui.CursorNEResize CursorNWResize = ui.CursorNWResize CursorSEResize = ui.CursorSEResize CursorSWResize = ui.CursorSWResize FitNone = ui.FitNone FitContain = ui.FitContain FitCover = ui.FitCover FitStretch = ui.FitStretch PositionStatic = ui.PositionStatic PositionRelative = ui.PositionRelative PositionAbsolute = ui.PositionAbsolute // PositionSticky, PositionStickyStart and PositionStickyTopStart hold // a box at a Scroll's top, start or both edges when scrolled past. PositionSticky = ui.PositionSticky PositionStickyStart = ui.PositionStickyStart PositionStickyTopStart = ui.PositionStickyTopStart // Flush is an explicit zero offset for Top, Right, Bottom and Left, // whose zero value means unset: Bottom: giode.Flush pins a box to // the bottom edge. Flush = ui.Flush TextDecorationNone = ui.TextDecorationNone TextDecorationUnderline = ui.TextDecorationUnderline TextDecorationLineThrough = ui.TextDecorationLineThrough OverflowVisible = ui.OverflowVisible OverflowHidden = ui.OverflowHidden DisplayNone = ui.DisplayNone DisplayGrid = ui.DisplayGrid VisibilityVisible = ui.VisibilityVisible VisibilityHidden = ui.VisibilityHidden TextTransformNone = ui.TextTransformNone TextTransformUppercase = ui.TextTransformUppercase TextTransformLowercase = ui.TextTransformLowercase TextTransformCapitalize = ui.TextTransformCapitalize TextOverflowClip = ui.TextOverflowClip TextOverflowEllipsis = ui.TextOverflowEllipsis MousePrimary = ui.MousePrimary MouseSecondary = ui.MouseSecondary MouseMiddle = ui.MouseMiddle ClickPointer = ui.ClickPointer ClickKeyboard = ui.ClickKeyboard ClickProgrammatic = ui.ClickProgrammatic EaseInOut = ui.EaseInOut Ease = ui.Ease EaseLinear = ui.EaseLinear EaseIn = ui.EaseIn EaseOut = ui.EaseOut EaseOutBack = ui.EaseOutBack EaseInBack = ui.EaseInBack EaseOutBounce = ui.EaseOutBounce )
const ( TextAnchorTopLeft = ui.TextAnchorTopLeft TextAnchorTop = ui.TextAnchorTop TextAnchorTopRight = ui.TextAnchorTopRight TextAnchorLeft = ui.TextAnchorLeft TextAnchorCenter = ui.TextAnchorCenter TextAnchorRight = ui.TextAnchorRight TextAnchorBottomLeft = ui.TextAnchorBottomLeft TextAnchorBottom = ui.TextAnchorBottom TextAnchorBottomRight = ui.TextAnchorBottomRight )
The points of a text Painter.Text can put at (x, y).
const ( AutofillNone = ui.AutofillNone AutofillUsername = ui.AutofillUsername AutofillPassword = ui.AutofillPassword AutofillNewPassword = ui.AutofillNewPassword AutofillEmail = ui.AutofillEmail AutofillOneTimeCode = ui.AutofillOneTimeCode AutofillName = ui.AutofillName AutofillPhone = ui.AutofillPhone AutofillAddress = ui.AutofillAddress AutofillPostalCode = ui.AutofillPostalCode )
What a text field holds; see Input.Autofill.
const ( KeyPress = ui.KeyPress KeyRelease = ui.KeyRelease KeyModCtrl = ui.KeyModCtrl KeyModShift = ui.KeyModShift KeyModAlt = ui.KeyModAlt KeyModSuper = ui.KeyModSuper KeyModCommand = ui.KeyModCommand KeyLeft = ui.KeyLeft KeyRight = ui.KeyRight KeyUp = ui.KeyUp KeyDown = ui.KeyDown KeyReturn = ui.KeyReturn KeyEnter = ui.KeyEnter KeyEscape = ui.KeyEscape KeyHome = ui.KeyHome KeyEnd = ui.KeyEnd KeyBackspace = ui.KeyBackspace KeyDelete = ui.KeyDelete KeyPageUp = ui.KeyPageUp KeyPageDown = ui.KeyPageDown KeyTab = ui.KeyTab KeySpace = ui.KeySpace KeyCtrl = ui.KeyCtrl KeyShift = ui.KeyShift KeyAlt = ui.KeyAlt KeySuper = ui.KeySuper KeyCommand = ui.KeyCommand KeyBack = ui.KeyBack KeyF1 = ui.KeyF1 KeyF2 = ui.KeyF2 KeyF3 = ui.KeyF3 KeyF4 = ui.KeyF4 KeyF5 = ui.KeyF5 KeyF6 = ui.KeyF6 KeyF7 = ui.KeyF7 KeyF8 = ui.KeyF8 KeyF9 = ui.KeyF9 KeyF10 = ui.KeyF10 KeyF11 = ui.KeyF11 KeyF12 = ui.KeyF12 )
Key states, modifiers and the names of keys that aren't characters.
const OverlayMargin = ui.OverlayMargin
OverlayMargin is the default distance kept between an overlay and the window edges.
Variables ¶
var ( // Accessible lays an element out and adjusts the nodes it reports // to screen readers (a text as a heading); AccessibleGroup makes it // a container (a region, a list, a toolbar). Accessible = ui.Accessible AccessibleGroup = ui.AccessibleGroup // RecordSemantic reports a custom component's node; // BeginSemanticGroup starts a container around its content. RecordSemantic = ui.RecordSemantic BeginSemanticGroup = ui.BeginSemanticGroup )
var ( // ForgetKeyed drops a Keyed entry right away. ForgetKeyed = ui.ForgetKeyed // SetKeyedRetention sets how many frames Keyed entries survive // without being asked for. SetKeyedRetention = ui.SetKeyedRetention )
var ( Box = ui.Box // Keyframes returns a keyframe animation through frames, for // BoxElement.Animation. Keyframes = ui.Keyframes Row = ui.Row Stack = ui.Stack // Grid lays children out on a grid; see elements.Grid. Grid = ui.Grid // GridSpan places a grid's child across n tracks, wherever there's // room; GridCell from a 1-based track across span tracks. They go // in its GridColumn and GridRow. GridSpan = ui.GridSpan GridCell = ui.GridCell Text = ui.Text Raw = ui.Raw // Intl returns the translation of key in the app's locale with data // filled into its {placeholders}: a map, a struct or name, value // pairs; a "count" picks plural forms. Turn translations on with // Config.Intl. See i18n.Intl. Intl = ui.Intl // SetLocale switches the app's locale ("fa", "pt-BR"); the UI // redraws in it. SetLocale = ui.SetLocale // Locale returns the app's locale. Locale = ui.Locale // Locales lists the locales with messages loaded. Locales = ui.Locales // Canvas is an element drawn with a Painter: shapes, arcs, rings, // sectors and paths in dp; see elements.Canvas. Canvas = ui.Canvas Divider = ui.Divider // RichText lays out differently styled spans as one wrapping // paragraph; see elements.RichText. RichText = ui.RichText // Span is a run of text in a RichText; Link a tappable one. Span = ui.Span Link = ui.Link // SpanElement sets an element, such as an inline formula, in a // RichText's line; see elements.SpanElement. SpanElement = ui.SpanElement // Markdown renders Markdown as giode elements; see markdown.New. Markdown = ui.Markdown // MarkdownFetchImage loads images for MarkdownOptions.LoadImage: // URLs, data: URIs and files; see markdown.FetchImage. MarkdownFetchImage = ui.MarkdownFetchImage Responsive = ui.Responsive // ActiveBreakpoint returns the name of the breakpoint the innermost // enclosing Responsive matched. ActiveBreakpoint = ui.ActiveBreakpoint // Compact reports whether the innermost enclosing Responsive matched // a breakpoint named "compact". Compact = ui.Compact // HandleBack registers a handler for the system Back button for the // current frame; see elements.HandleBack. HandleBack = ui.HandleBack // OnKey registers, for this frame, a handler for the keys nothing // else took (app shortcuts); see elements.OnKey. OnKey = ui.OnKey // NoInset is an explicit zero Padding or Margin: an all-zero Inset // means unset (Merge keeps the base's, components use their default). NoInset = ui.NoInset // Shortcut returns a keyboard shortcut ("Mod+T", "Ctrl+Shift+P", // "F5") running action; Mod is Command on macOS, Ctrl elsewhere. // Register shortcuts with Shortcuts. See package shortcut. Shortcut = ui.Shortcut // FormatShortcut writes a shortcut spec the way this platform // shows it: "⇧⌘T" on macOS, "Ctrl+Shift+T" elsewhere. FormatShortcut = ui.FormatShortcut // TouchInput reports whether the user is interacting by touch. TouchInput = ui.TouchInput // Pressable makes any content clickable; its content is rebuilt // with the current PressState so it can restyle itself. Pressable = ui.Pressable // Memo caches the output of build under key, rebuilding only when // its deps, the States it reads, its constraints or the theme // change - see elements.MemoCache for the full rules. Memo = ui.Memo // SelectionArea makes the Text, RichText and Markdown inside its // child selectable as one, across elements, like a web page. SelectionArea = ui.SelectionArea // NewMemoCache returns a cache to hold in a stateful component. NewMemoCache = ui.NewMemoCache // InvalidateCaches forces every Memo to rebuild on the next frame. InvalidateCaches = ui.InvalidateCaches // AfterLayout runs a function once the current frame's layout is // done, on the UI goroutine - for handlers that change the model // the frame is still reading. AfterLayout = ui.AfterLayout // DisplayScale returns the display's pixels per dp as of the last // frame; DpToPx and PxToDp convert with it. Safe from anywhere. DisplayScale = ui.DisplayScale DpToPx = ui.DpToPx PxToDp = ui.PxToDp Table = ui.Table TableHeader = ui.TableHeader TableRow = ui.TableRow TableCell = ui.TableCell )
var ( Button = ui.Button // CopyButton copies text to the clipboard when clicked and briefly // shows a check mark. CopyButton = ui.CopyButton IconButton = ui.IconButton Tabs = ui.Tabs // DocTabs is a strip of document tabs the app adds, removes and // renames, with close buttons and unsaved dots; see doctabs.New. DocTabs = ui.DocTabs // DataGrid is a virtualized table for large data sets; see // datagrid.New. DataGrid = ui.DataGrid // NewLandmark returns a named region of the window - the main // content, the navigation - that skip links jump to and screen // readers move between; see skiplink.Landmark. NewLandmark = ui.NewLandmark // SkipLink is a link that shows only while keyboard-focused and // moves the focus into a Landmark; see skiplink.SkipLink. SkipLink = ui.SkipLink // OnlyOn shows what its builder makes on some platforms only, and // nothing elsewhere; see platform.OnlyOn. OnlyOn = ui.OnlyOn // ByPlatform shows the current platform's element of a // PlatformViews; see platform.ByPlatform. ByPlatform = ui.ByPlatform // IsPlatform reports whether the app runs on one of a set of // platforms. IsPlatform = ui.IsPlatform // Draggable is content that can be dragged to a DropTarget, // carrying a payload; see dnd.NewDraggable. Draggable = ui.Draggable // DropTarget is an area drags can be dropped on; see // dnd.NewDropTarget. DropTarget = ui.DropTarget // DropListItem makes an element item index of the innermost list // DropTarget, for its insertion slots; see dnd.ListItem. DropListItem = ui.DropListItem // Dragging reports whether a drag is in progress; CancelDrag ends // it. Dragging = ui.Dragging CancelDrag = ui.CancelDrag // CanDragOut reports whether drags can leave the window on this // platform (Draggable.Export). CanDragOut = ui.CanDragOut Scroll = ui.Scroll // Swipeable makes a row reveal actions when swiped sideways; see // swipeable.New. Swipeable = ui.Swipeable // Zoomable pinch-zooms and pans its content - a page, a photo, a // crop editor - with a double tap and Ctrl+wheel too; see zoom.New. Zoomable = ui.Zoomable // Sheet is a modal bottom sheet, or with Adaptive a centered // dialog on wide screens; see sheet.New. Sheet = ui.Sheet // Chip is a small rounded label for filters and tags; Badge a // counter or dot; Avatar a picture or initials in a circle. Chip = ui.Chip Badge = ui.Badge Avatar = ui.Avatar Drawer = ui.Drawer Dialog = ui.Dialog Menu = ui.Menu // MenuBar groups menus into a menu bar (File, Edit, View): once one // is open, moving onto another's trigger switches to it; see // menu.Bar. MenuBar = ui.MenuBar Progress = ui.Progress Spinner = ui.Spinner Image = ui.Image Tooltip = ui.Tooltip Accordion = ui.Accordion Pagination = ui.Pagination H1 = ui.H1 H2 = ui.H2 H3 = ui.H3 H4 = ui.H4 H5 = ui.H5 H6 = ui.H6 )
var ( // IconSVG renders raw SVG path data on a 24x24 viewBox. IconSVG = ui.IconSVG // IconSVGEvenOdd is IconSVG with fill-rule="evenodd": inner // subpaths cut holes whichever way they run. IconSVGEvenOdd = ui.IconSVGEvenOdd // IconSVGCustom renders raw SVG path data on a custom viewBox. IconSVGCustom = ui.IconSVGCustom // IconSVGStroke strokes raw SVG path data (outline icon sets). IconSVGStroke = ui.IconSVGStroke IconImage = ui.IconImage IconIconVG = ui.IconIconVG LoadIconVG = ui.LoadIconVG // LoadIconSVG parses a whole .svg file's bytes; call .Icon(st...) // on the result to render it. LoadIconSVG = ui.LoadIconSVG // MustLoadIconSVG is LoadIconSVG, panicking on error - convenient // for bytes known at compile time, e.g. via go:embed. MustLoadIconSVG = ui.MustLoadIconSVG // LoadIconSVGFile and LoadIconSVGFS read and parse an .svg file // from disk or from an fs.FS (such as an embed.FS). LoadIconSVGFile = ui.LoadIconSVGFile LoadIconSVGFS = ui.LoadIconSVGFS // RegisterIcon, RegisterIconSVG, RegisterIconsFS and // RegisterIconsDir add icons to the default registry; Icon renders // one by name. RegisterIcon = ui.RegisterIcon RegisterIconSVG = ui.RegisterIconSVG RegisterIconsFS = ui.RegisterIconsFS RegisterIconsDir = ui.RegisterIconsDir LookupIcon = ui.LookupIcon IconNames = ui.IconNames // Icon renders a registered icon; an unknown name renders as empty // space of the icon's size. Icon = ui.Icon )
Giode bundles no icon set: load the icons your app uses from SVG files (or path data, IconVG, images) and, optionally, register them by name.
var ( UseGofont = ui.UseGofont RegisterFonts = ui.RegisterFonts // RegisterFont adds TTF, OTF or TTC font files by family, weight // and style; see fonts.RegisterFont. RegisterFont = ui.RegisterFont // SetDefaultFont makes a registered family the font of all text // without a FontFamily, Giode's components included; see // fonts.SetDefaultFont and Config.Font. SetDefaultFont = ui.SetDefaultFont )
var ( HexColor = ui.HexColor // Mix blends two colors in sRGB space, like CSS; see properties.Mix. Mix = ui.Mix // ParseColor validates any CSS color (hex, rgb(), hsl(), named). ParseColor = ui.ParseColor // Linear builds a linear gradient for Styles.BackgroundGradient. Linear = ui.Linear UniformCorners = ui.UniformCorners TopCorners = ui.TopCorners BottomCorners = ui.BottomCorners UniformInset = ui.UniformInset SymmetricInset = ui.SymmetricInset )
var ( // SetMode switches the active color mode, changing what every // "theme.*" color token (e.g. Styles{Background: "theme.surface"}) // resolves to on the next frame. SetMode = ui.SetMode // CurrentMode returns the active color mode (ModeLight by // default). CurrentMode = ui.CurrentMode // SetPalette replaces the palette used for mode m, changing what // every "theme.*" color token resolves to while that mode is // active. Start from DefaultLightPalette/DefaultDarkPalette to // override just a few fields. SetPalette = ui.SetPalette // SetThemeColor names an app color for one mode: "theme.<name>" // resolves to it while that mode is active (see Palette.Custom). SetThemeColor = ui.SetThemeColor // ToggleMode switches between light and dark mode. ToggleMode = ui.ToggleMode // CurrentPalette returns the palette of the active mode. CurrentPalette = ui.CurrentPalette )
var ( DefaultLightPalette = ui.DefaultLightPalette DefaultDarkPalette = ui.DefaultDarkPalette )
DefaultLightPalette and DefaultDarkPalette are the built-in palettes for ModeLight/ModeDark, in effect until SetPalette overrides one of them.
var ( // AppShell returns a full-window layout: Header/Navbar/Aside/Footer // (each optional, via AppShellConfig) are fixed to their respective // edges, and Main fills the remaining space, offset by whichever of // them are present. AppShell = ui.AppShell // Header, Navbar, Aside and Footer build an AppShellConfig field - // AppShellConfig{Header: giode.Header(60, ...), ...}. Header = ui.Header Aside = ui.Aside // Main wraps an AppShell's main content area. Main = ui.Main // Section groups content inside a Navbar/Aside as a scrollable // area. Section = ui.Section )
var ( Scale = ui.Scale Hovered = ui.Hovered Pressed = ui.Pressed Alpha = ui.Alpha ClampPos = ui.ClampPos )
var ( // Combobox is a searchable field that picks one option, from a list // or an asynchronous source; see combobox.New. Combobox = ui.Combobox // MultiSelect picks several options as chips; with Creatable it's a // tag input. See combobox.NewMulti. MultiSelect = ui.MultiSelect // Mentions adds @-style suggestions at the caret of a text field; // see combobox.NewMentions. Mentions = ui.Mentions // CommandPalette is a Mod+K search over the app's commands; see // palette.New. CommandPalette = ui.CommandPalette // EmojiPicker is a searchable emoji grid with skin tones and // recents; see emojipicker.New. EmojiPicker = ui.EmojiPicker // FuzzyMatch scores a fuzzy match of query in s; see combobox.Match. FuzzyMatch = ui.FuzzyMatch )
var ( AppVersion string AppBuild string )
AppVersion and AppBuild are the app's version and build number from giode.toml (app.version, app.build): the giode CLI sets them when it builds or runs a desktop app (with -ldflags -X). They're empty in a plain go build.
var AppID string
AppID is the app's reverse-DNS ID from giode.toml (app.id): the giode CLI sets it when it builds a desktop app (with -ldflags -X), as it does AppVersion. Login registration names its entry after it; without it, after the window title.
var AppName string
AppName is the app's name from giode.toml (app.name), which the giode CLI builds in (as buildAppName, base64 encoded since names have spaces). The start-at-login entry shows it; without it, the window title is used.
var CalendarView = ui.CalendarView
CalendarView creates a calendar of events by month, week, day or agenda; see calendarview.CalendarView.
var Chart = ui.Chart
Chart creates a chart of a kind; see chart.Chart.
var ChartTimeX = ui.ChartTimeX
ChartTimeX converts a time to a ChartPoint X on a time axis.
var DateCalendar = ui.DateCalendar
DateCalendar creates a month calendar to pick a day or a range from; see datepicker.DateCalendar.
var ErrCanceled = platform.ErrCanceled
ErrCanceled is returned by OpenFile, OpenFiles and SaveFile when the user closes the dialog without choosing a file.
var ErrDeclined = platform.ErrDeclined
ErrDeclined is returned by RestartElevated when the user refuses the administrator prompt.
var ErrNotFound = platform.ErrNotFound
ErrNotFound is returned by SecureStore.Get for a name with no value.
var ErrNotSupported = host.ErrNotSupported
ErrNotSupported is returned by features the current platform lacks.
var ErrNotificationsOff = platform.ErrNotificationsOff
ErrNotificationsOff is returned by Notify when the user turned the app's notifications off (or didn't allow them).
var FormatNumber = ui.FormatNumber
FormatNumber writes a number compactly: 1.2k, 3.4M.
var Frame = ui.Frame
Frame lays out one frame of view into gtx the way App does, for a custom host (a GLFW window, an embedded view): it starts the frame, records the window size and metric, lays the view out, draws the portals (menus, tooltips, toasts), delivers the Back key and then the keys nothing took to OnKey handlers, runs the after-layout callbacks and ends the frame, sweeping keyed state and memos no longer used. gtx's constraints are the window's size.
It reports whether another frame is needed right away (a layout changed after the fact); the host should then redraw. Animations ask for frames through gtx as usual (op.InvalidateCmd, the router's wakeup time), and State changes and toasts shown from other goroutines through the function given to SetInvalidator.
The host fills the background, hands gtx.Ops to its GPU renderer and runs its input router, as in docs/low-level.md.
var Input = ui.Input
Input groups the form-control constructors that collect user input: Input.Text, Input.Checkbox, Input.Slider, Input.Select and Input.AutoComplete.
var KeyModShortcut = ui.KeyModShortcut
KeyModShortcut is Command on Apple platforms and Ctrl elsewhere.
var KeyboardInput = ui.KeyboardInput
KeyboardInput takes the keyboard for content the app draws itself - a terminal, a game, a canvas: it gets focus, the text typed (layout, dead keys and input methods applied) at OnText, and the other keys at OnKey, with Enter, Space and Tab passed on rather than activating anything. Create it once and lay it out every frame; see input.KeyboardInput.
term := giode.KeyboardInput(screen).
OnText(func(s string) { pty.Write([]byte(s)) }).
OnKey(func(e giode.KeyEvent) bool { return sendKey(pty, e) }).
Keyboard(giode.KeyboardText)
var LazyList = ui.LazyList
LazyList is a vertical list of rows of any height, identified by keys, that only builds the rows in or near the viewport. It keeps its place when rows above change, and can stick to the end like a chat:
list := giode.LazyList(
func() int { return len(msgs) },
func(i int) any { return msgs[i].ID },
func(i int) giode.Element { return messageRow(msgs[i]) },
).Anchor(giode.LazyAnchorBottom)
var LicensesView = ui.LicensesView
LicensesView lists the open-source licenses of the app's modules, from the JSON giode licenses writes; a row per module expands to its text.
var NewRouter = ui.NewRouter
var NoWindowDrag = ui.NoWindowDrag
NoWindowDrag keeps el, inside a WindowDragArea, from dragging the window, so a press on it reaches it.
var RichEditor = ui.RichEditor
RichEditor creates a rich text editor; see richedit.RichEditor. Its document model is package richdoc.
var SecureStore = &SecureStorage{}
SecureStore is the app's secure storage; see SecureStorage.
var SetInvalidator = ui.SetInvalidator
SetInvalidator registers fn, which wakes the host's loop for a new frame. It's called from any goroutine: when a State changes, a toast is shown from a background goroutine, or anything else outside a frame needs a redraw. App sets its own; a custom host sets one that wakes its event loop (glfw.PostEmptyEvent, a channel).
var Shortcuts = ui.Shortcuts
Shortcuts registers app-wide keyboard shortcuts for this frame: call it from the view every frame. They fire whatever has focus, unless the focused field (or anything else in the UI) takes the key first; see OnKey.
giode.Shortcuts(
giode.Shortcut("Mod+T", newTab),
giode.Shortcut("Mod+,", openSettings),
giode.Shortcut("F5", refresh),
)
var Sparkline = ui.Sparkline
Sparkline draws a small line of values without axes.
var Terminal = ui.Terminal
Terminal is a terminal: it runs a shell or any program in a pseudo-terminal (Start) or shows one the app connects (Attach and Write, for an SSH session), drawing its screen and taking the keyboard for it. Create it once and lay it out every frame; see package terminal.
term := giode.Terminal().OnExit(func(code int, err error) { closeTab() })
if err := term.Start(nil); err != nil { ... } // the user's shell
var TitleBar = ui.TitleBar
TitleBar returns a custom window title bar for a frameless window: a drag handle with the title, optional icon and menus, and minimize/maximize/close buttons. Pass the *App:
app := giode.New(giode.Config{Frameless: true, Resizable: true})
bar := giode.TitleBar(app, "My app")
var Toaster = ui.Toaster
Toaster shows small notifications in a corner of the window that disappear on their own. Lay it out once per frame anywhere; call Show from any goroutine.
var Transition = ui.Transition
Transition animates a component in and out. It takes the component, the effect (combine kinds with |), the duration and a CSS-style easing:
panel := giode.Transition(content, giode.FadeUp, giode.TransitionNormal, giode.EaseOut)
giode.Button("Toggle").OnClick(panel.Toggle)
var TreeView = ui.TreeView
TreeView is a virtualized, keyboard-navigable tree. It owns expansion and selection by key and draws indentation, arrows and selection; the row function draws only each node's content.
var VirtualList = ui.VirtualList
VirtualList is a vertical list of equal-height rows (height in dp) that only builds the rows in or near the viewport:
list := giode.VirtualList(func() int { return len(rows) }, 32,
func(i int) giode.Element { return rowView(rows[i]) })
var WatchKeys = ui.WatchKeys
WatchKeys registers fn, for this frame, to see every key press and release the app gets before anything acts on it - the modifier keys too, for a double Shift; see elements.WatchKeys. Call it from the view every frame, as with OnKey.
var WindowDragArea = ui.WindowDragArea
WindowDragArea makes content a handle that drags its window, like an OS title bar: for a frameless window or portal drawing its own chrome. On Windows it also maximizes on a double-click and snaps to screen edges. Wrap buttons inside it in NoWindowDrag so they stay clickable. TitleBar does both for you.
Functions ¶
func ContextActionCLSID ¶
ContextActionCLSID returns the COM class ID Explorer's DropTarget verb for a context action names, as "{XXXXXXXX-XXXX-...}": a name-based UUID (version 5) of "giode-context-action:" + prefix + "." + id.
func DragAccept ¶
DragAccept returns a DropTarget.Accept predicate for payloads of type T.
func DragPayload ¶
DragPayload returns a drop's payload as a T.
func EncodeWAV ¶
EncodeWAV returns a mono 16-bit WAV of samples, each from -1 to 1, at sampleRate per second - for PlaySound, with tones generated in code:
const rate = 44100
samples := make([]float32, rate/5) // 0.2 s
for i := range samples {
t := float64(i) / rate
fade := 1 - float64(i)/float64(len(samples))
samples[i] = float32(0.2 * fade * math.Sin(2*math.Pi*440*t))
}
app.PlaySound(giode.EncodeWAV(samples, rate))
func Haptic ¶
func Haptic(k HapticKind)
Haptic plays haptic feedback through the most recently created App; see App.Haptic.
func HighContrast ¶
func HighContrast() bool
HighContrast reports whether "theme.*" colors resolve against the high-contrast palette: the user asked the system for more contrast, or Config.Contrast or SetContrast said so.
func InsertItem ¶
InsertItem inserts v at slot i and returns the slice; RemoveItem removes s[i].
func IsElevated ¶
func IsElevated() bool
IsElevated reports whether the app runs with administrator rights: elevated by UAC on Windows, as root on Linux and macOS.
func Keyed ¶
Keyed returns the state stored under (scope, key), creating it with init the first time - persistent per-item state (a Pressable, a text field) for lists that change at runtime. Entries not asked for in a while are dropped, so removed items don't leak. Use stable keys (IDs), not indexes.
func LaunchedAtLogin ¶
func LaunchedAtLogin() bool
LaunchedAtLogin reports whether the system started the app when the user signed in, from a registration made with App.SetLaunchAtLogin - to start quietly, in the tray (see Config.StartInTray), rather than as if the user had opened it.
func MoveItem ¶
MoveItem moves s[from] to insertion slot to (a DropEvent's Index for a drop in its own list) and returns the index it lands at.
func ReducedMotion ¶
func ReducedMotion() bool
ReducedMotion reports whether animations finish at once: the user asked the system for less motion (Reduce Motion on macOS and iOS, "Show animations" off on Windows, "Remove animations" on Android, animations off on GNOME and KDE, prefers-reduced-motion on the web), or Config.Motion or SetMotion said so. Custom animations should check it.
func SafeArea ¶
func SafeArea() properties.Inset
SafeArea returns the parts of the window covered by system UI - the status bar, the navigation bar or home indicator, a notch or camera cutout, and on iOS the on-screen keyboard - as insets in dp, as of the last frame. Read it during layout.
By default giode lays the view out inside the safe area, so content never sits under system UI and this is only informative. With Config.EdgeToEdge the view covers the whole window and SafeArea is what to pad content with: a header's top, a composer's bottom.
On Android the window shrinks to make room for the on-screen keyboard, so content laid out above the bottom edge stays above the keyboard either way. On iOS, with the giode CLI's Gio patches, the window keeps its full height and the keyboard is the bottom inset: an edge-to-edge app pads its bottom with SafeArea().Bottom.
func SystemBoldText ¶
SystemBoldText reports the system's bold text setting, or ErrNotSupported where it can't be read.
func SystemDarkMode ¶
SystemDarkMode reports whether the platform is set to a dark appearance: on Android, iOS, macOS, Windows, the web, and Linux desktops that implement the XDG appearance setting (GNOME, KDE). Elsewhere it returns ErrNotSupported.
func SystemHighContrast ¶
SystemHighContrast reports the system's high contrast setting, or ErrNotSupported where it can't be read.
func SystemReducedMotion ¶
SystemReducedMotion reports the system's reduce-motion setting, or ErrNotSupported where it can't be read.
func SystemTextScale ¶
SystemTextScale reports the system's text size as a factor (1 is the default size), or ErrNotSupported where it can't be read.
func TraySupported ¶
func TraySupported() bool
TraySupported reports whether this platform has a system tray giode can use: Windows, macOS and Linux.
Types ¶
type AccordionElement ¶
type AccordionElement = ui.AccordionElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type App ¶
type App struct {
// contains filtered or unexported fields
}
App owns a window and its render loop.
func New ¶
New creates an App from cfg. The window is created and shown the first time the app runs.
func (*App) AlwaysOnTop ¶
AlwaysOnTop reports whether the window was set to stay above other windows, by Config.AlwaysOnTop or SetAlwaysOnTop.
func (*App) Auth ¶
Auth returns the app's sign-in session for p, the same one for every call with the same p.Name: sign in, keep tokens fresh and sign out with the platform's browser or sign-in sheet. See package auth.
google := app.Auth(auth.Google("1234.apps.googleusercontent.com"))
go func() {
tok, err := google.SignIn(ctx)
...
}()
Desktops redirect to a loopback address by default. On phones, Google providers default to the reversed client ID scheme (com.googleusercontent.apps.1234:/oauth2redirect); other providers need a RedirectURL with the app's scheme or app link, registered with the provider and in giode.toml. The redirect is handled before Config.OnOpenURL sees it.
Tokens are kept in SecureStore. Sessions' methods block on the network: call them off the UI goroutine.
func (*App) Close ¶
func (a *App) Close()
Close requests the window to close, ending the app - also with CloseToTray, which only applies to the user closing it.
It may be called from any goroutine: the close itself runs on the UI goroutine (Gio's Perform isn't safe elsewhere), which Post reaches even while the window is hidden.
func (*App) CloseToTray ¶
CloseToTray reports whether closing the window hides it to the tray.
func (*App) ContextActions ¶
func (a *App) ContextActions() []ContextAction
ContextActions returns the app's context actions: giode.toml's (through the giode CLI) and Config.ContextActions, which win by ID.
func (*App) CreatePasskey ¶
CreatePasskey registers a passkey for the signed-in user with the platform's passkey sheet: iCloud Keychain on iOS and macOS, Google Password Manager or another provider on Android 14 and later, Windows Hello or a security key on Windows.
options is the JSON of the server's registration options (PublicKeyCredentialCreationOptionsJSON, as SimpleWebAuthn's generateRegistrationOptions or go-webauthn's BeginRegistration return; a {"publicKey": ...} wrapper is fine). The result is the RegistrationResponseJSON to send back for verification.
It ends with auth.ErrCanceled when the user closes the sheet, and auth.ErrUnsupported where the platform has no passkeys (Linux, the web, Android before 14). The app must be associated with the relying party's domain; see docs/auth.md. Call it off the UI goroutine.
func (*App) Dictate ¶
Dictate listens through the microphone and transcribes speech, for a microphone button in a composer. Results arrive on the channel as the user speaks - each holds the whole transcript so far - and the channel closes after the Final one, which comes when the user stops speaking. Cancelling ctx stops listening early; a final result still follows.
It needs the github.com/xmhrnx/giode/dictate package imported (see it): the speech recognizer and microphone code live there, so apps that don't dictate don't carry them, nor face App Store questions about them. Without it Dictate returns an error wrapping ErrNotSupported.
It uses the platform's speech recognizer, asking for permission the first time: Android's SpeechRecognizer, and SFSpeechRecognizer on iOS (the app's Info.plist needs NSMicrophoneUsageDescription and NSSpeechRecognitionUsageDescription, ios.usage.microphone and ios.usage.speech in giode.toml, or it returns an error wrapping ErrNotSupported; see docs/platform.md). Elsewhere it returns ErrNotSupported. lang is a BCP 47 tag ("en-US"), or "" for the device's language.
func (*App) FileDrag ¶
FileDrag returns the drag of files over the window in progress, if any, as of the last FileDrag event: in a view, a drop zone can draw itself highlighted while ok is true. The window redraws when it changes. It needs OnFileDrop or OnFileDrag set.
func (*App) Frame ¶
Frame returns the window's area on the desktop in dp, its title bar and borders included. See Screen for where it's supported.
func (*App) FrameStats ¶
func (a *App) FrameStats() FrameStats
FrameStats returns how long the last frames (up to 240) took to build and to render, and the frame rate while frames followed each other. The built-in MCP server reports it as the frame_stats tool; Config.ShowFrameTimes shows it on screen. Safe to call from any goroutine.
func (*App) Fullscreen ¶
Fullscreen reports whether the window is fullscreen.
func (*App) Haptic ¶
func (a *App) Haptic(k HapticKind)
Haptic plays haptic feedback on the device: through the view's haptic feedback on Android (which follows the user's touch feedback setting) and the feedback generators on iOS. It returns at once and does nothing on platforms without haptics.
func (*App) HideKeyboard ¶
func (a *App) HideKeyboard()
HideKeyboard hides the on-screen keyboard and takes keyboard focus from the focused field, on the next frame. Safe to call from any goroutine.
func (*App) HideWindow ¶
func (a *App) HideWindow()
HideWindow hides the window without closing it: it leaves the screen and the taskbar or Dock, and ShowWindow brings it back as it was. With a tray icon it's how an app keeps running in the background. On Linux it works under X11; Wayland can't hide windows (nor bring a minimized one back), so there it does nothing, as on Android, iOS and the web. It may be called from any goroutine, as may ShowWindow and Quit.
func (*App) InstallContextActions ¶
InstallContextActions adds the app's context actions to the file manager's menu for the current user, pointing at the running executable; no administrator rights needed. Call it on first run (or from a setting) when the app isn't installed by its setup program. It replaces actions installed before, so it's safe to call on every start. On macOS the actions come from the app bundle instead, and it does nothing.
func (*App) Invalidate ¶
func (a *App) Invalidate()
Invalidate asks for a new frame. It's safe to call from any goroutine: an underlay's new video frame is ready, say.
func (*App) KeepAlive ¶
KeepAlive asks the system to keep the app running work it started - an agent run, a long download - until release is called:
- Desktops: the computer doesn't go to sleep while idle.
- iOS: the app gets the short grace period iOS allows after it leaves the screen (about 30 seconds), via beginBackgroundTask.
- Android: a foreground service keeps the app running after it leaves the screen, with an ongoing notification showing reason. Call it while the app is shown. The app's manifest must declare the service (see docs/platform.md), which gogio can't do yet; without it KeepAlive returns an error wrapping ErrNotSupported, so the app can tell the user to keep it open (with KeepScreenOn) or save its progress in OnBackground.
reason is shown where the platform shows one (Android's notification, Linux's inhibitor list, macOS's power assertions).
func (*App) KeepScreenOn ¶
KeepScreenOn keeps the screen from dimming and locking while on is set and the app is shown - for on-device generation the user is watching. On desktops it holds off the screen saver and display sleep.
func (*App) LaunchAtLogin ¶
LaunchAtLogin reports whether the app is registered to start when the user signs in (and, on Windows, the user hasn't turned it off).
func (*App) MCPAddress ¶
MCPAddress returns the address the MCP server listens on ("127.0.0.1:7600"), once it does; "" before that, without Config.MCP, or on stdio. With port 0 it's the port the system picked.
func (*App) MCPServer ¶
MCPServer returns the app's MCP server for full control, or nil when Config.MCP is off.
func (*App) MCPTool ¶
MCPTool registers a custom tool with the app's MCP server. Use mcp.Func to build one from a typed Go function:
app.MCPTool(mcp.Func("add_todo", "Adds a todo item.",
func(ctx context.Context, in struct {
Title string `json:"title" description:"The todo's title"`
}) (any, error) {
todos.Update(func(t []string) []string { return append(t, in.Title) })
return "added", nil
}))
Handlers run on server goroutines: touch the UI through State (which is safe from any goroutine) or App.RunOnUI. It's a no-op unless Config.MCP is set.
func (*App) MinimizeToTray ¶
MinimizeToTray reports whether minimizing the window hides it to the tray.
func (*App) MoveTo ¶
MoveTo moves the window to a corner of its screen's work area (or its center), margin dp from the edges - a mini player in the bottom right, say. Where it's supported is as for SetPosition.
func (*App) NativeHandle ¶
NativeHandle returns the native window handle: the HWND on Windows, the NSView on macOS, the X11 window ID or the wl_surface pointer on Linux, the android.view.View reference on Android. It is 0 until the window exists.
func (*App) NativeView ¶
NativeView returns the platform view event Gio reported for the window: an app.Win32ViewEvent on Windows, app.AppKitViewEvent on macOS, app.X11ViewEvent or app.WaylandViewEvent on Linux, ... It is nil until the window exists. Use it for platform integrations Giode doesn't cover.
func (*App) Notify ¶
Notify shows a system notification with title and body - to tell the user a transfer arrived or a download finished. It works on Android, iOS, macOS, Windows and Linux.
On Android 13 and later, iOS and macOS, the app needs the user's permission. The first Notify of a run asks for it when it's missing, and shows its notification if the user allows; after that Notify returns ErrNotificationsOff while notifications stay off (the user can turn them on in the system's settings for the app). To ask at a better moment, call RequestNotificationPermission. On iOS and macOS notifications show as banners while the app is in front too (the system hides them otherwise); macOS needs an app bundle (a giode build, not go run).
It returns once the system took the notification, or after a moment while the permission prompt is still up.
func (*App) OpenDownloads ¶
OpenDownloads shows where SaveToDownloads puts files: the Downloads app on Android, the app's folder in the Files app on iOS, and Downloads/<folder> in the file manager on desktops (folder is the app's name when empty).
func (*App) OpenFile ¶
func (a *App) OpenFile(ctx context.Context, filter ...FileFilter) (io.ReadCloser, error)
OpenFile shows the platform's file picker and returns the file the user chose, open for reading. On Android and iOS that's the system picker, the only way apps there can read the user's files; on desktops it's the native open dialog (through the XDG desktop portal on Linux).
OpenFile blocks until the user decides, so call it from a goroutine, never from a click handler or anything else running on the UI goroutine - the dialog needs the event loop running:
go func() {
f, err := app.OpenFile(ctx, giode.FileFilter{Extensions: []string{"wav", "mp3"}})
if errors.Is(err, giode.ErrCanceled) {
return
}
...
}()
It returns ErrCanceled when the user closes the picker, and ctx.Err() when ctx ends first (the picker may stay open; a file chosen after that is closed). One file dialog shows at a time; further calls wait for it.
func (*App) OpenFiles ¶
func (a *App) OpenFiles(ctx context.Context, filter ...FileFilter) ([]io.ReadCloser, error)
OpenFiles is OpenFile for choosing several files at once.
func (*App) OpenFolder ¶
OpenFolder opens the folder at path in the file manager: Explorer, Finder or the desktop's file manager; on iOS the Files app, for folders inside the app's Documents. Android returns ErrNotSupported: use OpenDownloads. To point at one file inside its folder, Share a ShareFile instead.
func (*App) OpenPortal ¶
func (a *App) OpenPortal(opts PortalOptions, view func() Element) *PortalWindow
OpenPortal opens a portal window showing view, which runs every frame of it as the main view does. Call it from any goroutine once the app runs. It closes with Close, its own close button, or the app's exit.
func (*App) OpenURL ¶
OpenURL opens rawURL in the app that handles it - the browser for web links, the mail or phone app for mailto: and tel: - on every platform: an ACTION_VIEW intent on Android, UIApplication openURL on iOS, and open, xdg-open or the URL handler on desktops. Only http, https, mailto, tel and sms links are opened; others return an error, so links from untrusted content can't reach local files or scripts.
Links in RichText and Markdown open through it unless the paragraph has its own OnLink handler.
func (*App) OpenWith ¶
OpenWith opens the file at path in another app, the one the system picks for its type, as tapping or double-clicking it in a file manager would - rather than through Share:
- Android: an ACTION_VIEW intent with the file's type (guessed from its extension), opening the user's default app or the system's choice of apps. The file is handed over read-only through the app's content provider, which giode build declares; an app built by an older giode hands over a copy in Downloads instead (Android 10 or later). With no app for the type, it returns an error.
- iOS: the "Open in…" menu of the apps that open the file, or, when none does, a Quick Look preview with the share button.
- Desktops: the file's default app (ShellExecute on Windows, which asks with "Open with" when the type has none; NSWorkspace on macOS; on Linux the desktop portal's OpenURI, which Flatpak and Snap apps need, else xdg-open). OpenWith waits for the portal's answer: ErrCanceled when the user dismisses its app chooser.
- The web returns ErrNotSupported.
Call it from a goroutine: on Android it may copy the file.
func (*App) PickFiles ¶
func (a *App) PickFiles(ctx context.Context, opts PickOptions) ([]PickedFile, error)
PickFiles shows the platform's file picker (see OpenFile) and returns the picked files with their names, types and sizes - the display name and size from the picker on Android and iOS, from the file itself on desktops. Like OpenFile it blocks until the user decides: call it from a goroutine. It returns ErrCanceled when the user closes the picker.
files, err := app.PickFiles(ctx, giode.PickOptions{Types: []string{"image/*", "application/pdf"}, Multiple: true})
func (*App) PickFolder ¶
PickFolder shows the platform's folder picker and returns the path of the folder the user chose: IFileOpenDialog on Windows, NSOpenPanel on macOS, the XDG desktop portal on Linux (zenity or kdialog when no portal runs). Like OpenFile it blocks until the user decides: call it from a goroutine. It returns ErrCanceled when the user closes the picker, and ErrNotSupported on Android, iOS and the web, where apps get no plain paths to the user's folders.
In the macOS App Sandbox (Mac App Store builds), access to the folder would end when the app quits; giode keeps a security-scoped bookmark of it and reopens it at every start, so the path keeps working.
func (*App) PickMedia ¶
func (a *App) PickMedia(ctx context.Context, opts MediaOptions) ([]PickedFile, error)
PickMedia lets the user pick photos and videos, several at once, and returns the original files - full size, in their own format (HEIC, MOV, ...), not converted - in the order picked. On iOS it's the Photos picker (PHPicker, iOS 14 and later), on Android the system Photo Picker (Android 13, or 11 and 12 with the updated media module): both need no permission, and they're where most of what a phone user sends lives. Elsewhere, and on Android without the Photo Picker, it's the file picker for images and videos. On iOS and desktops each file's Path is set (a temporary copy on iOS). It blocks until the user decides: call it from a goroutine. It returns ErrCanceled when the user picks nothing.
files, err := app.PickMedia(ctx, giode.MediaOptions{})
func (*App) PickPhoto ¶
func (a *App) PickPhoto(ctx context.Context, opts PhotoOptions) (PickedFile, error)
PickPhoto lets the user pick a photo (or take one, with Camera) and returns it as a JPEG, scaled to MaxSide and rotated upright. On Android it uses the system photo picker (Android 13+, or the image picker before that) and decodes HEIC there, so HEIC never reaches the app. On desktops it picks an image file (JPEG, PNG, GIF, WebP) and re-encodes it. It blocks until the user decides: call it from a goroutine. It returns ErrCanceled when the user backs out.
func (*App) PickPhotos ¶
func (a *App) PickPhotos(ctx context.Context, opts PhotoOptions, limit int) ([]PickedFile, error)
PickPhotos lets the user pick several photos at once, up to limit (0 for as many as the picker allows), and returns them in the order picked, each as an upright JPEG scaled to opts.MaxSide. On Android it uses the system photo picker (Android 13+, or the image picker before that); on iOS PHPicker (iOS 14+); on desktops an image file picker. opts.Source must be Library. It blocks until the user decides: call it from a goroutine. It returns ErrCanceled when the user picks none.
func (*App) PlaySound ¶
PlaySound plays a short sound - the contents of a WAV file - and returns without waiting for it to finish: a chime when a task is done, a click, an alert. The WAV holds PCM samples of 8, 16, 24 or 32 bits, or 32-bit floats, in one channel or two, at any common rate. Scale the samples for a quieter sound; EncodeWAV makes a WAV from samples generated in code.
Sounds overlap, except on Windows, where a sound stops the one still playing. It returns an error for data that isn't such a WAV, and ErrNotSupported where nothing can play it (on Linux it needs pw-play, paplay or aplay). Call it from any goroutine.
Where it plays: Windows' PlaySound; NSSound on macOS; AVAudioPlayer on iOS, mixed with other audio and silent in silent mode; AudioTrack on Android, as a notification sound; Web Audio in the browser (which plays sounds only after the user has interacted with the page); PipeWire, PulseAudio or ALSA on Linux.
func (*App) Portals ¶
func (a *App) Portals() []*PortalWindow
Portals returns the portal windows open now.
func (*App) Post ¶
func (a *App) Post(fn func())
Post queues fn to run on the UI goroutine before the next frame and requests that frame, without waiting. While the window is hidden or minimized, and there are no frames, it runs as soon as the UI goroutine wakes up. It is safe to call from any goroutine: use it to apply results from background work (a network response, a file read) to data the view reads, so that data never needs locks. Calls run in the order posted.
func (*App) Quit ¶
func (a *App) Quit()
Quit closes the window and ends the app, even with CloseToTray.
func (*App) Raise ¶
func (a *App) Raise()
Raise brings the window to the front, restoring it first when it's minimized. On Windows it may be called from any goroutine; elsewhere call it on the UI goroutine (from a handler, or through Post).
Windows lets an app take the foreground only when the user just interacted with it, or another app passed it the right (a second launch does, see SingleInstanceLock); otherwise the taskbar button flashes instead.
func (*App) ReadClipboard ¶
ReadClipboard reads the system clipboard's text and calls fn with it on the UI goroutine (with "" when the clipboard holds no text). It is safe to call from any goroutine and doesn't block; the read starts on the next frame, which it requests.
func (*App) ReadClipboardImage ¶
ReadClipboardImage returns the image on the system clipboard - a screenshot, or an image copied from a browser, a document or an image editor - or nil when the clipboard holds no image. It returns ErrNotSupported where giode can't read images from the clipboard.
It reads the clipboard directly and may wait for the app that owns it, so call it from a goroutine, like OpenFile:
go func() {
img, err := app.ReadClipboardImage(ctx)
if err != nil || img == nil {
return
}
...
}()
Where it comes from: Windows' clipboard (PNG, else a device- independent bitmap); macOS's and iOS's pasteboards; Android's clipboard (an image content URI, as Android's screenshot and photo apps copy); the browser's async clipboard (the page must be focused, and the browser may ask the user); on Linux, wl-paste (Wayland) or xclip (X11), which must be installed.
func (*App) RequestClose ¶
func (a *App) RequestClose()
RequestClose closes the window as the system's close button does: asking OnCloseRequest first, then with CloseToTray it hides the window to the tray, otherwise it ends the app, as Close does. TitleBar's close button calls it. It may be called from any goroutine.
func (*App) RequestNotificationPermission ¶
RequestNotificationPermission asks the user to allow the app's notifications, where the platform asks (Android 13 and later, iOS, macOS), and reports whether they're allowed. The system shows its prompt only while the user hasn't decided; later calls just report. It blocks until the user answers: call it from a goroutine. Elsewhere it reports true.
func (*App) ResetFrameStats ¶
func (a *App) ResetFrameStats()
ResetFrameStats discards the frames measured so far, to measure one interaction (a streamed reply, a scroll) on its own.
func (*App) RestartElevated ¶
RestartElevated starts a new copy of the app with administrator rights and quits this one, for work that needs them (raw disk access, system settings). The system asks the user first: UAC on Windows, pkexec (polkit) on Linux, an administrator password prompt on macOS. args are the new copy's arguments, os.Args[1:] when nil.
It returns once the new copy is starting, or ErrDeclined when the user refuses, leaving this copy running. With a SingleInstanceLock the new copy waits for this one to quit and takes the lock over. It returns ErrNotSupported on Android, iOS and the web.
Running a whole GUI as root is what some disk tools need, but it's a big hammer: prefer a small elevated helper when the work allows.
func (*App) Run ¶
Run drives the event loop and renders view every frame until the window closes. view runs on every frame: build the UI from scratch, but reuse stateful components created before Run.
Run blocks for the lifetime of the application: when the window closes it releases the single-instance lock, runs OnShutdown and terminates the process. Any window close error is printed to stderr.
func (*App) RunOnUI ¶
RunOnUI runs fn on the UI goroutine before the next frame is laid out (or straight away while the window is hidden) and waits for it, so code running elsewhere (an MCP tool, a network callback) can safely drive stateful components. It fails if the UI goroutine doesn't run it before ctx is done.
func (*App) SaveFile ¶
SaveFile shows the platform's save dialog, suggesting name, and returns the file the user chose, open for writing; close it when done. On Android that's the system's "create document" picker. Like OpenFile, it blocks until the user decides: call it from a goroutine.
func (*App) SaveToDownloads ¶
SaveToDownloads copies the file at path into the user's Downloads folder, under folder (the app's name when empty), and returns where it went. Use it for files the user receives or exports and expects to find with their other downloads.
- Android: Download/<folder> through MediaStore, where the Files and Downloads apps show it; Android 10 or later, no permission. It returns the content:// URI.
- iOS: the app's Documents/<folder>, which the Files app shows under the app when Info.plist has UIFileSharingEnabled and LSSupportsOpeningDocumentsInPlace (set both to true under [ios.plist] in giode.toml). It returns the file's path.
- Desktops: the Downloads folder (Windows' known folder, XDG_DOWNLOAD_DIR on Linux, ~/Downloads on macOS). It returns the file's path.
A file of the same name isn't overwritten: the copy gets " (2)" and so on. It copies the whole file: call it from a goroutine.
func (*App) SaveToPhotos ¶
SaveToPhotos adds the picture or video at path to the device's photo gallery, where photo apps show it: a scanned page exported as JPEG, say. The type comes from the extension (.jpg, .png, .heic, .mp4, .mov ...).
On Android it goes to Pictures/<album> (Movies for videos) through MediaStore, Android 10 or later, with no permission needed. On iOS it's added to the photo library, asking for add-only access the first time: set ios.usage.photos_add in giode.toml (NSPhotoLibraryAddUsageDescription). On desktops it's copied into the user's Pictures folder, under album. album is a folder name, the app's name when empty; iOS ignores it.
It needs the github.com/xmhrnx/giode/gallery package imported, so that only apps that save to the photo library carry that code; without it it returns an error wrapping ErrNotSupported.
It copies the whole file: call it from a goroutine.
func (*App) Screen ¶
Screen returns the screen showing the window, in dp. It's supported on Windows, macOS and X11; on Android, iOS and the web the window is the screen, which it returns with the system bars taken out of the work area. Wayland doesn't tell apps where their windows are: there it returns ErrNotSupported. Safe to call from any goroutine.
func (*App) SetAlwaysOnTop ¶
SetAlwaysOnTop keeps the window above other windows, or stops it, as Config.AlwaysOnTop does at start. It works on Windows, macOS and X11; Wayland leaves the choice to the user. Safe to call from any goroutine.
func (*App) SetBoldText ¶
func (a *App) SetBoldText(p Preference)
SetBoldText overrides Config.BoldText while the app runs.
func (*App) SetClipboard ¶
SetClipboard copies text to the system clipboard. It is safe to call from any goroutine; the copy happens on the next frame, which it requests. Inside a Layout, kit.WriteClipboard copies immediately.
func (*App) SetCloseToTray ¶
SetCloseToTray turns Config.CloseToTray on or off while the app runs: closing the window then hides it to the tray, or ends the app. It may be called from any goroutine.
func (*App) SetContextMenu ¶
SetContextMenu registers a menu to open with a right-click anywhere in the window. The app registers the right-click area and renders the menu on top automatically.
func (*App) SetContrast ¶
func (a *App) SetContrast(p Preference)
SetContrast overrides Config.Contrast while the app runs.
func (*App) SetFullscreen ¶
SetFullscreen switches the window in or out of fullscreen mode.
func (*App) SetLaunchAtLogin ¶
SetLaunchAtLogin registers the app to start when the user signs in, or removes the registration: a Run key entry on Windows (or, in an MSIX package, its startup task: set windows.msix.startup_task in giode.toml), a LaunchAgent on macOS (a login item with SMAppService in the App Sandbox, as Mac App Store builds are: macOS 13 and later, ErrNotSupported before), an XDG autostart entry on Linux (running the AppImage or the Flatpak when the app is one). The app then starts with LaunchedAtLogin true. It returns ErrNotSupported on Android, iOS and the web.
The user can also change it in the system's settings, so read LaunchAtLogin for the current state rather than remembering it.
func (*App) SetMaxFPS ¶
SetMaxFPS caps the frame rate at fps frames a second; 0 draws at the display's refresh rate. See Config.MaxFPS. It may be called from any goroutine and applies from the next frame.
func (*App) SetMenuBar ¶
func (a *App) SetMenuBar(menus ...MenuBarMenu)
SetMenuBar sets the application's menus (macOS); see MenuBarMenu. Calling it again replaces them, to update checks and disabled items.
func (*App) SetMinimizeToTray ¶
SetMinimizeToTray turns Config.MinimizeToTray on or off while the app runs. It may be called from any goroutine.
func (*App) SetMotion ¶
func (a *App) SetMotion(p MotionPreference)
SetMotion overrides Config.Motion while the app runs.
func (*App) SetPosition ¶
SetPosition moves the window so its top left corner (of the title bar and border) is at x, y in dp on the desktop, from the primary screen's top left. It's supported on Windows, macOS and X11, and returns ErrNotSupported elsewhere: Wayland compositors place windows themselves. Safe to call from any goroutine; the move happens shortly after.
func (*App) SetSize ¶
SetSize resizes the window to w x h dp, leaving fullscreen or maximized state first. The size bounds from Config (MinSize, MaxSize, MinWidth, ...) are widened when they'd prevent it, so automation can shrink a desktop app to a phone's size; a window that isn't Resizable stays locked, at the new size.
func (*App) SetTextScale ¶
SetTextScale overrides Config.TextScale while the app runs: 0 follows the system.
func (*App) SetTitle ¶
SetTitle changes the window's title, shown in its title bar, the taskbar and the window switcher - the playing file's name, say. Config.Title is the first. Safe to call from any goroutine.
func (*App) Share ¶
Share hands item to the system, the usual way to get something out of an app on a phone:
err := app.Share(ctx, giode.ShareFile{Path: p, MIME: "audio/wav"})
On Android it opens the system share sheet. A shared file is first copied into the device's Downloads folder (apps built with gogio can't declare the FileProvider Android otherwise needs to hand files to other apps), which needs Android 10 or later.
On desktops, ShareText copies the text to the clipboard and ShareFile shows the file in the file manager. On iOS it opens the share sheet (a popover on iPad). On the web Share returns ErrNotSupported.
Share can take a while for a large file, so call it from a goroutine rather than a click handler.
func (*App) ShowWindow ¶
func (a *App) ShowWindow()
ShowWindow shows a window hidden with HideWindow (or by MinimizeToTray, CloseToTray), restores it from minimized, and brings it to the front.
func (*App) SignInWithPasskey ¶
SignInWithPasskey signs in with a passkey: the platform shows the user's passkeys for the site (or those the server allows) and signs the server's challenge with the one picked.
options is the JSON of the server's authentication options (PublicKeyCredentialRequestOptionsJSON); the result is the AuthenticationResponseJSON to send back. It ends with auth.ErrNoPasskey when there's no passkey to use, besides the errors CreatePasskey can end with.
func (*App) ToggleMaximize ¶
func (a *App) ToggleMaximize()
ToggleMaximize maximizes a restored window and restores a maximized (or fullscreen) one - the action behind a title bar's maximize button.
func (*App) UninstallContextActions ¶
UninstallContextActions removes what InstallContextActions added.
func (*App) Unmaximize ¶
func (a *App) Unmaximize()
Unmaximize restores the window from its maximized state.
func (*App) WindowState ¶
func (a *App) WindowState() WindowState
WindowState returns the window's current state. It is safe to call from any goroutine.
func (*App) WindowVisible ¶
WindowVisible reports whether the window is on screen: not hidden and not minimized.
type AppShellConfig ¶
type AppShellConfig = ui.AppShellConfig
type AppShellSlot ¶
type AppShellSlot = ui.AppShellSlot
type AutofillKind ¶
type AutofillKind = ui.AutofillKind
AutofillKind is what a text field holds, for password managers and AutoFill: Input.Autofill.
type AvatarElement ¶
type AvatarElement = ui.AvatarElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type BackgroundFit ¶
type BackgroundFit = ui.BackgroundFit
Style value and element types, for declaring variables and helpers that take them.
type BackgroundImage ¶
type BackgroundImage = ui.BackgroundImage
Style value and element types, for declaring variables and helpers that take them.
type BadgeElement ¶
type BadgeElement = ui.BadgeElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type BoxElement ¶
type BoxElement = ui.BoxElement
Style value and element types, for declaring variables and helpers that take them.
type Breakpoint ¶
type Breakpoint = ui.Breakpoint
type ButtonElement ¶
type ButtonElement = ui.ButtonElement
type ButtonVariant ¶
type ButtonVariant = ui.ButtonVariant
type CalendarEvent ¶
type CalendarEvent = ui.CalendarEvent
CalendarEvent is an event a CalendarView shows.
type CalendarViewElement ¶
type CalendarViewElement = ui.CalendarViewElement
CalendarViewElement is CalendarView's type.
type CanvasPath ¶
type CanvasPath = ui.CanvasPath
Style value and element types, for declaring variables and helpers that take them.
type CheckState ¶
type CheckState = ui.CheckState
CheckState, ExpandState and LiveMode are accessibility states of a SemanticNode; SemanticContainer is a container being laid out.
type ChipElement ¶
type ChipElement = ui.ChipElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type ClickEvent ¶
type ClickEvent = ui.ClickEvent
type ClickSource ¶
type ClickSource = ui.ClickSource
type Color ¶
Color is a CSS-like color: "#3b82f6", "rgb(59 130 246)", a name, or a "theme.*" token that follows the palette.
type ComboOption ¶
type ComboOption = ui.ComboOption
ComboOption is a Combobox, MultiSelect or Mentions option.
type ComboSource ¶
type ComboSource = ui.ComboSource
ComboSource fetches options for a query, for options on a server.
type ComboboxElement ¶
type ComboboxElement = ui.ComboboxElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type ComboboxList ¶
type ComboboxList = ui.ComboboxList
ComboboxList is a combobox's list of options; Emoji one emoji of the picker's set; License a module's license for LicensesView; IconVGIcon a decoded IconVG icon; MenuItem a menu's row.
type CommandPaletteElement ¶
type CommandPaletteElement = ui.CommandPaletteElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type Config ¶
type Config struct {
// Title is the window title.
Title string
// Size is the initial window size. Defaults to 800x600.
Size image.Point
// MinSize and MaxSize bound the window size when Resizable. They
// combine with MinWidth/MinHeight/MaxWidth/MaxHeight below; the
// tighter bound wins.
MinSize image.Point
MaxSize image.Point
// MinWidth, MinHeight, MaxWidth and MaxHeight bound the window
// size per axis.
MinWidth int
MinHeight int
MaxWidth int
MaxHeight int
// Resizable controls whether the user can resize the window. When
// false the size is locked to Size.
Resizable bool
// Frameless removes the OS window frame (title bar and borders).
Frameless bool
// Draggable makes the window movable by dragging empty
// (non-widget) space anywhere in it. It only applies to frameless
// windows. To drag by a custom title bar only, leave it off and
// use TitleBar, which marks its own area as the drag handle.
Draggable bool
// Background is the window background color. Theme tokens
// ("theme.background") follow SetMode and SetPalette. On Windows,
// built with the giode CLI's Gio patches, a new window shows it
// (as it is when New runs) until the first frame, rather than
// white.
Background string
// StatusBar and NavigationBar color Android's status bar and
// navigation bar. Both default to Background and follow theme
// changes, so the bars blend with a light or dark app. Other
// platforms ignore them.
StatusBar string
// Orientation restricts rotation on mobile platforms. Defaults to
// OrientationAny. Desktop platforms ignore it.
Orientation Orientation
// Motion chooses whether animations play: MotionSystem (the default)
// follows the system's reduce-motion setting, checked as the app
// runs; MotionReduced and MotionFull override it. With reduced
// motion, Giode's transitions, keyframes, drawers, sheets and
// switches finish at once (see ReducedMotion).
Motion MotionPreference
// Contrast chooses high contrast: PreferenceSystem (the default)
// follows the system's setting (High Contrast on Windows, Increase
// Contrast on macOS and iOS, the desktop's high contrast on Linux);
// PreferenceOff and PreferenceOn override it. With high contrast,
// "theme.*" colors resolve against a high-contrast palette: on
// Windows, the user's own high-contrast colors.
Contrast Preference
// BoldText chooses bold text: PreferenceSystem follows the system's
// Bold Text setting (iOS); with it, every font weight is two steps
// heavier.
BoldText Preference
// TextScale scales text: 0 (the default) follows the system's text
// size (Text size on Windows, Dynamic Type on iOS, the text scaling
// factor on X11 desktops; Android and Wayland scale text
// themselves). Any other value replaces it: 1.5 is half again as
// large.
TextScale float32
// FollowSystemTheme sets the theme mode (SetMode) from the
// platform's light or dark appearance at startup and whenever it
// changes. See SystemDarkMode for the platforms that report it.
FollowSystemTheme bool
// OnSystemThemeChange runs on the UI goroutine when the platform's
// appearance changes between light and dark, with or without
// FollowSystemTheme.
OnSystemThemeChange func(dark bool)
// EdgeToEdge lays the view out over the whole window, under the
// status bar, navigation bar and cutouts, instead of inside the
// safe area. Pad content with SafeArea where it must stay clear of
// them. Desktop windows have no insets, so it changes nothing there.
EdgeToEdge bool
// Font is the font family of text that doesn't set a FontFamily,
// Giode's own components included (title bar, buttons, text
// fields, menus, toasts): register its files with RegisterFont
// before New. Empty keeps the Go fonts. See SetDefaultFont.
Font string
// Icon is the window icon, PNG or JPEG bytes. It is applied at
// runtime where the platform supports it (Windows). The icon
// shown by file managers comes from the executable and is set at
// build time.
Icon []byte
// WindowStartState selects the initial window state. It takes
// precedence over the Fullscreen, Maximized and Minimized flags.
WindowStartState WindowStartState
// Fullscreen starts the window in fullscreen mode.
Fullscreen bool
// Maximized starts the window maximized.
Maximized bool
// Minimized starts the window minimized.
Minimized bool
// Center starts the window centered on the screen.
Center bool
// AlwaysOnTop keeps the window above other windows.
AlwaysOnTop bool
// Logger receives Giode diagnostics at or above LogLevel.
Logger Logger
// LogLevel filters Logger output. Defaults to LogLevelDebug.
LogLevel LogLevel
// OnStartup runs before the event loop starts.
OnStartup func()
// OnReady runs after the first frame is presented to the screen.
OnReady func()
// OnShutdown runs after the window closes. On Android and iOS the
// system may end a backgrounded app without warning, so save state
// in OnBackground instead.
OnShutdown func()
// OnBackground runs when the app leaves the screen: on Android when
// its activity stops (the user switched apps, went home, or opened
// a system picker), on desktops when the window is minimized. On
// Android it's the last reliable moment to save: the system may
// freeze or end the app afterwards without warning. It runs
// synchronously on the platform's main thread (Android) or the UI
// goroutine (desktop): keep it short, and don't wait on the UI
// (RunOnUI) from it. On iOS it runs on UIApplication's
// background notification.
OnBackground func()
// OnForeground runs when the app comes back after OnBackground,
// on the same goroutine.
OnForeground func()
// OnEvent observes every window event before giode handles it, on
// the UI goroutine - for Gio extensions that need to see them. It
// must not call FrameEvent.Frame. OpenFile and SaveFile already
// get the events they need.
OnEvent func(event.Event)
// OnBeforeClose runs when a window close is requested. It cannot
// veto the close.
OnBeforeClose func()
// OnCloseRequest runs on the UI goroutine when the user asks to
// close the window (its close button, Alt+F4, Cmd+W, the TitleBar's
// close button) and decides: true closes it (or hides it to the tray
// with CloseToTray), false keeps it open - to ask about unsaved work,
// say, and call App.Close later. App.Close and App.Quit don't ask.
// Linux needs giode build's Gio patches.
OnCloseRequest func() bool
// NoMinimize, NoMaximize and NoClose take the window's minimize,
// maximize (zoom) and close buttons away or disable them (Windows,
// macOS, X11 window managers that read Motif hints). NoClose also
// keeps keyboard closes (Alt+F4, Cmd+W) from closing the window;
// App.Close still does. Wayland leaves the buttons to the compositor.
NoMinimize, NoMaximize, NoClose bool
// Transparent makes the window's background transparent where the
// app's Background and drawing leave it so (with Background "" or a
// transparent color): rounded or shaped windows, overlays. Windows,
// macOS, and Linux on Wayland with giode build's Gio patches; X11
// keeps an opaque background.
Transparent bool
// OnKey receives the keys nothing in the UI took - app-wide
// shortcuts - after the focused field, dialogs, menus and the
// Escape and Back handlers have had theirs; see giode.OnKey. It
// runs on the UI goroutine and returns whether it used the key.
OnKey func(e key.Event) bool
// OnSuspend runs when the computer is about to sleep, and OnResume
// when it woke: close connections before, reconnect after. Both run
// on the UI goroutine. On Linux sleep waits for OnSuspend to return
// (for up to the system's delay, usually 5 seconds); Windows and
// macOS don't wait. Phones don't report sleep: use OnBackground and
// OnForeground there.
OnSuspend func()
OnResume func()
// OnWindowStateChange runs when the window is minimized,
// maximized, made fullscreen or restored - by the app or by the
// user.
OnWindowStateChange func(WindowState)
// Locale is the app's locale ("fa", "pt-BR") for the i18n package
// and the layout's reading direction; the system's by default. Change
// it later with SetLocale.
Locale string
// Intl, when set, turns on translations: giode loads the message
// files (<locale>.json) from a folder at startup, and Intl(key,
// data) reads them. Nil leaves translation off.
Intl *IntlOptions
// OnOpenURL runs on the UI goroutine with a link that opened the
// app or reached it while running: a URL scheme it registered
// (giode.toml's app.schemes) or one of its universal links / Android
// App Links (app.links). With a SingleInstanceLock, a link that
// starts a second desktop instance reaches the running one here.
OnOpenURL func(u *url.URL)
// shared with this one from the system share sheet - files, text or
// both - whether the share started the app or reached it while
// running. The app must be a share target: giode.toml's
// app.share_target, which registers it on Android and builds iOS's
// share extension. The receiver closes the files.
OnShareReceived func(SharedContent)
// ContextActions add entries to the file manager's right-click menu
// that open the app with the chosen paths; see ContextAction. The
// giode CLI adds the ones in giode.toml too.
ContextActions []ContextAction
// OnContextAction runs on the UI goroutine when the app was started
// from one of its context actions, with the action's ID and the
// paths it was chosen on. With a SingleInstanceLock, a context
// action chosen while the app runs reaches the running instance
// here.
OnContextAction func(id string, paths []string)
// MinimizeToTray hides the window when it's minimized, so it leaves
// the taskbar or Dock and lives in the tray until ShowWindow (by
// default a click on the tray icon) brings it back. It needs a tray
// icon: set one up with App.Tray. Desktop only. App.SetMinimizeToTray
// changes it while the app runs.
MinimizeToTray bool
// CloseToTray hides the window when the user closes it, instead of
// ending the app; Quit (a tray menu item, say) ends it. Windows and
// macOS; on Linux, where Gio can't keep a closed window, closing
// still quits. App.SetCloseToTray changes it while the app runs.
CloseToTray bool
// StartInTray starts the app with its window hidden, in the tray:
// StartInTrayAtLogin when the system started it at login (see
// App.SetLaunchAtLogin), StartInTrayAlways every time. The window
// shows with ShowWindow, from the tray icon. It needs a tray icon
// (App.Tray) and is ignored where TraySupported is false.
StartInTray StartInTray
// MenuBar is the application's native menu bar (macOS); see
// App.SetMenuBar to change it while the app runs.
MenuBar []MenuBarMenu
// MenuBarApp makes a macOS app live in the menu bar: no Dock icon
// and no app menu, as menu bar utilities do. Pair it with App.Tray.
// Other platforms ignore it.
MenuBarApp bool
// SingleInstanceLock, when set, ensures only one instance of the
// application runs on desktops. Android and iOS ignore it: they run
// one copy of an app anyway. When the lock can't be written (no
// usable temporary directory), the app runs as if it were alone.
SingleInstanceLock *SingleInstanceLock
// OnFileDrop runs with the paths of files dropped onto the window
// from the file manager, on the UI goroutine. It works on Windows
// (when the app runs as administrator too), macOS, and on Linux on
// X11 and Wayland when an up to date giode CLI builds the app: its
// Gio patches receive the drops. Elsewhere a warning is logged once.
OnFileDrop func(paths []string)
// OnFileDrag runs on the UI goroutine as files are dragged over
// the window - entering, moving, leaving, dropped - for
// highlighting where they can go; App.FileDrag reports the same
// during layout. Setting it accepts drops as OnFileDrop does. On
// Windows, an app running as administrator gets only the drop.
OnFileDrag func(FileDrag)
// FileDropTargets accepts files dragged in from other applications
// for the view's drop targets alone: a DropTarget accepting
// giode.DroppedFiles highlights while files are dragged over it and
// takes them when they're dropped on it. OnFileDrop and OnFileDrag
// turn this on too; files dropped on a target don't reach
// OnFileDrop.
FileDropTargets bool
// MCP starts a Model Context Protocol server alongside the window,
// so AI agents can see and drive the running app: inspect the UI,
// click, type, take screenshots, read and set named state - plus
// any tools added with App.MCPTool. It listens on
// http://127.0.0.1:7600/mcp unless MCPOptions say otherwise.
// Setting the GIODE_MCP=1 environment variable enables it too,
// without rebuilding.
MCP bool
// MCPOptions configures the MCP server.
MCPOptions MCPOptions
// ShowFrameTimes draws a small counter in the top right corner with
// how long frames take to build and to render, and the frame rate:
// a development aid for finding what makes scrolling or a stream
// stutter on a device. App.FrameStats returns the same numbers, and
// the MCP server reports them as frame_stats.
ShowFrameTimes bool
// MaxFPS caps the frame rate: frames are drawn at most this many
// times a second, saving CPU, GPU and battery during animations,
// scrolling and video. 0 (the default) draws at the display's
// refresh rate. Frames still follow the display's refresh, so on a
// 60 Hz display a cap of 30 gives 30 fps but one of 50 gives 30 too:
// each frame waits for the refresh after its interval. Change it
// while the app runs with SetMaxFPS.
MaxFPS int
// Underlay draws caller-rendered GPU content under the UI each
// frame - video frames from libmpv, a 3D or map engine - without
// copying it off the GPU. It's called on the window's render thread
// with the window's GPU context current, before the UI is drawn
// over its output; Background isn't painted, so the UI's own
// backgrounds cover only what they should. Call App.Invalidate from
// any goroutine when a new frame is ready. Engines drawing with
// OpenGL set Renderer to RendererOpenGL. It needs giode's patched
// Gio (giode build and giode run); without it Run returns an error.
Underlay func(target GPUTarget)
// UnderlayRelease runs on the render thread with the GPU context
// still current, just before Gio releases its GPU resources: when
// the window closes or its view goes away (Android leaving the
// screen), or the context is lost and made again, after which
// Underlay runs in the new one. Free the engine's GPU resources
// here (for libmpv, mpv_render_context_free). It needs an up to
// date giode CLI (the giode_gio2 patches); with older ones Run
// returns an error.
UnderlayRelease func()
// Renderer selects the window's GPU API; see RendererOpenGL.
Renderer Renderer
}
Config configures the application window. The options cover the common window settings of desktop applications; unsupported platform features are simply ignored.
type Constraints ¶
type Constraints = ui.Constraints
Context is what an element's Layout gets: the constraints it must fit, the display metric, the ops to draw into and the input source (Gio's layout.Context). Dimensions is what Layout returns: the size it took and its baseline. With these, a custom element needs nothing from Gio:
func (r *Rating) Layout(gtx giode.Context) giode.Dimensions { ... }
type Context ¶
Context is what an element's Layout gets: the constraints it must fit, the display metric, the ops to draw into and the input source (Gio's layout.Context). Dimensions is what Layout returns: the size it took and its baseline. With these, a custom element needs nothing from Gio:
func (r *Rating) Layout(gtx giode.Context) giode.Dimensions { ... }
type ContextAction ¶
type ContextAction struct {
// ID identifies the action to OnContextAction. Letters, digits, -
// and _.
ID string `json:"id"`
// Label is the menu text.
Label string `json:"label"`
// Files offers the action on files; Extensions limits it to files
// with these extensions (".md"). Without Files, Folders or
// FolderBackground, it's offered on files.
Files bool `json:"files,omitempty"`
Extensions []string `json:"extensions,omitempty"`
// Folders offers the action on folders.
Folders bool `json:"folders,omitempty"`
// FolderBackground offers it on the empty space of an open folder;
// the path is that folder. Windows and Dolphin only.
FolderBackground bool `json:"background,omitempty"`
}
ContextAction is an entry the app adds to the file manager's right-click menu - "Ask Pocket Agent about this file", "Open in Notes" - on files, folders, or the empty space inside a folder. Choosing it starts the app (or, with a SingleInstanceLock, hands the paths to the running one) and runs Config.OnContextAction with the action's ID and the paths.
Declare actions in giode.toml, where the giode CLI also writes them into the Windows installer and the macOS app, or in Config.ContextActions. They appear:
- on Windows, in Explorer's context menu ("Show more options" on Windows 11): installed by the setup program, or by App.InstallContextActions for the current user;
- on macOS, under Quick Actions / Services in Finder's context menu, from the app's Info.plist (built by the giode CLI) once the app is in /Applications and has run once;
- on Linux, in GNOME Files and Caja (under Scripts), Dolphin and Nemo, once App.InstallContextActions has run.
type ContextMenu ¶
type ContextMenu = ui.ContextMenu
ContextMenu is what an element's Context takes: a Menu, or a menu of your own.
type Contextual ¶
type Contextual = ui.Contextual
Contextual gives a custom element Context; see extending.md.
type CopyButtonElement ¶
type CopyButtonElement = ui.CopyButtonElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type DataGridColumn ¶
type DataGridColumn = ui.DataGridColumn
DataGridColumn is one of a DataGrid's columns; DataGridElement the grid, DataGridSortKey a level of its sort.
type DataGridColumnLayout ¶
type DataGridColumnLayout = ui.DataGridColumnLayout
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type DataGridEditorKind ¶
type DataGridEditorKind = ui.DataGridEditorKind
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type DataGridElement ¶
type DataGridElement = ui.DataGridElement
type DataGridExportFormat ¶
type DataGridExportFormat = ui.DataGridExportFormat
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type DataGridFilter ¶
type DataGridFilter = ui.DataGridFilter
DataGridFilter is a filter on a DataGrid column (SetFilter, OnFilter).
type DataGridFilterer ¶
type DataGridFilterer = ui.DataGridFilterer
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type DataGridKeyer ¶
type DataGridKeyer = ui.DataGridKeyer
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type DataGridLayout ¶
type DataGridLayout = ui.DataGridLayout
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type DataGridLoader ¶
type DataGridLoader = ui.DataGridLoader
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type DataGridSliceSource ¶
type DataGridSliceSource[T any] = ui.DataGridSliceSource[T]
DataGridSliceSource is a data grid source over a slice of rows.
type DataGridSortKey ¶
type DataGridSortKey = ui.DataGridSortKey
type DataGridSorter ¶
type DataGridSorter = ui.DataGridSorter
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type DataGridSource ¶
type DataGridSource = ui.DataGridSource
The data grid's data source and layout types.
type DateCalendarElement ¶
type DateCalendarElement = ui.DateCalendarElement
DatePickerElement and the others are the date and time fields' types.
type DatePickerElement ¶
type DatePickerElement = ui.DatePickerElement
DatePickerElement and the others are the date and time fields' types.
type DateRangePickerElement ¶
type DateRangePickerElement = ui.DateRangePickerElement
DatePickerElement and the others are the date and time fields' types.
type DateTimeFieldElement ¶
type DateTimeFieldElement = ui.DateTimeFieldElement
DatePickerElement and the others are the date and time fields' types.
type DeviceClass ¶
type DeviceClass string
DeviceClass is a device's form factor.
const ( DevicePhone DeviceClass = "phone" DeviceTablet DeviceClass = "tablet" DeviceDesktop DeviceClass = "desktop" )
type DeviceInfo ¶
type DeviceInfo struct {
// TotalRAM is the physical memory in bytes, 0 if unknown.
TotalRAM uint64
// Class is the form factor: phone or tablet on Android and iOS (by
// the window's shorter side, 600dp and up being a tablet), desktop
// elsewhere.
Class DeviceClass
// OS is runtime.GOOS; OSVersion its version ("14", "10.0.22631",
// "6.8.0-45-generic"), and Model the hardware model ("Pixel 8",
// "MacBookPro18,3"), each "" when unknown.
OS string
OSVersion string
Model string
}
DeviceInfo describes the device the app runs on.
func Device ¶
func Device() DeviceInfo
Device returns information about the device, for choosing a suitable on-device model or layout. Class uses the window size, so call it once the first frame has been laid out (in OnReady or the view).
type DialogElement ¶
type DialogElement = ui.DialogElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type Dimensions ¶
type Dimensions = ui.Dimensions
Context is what an element's Layout gets: the constraints it must fit, the display metric, the ops to draw into and the input source (Gio's layout.Context). Dimensions is what Layout returns: the size it took and its baseline. With these, a custom element needs nothing from Gio:
func (r *Rating) Layout(gtx giode.Context) giode.Dimensions { ... }
type DividerElement ¶
type DividerElement = ui.DividerElement
Style value and element types, for declaring variables and helpers that take them.
type DocTabsElement ¶
type DocTabsElement = ui.DocTabsElement
type DragExportData ¶
type DragExportData = ui.DragExportData
DragExportData is what a Draggable gives other applications when it's dragged out of the window (Export): files, text.
type DragResult ¶
type DragResult = ui.DragResult
type DragSourceStyle ¶
type DragSourceStyle = ui.DragSourceStyle
DragSourceStyle is how a dragged Draggable shows in its place; DragAxis limits its preview's movement.
type DragState ¶
DragState is a Draggable's state for its content, DropState a DropTarget's; DropEvent is a drop, DragResult how a drag ended.
type DraggableElement ¶
type DraggableElement = ui.DraggableElement
DraggableElement is content that can be dragged (Draggable); DropTargetElement an area drags can be dropped on (DropTarget). See the dnd package.
type DrawerElement ¶
type DrawerElement = ui.DrawerElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type DropTargetElement ¶
type DropTargetElement = ui.DropTargetElement
type DroppedFiles ¶
type DroppedFiles = ui.DroppedFiles
DroppedFiles is the payload of files dragged in from other applications, for drop targets (Config.FileDropTargets).
type Emoji ¶
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type EmojiPickerElement ¶
type EmojiPickerElement = ui.EmojiPickerElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type ExpandState ¶
type ExpandState = ui.ExpandState
type FileDrag ¶
type FileDrag struct {
Kind FileDragKind
// Position is where the pointer is, in window pixels as layout
// uses them (compare it with a component's bounds).
Position f32.Point
}
FileDrag is files from the file manager dragged over the window, for highlighting where they can be dropped.
type FileDragKind ¶
type FileDragKind int
FileDragKind is the stage of a FileDrag.
const ( // FileDragEnter: files were dragged into the window. FileDragEnter FileDragKind = iota + 1 // FileDragOver: they moved over it. FileDragOver // FileDragLeave: they left without being dropped, or the drag was // canceled. FileDragLeave // FileDragDrop: they were dropped; OnFileDrop follows with their // paths. FileDragDrop )
type FileFilter ¶
type FileFilter struct {
// Extensions lists the accepted file extensions, with or without
// the leading dot: "wav", ".mp3". Empty accepts any file.
Extensions []string
}
FileFilter limits the files OpenFile and OpenFiles offer.
type FlexDirection ¶
type FlexDirection = ui.FlexDirection
Style value and element types, for declaring variables and helpers that take them.
type FolderOptions ¶
type FolderOptions struct {
// Title is the dialog's title or prompt: "Where should recovered
// files go?". Empty uses the system's.
Title string
// Directory is the folder the dialog opens in; empty lets the
// system choose.
Directory string
}
FolderOptions configures PickFolder.
type FontWeight ¶
type FontWeight = ui.FontWeight
Style value and element types, for declaring variables and helpers that take them.
type FrameStats ¶
type FrameStats struct {
// Frames is the number of frames measured: up to the last 240,
// since the app started or ResetFrameStats.
Frames int
// Build is the time spent building a frame: running the view
// function and laying it out, on the UI goroutine.
Build FrameTiming
// Render is the time spent handing the frame to the GPU: Gio
// encodes it, submits it and presents it. Presenting waits when the
// GPU is behind, so a GPU-bound UI shows up here; it may also wait
// for the display's refresh, so on a vsynced display Render alone
// can reach the refresh interval while the app is otherwise idle.
Render FrameTiming
// Interval is the time from one frame's start to the next, while
// frames follow each other (an animation, a stream, a scroll):
// gaps over a quarter second, when the app had nothing to draw, are
// left out.
Interval FrameTiming
// FPS is the frame rate over those intervals; 0 without any.
FPS float64
}
FrameStats summarizes how long recent frames took, from App.FrameStats.
type FrameTiming ¶
FrameTiming is the average, 95th percentile and worst of a frame phase.
type GPUTarget ¶
type GPUTarget struct {
API GPUAPI
// Framebuffer is the OpenGL (ES) framebuffer object to draw into; 0
// is the window's default framebuffer.
Framebuffer uint32
// Texture is the Metal MTLTexture (id<MTLTexture>) or the Direct3D
// 11 ID3D11RenderTargetView to draw into, or the Vulkan VkImage.
Texture uintptr
// Size is the target's size in pixels.
Size image.Point
// GetProcAddress looks up an OpenGL (ES) function of the window's
// context by name - what engines ask for to load GL themselves
// (libmpv's get_proc_address): through ANGLE's libEGL.dll on
// Windows, EGL on Linux and Android, the OpenGL framework on macOS
// and OpenGLES on iOS. It returns nil for a name it doesn't know.
// It's nil for other APIs.
GetProcAddress func(name string) unsafe.Pointer
}
GPUTarget is the frame Config.Underlay draws into: the window's render target, with its GPU context current.
type HapticKind ¶
type HapticKind int
HapticKind is a kind of haptic feedback.
const ( // HapticLight is a light tap, for selections and key presses. HapticLight HapticKind = iota // HapticMedium is a firmer tap, for confirming a control. HapticMedium // HapticHeavy is the long-press feedback. HapticHeavy // HapticSuccess confirms a completed action (send, approve). HapticSuccess // HapticWarning flags a rejected or risky action. HapticWarning )
type IconButtonElement ¶
type IconButtonElement = ui.IconButtonElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type IconButtonVariant ¶
type IconButtonVariant = ui.IconButtonVariant
type IconDocument ¶
type IconDocument = ui.IconDocument
type IconRegistry ¶
type IconRegistry = ui.IconRegistry
type IconSource ¶
type IconSource = ui.IconSource
type IconVGIcon ¶
type IconVGIcon = ui.IconVGIcon
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type ImageElement ¶
type ImageElement = ui.ImageElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type InputAPI ¶
InputAPI groups the constructors for components whose purpose is collecting a value from the user.
type IntlOptions ¶
type IntlOptions struct {
// Dir is the folder holding the message files, "locales" by
// default. A relative folder is looked for in the working
// directory, next to the executable, then in a macOS app bundle's
// Resources folder. With FS, it's a folder inside FS.
Dir string
// FS, when set, is read instead of the disk: an embedded folder
// (//go:embed locales), which ships inside the executable and so
// also works on Android, iOS and the web, where apps have no
// folder beside them.
FS fs.FS
// Fallback is the locale used for keys the current one lacks,
// "en" by default.
Fallback string
}
IntlOptions turns on translations (Config.Intl): message files named by locale - locales/en.json, locales/fa.json, locales/pt-BR.json - each a JSON object of keys to text with {placeholders}, or to plural forms:
{
"greeting": "Hello, {name}!",
"unread": {"one": "{count} message", "other": "{count} messages"}
}
type KeyEvent ¶
KeyEvent is a key press or release; KeyName names its key, as "A", "5", "F5" or one of the Key* names; KeyModifiers are the modifiers held.
type KeyModifiers ¶
type KeyModifiers = ui.KeyModifiers
KeyEvent is a key press or release; KeyName names its key, as "A", "5", "F5" or one of the Key* names; KeyModifiers are the modifiers held.
type KeyName ¶
KeyEvent is a key press or release; KeyName names its key, as "A", "5", "F5" or one of the Key* names; KeyModifiers are the modifiers held.
type KeyShortcut ¶
type KeyShortcut = ui.KeyShortcut
KeyShortcut is a keyboard shortcut made with Shortcut.
type KeyState ¶
KeyEvent is a key press or release; KeyName names its key, as "A", "5", "F5" or one of the Key* names; KeyModifiers are the modifiers held.
type Keyboard ¶
Keyboard selects the on-screen keyboard for Input.Text fields; see input.Input.Keyboard.
type KeyboardInputElement ¶
type KeyboardInputElement = ui.KeyboardInputElement
KeyboardInputElement is the element KeyboardInput returns.
type KeyedCache ¶
type KeyedCache[K comparable, V any] = ui.KeyedCache[K, V]
KeyedCache is a typed map of per-item state that drops entries not asked for in a while; hold one in a stateful component.
func NewKeyedCache ¶
func NewKeyedCache[K comparable, V any]() *KeyedCache[K, V]
NewKeyedCache returns an empty KeyedCache.
type KeyframeAnimation ¶
type KeyframeAnimation = ui.KeyframeAnimation
KeyframeAnimation plays styles through keyframes on a Box (BoxElement.Animation); Keyframe is one of its steps.
type LazyAnchor ¶
type LazyAnchor = ui.LazyAnchor
type LazyListElement ¶
type LazyListElement = ui.LazyListElement
type License ¶
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type LicensesElement ¶
type LicensesElement = ui.LicensesElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type LinearGradient ¶
type LinearGradient = ui.LinearGradient
type MCPOptions ¶
type MCPOptions struct {
// Addr is the HTTP listen address, "127.0.0.1:7600" by default.
// Host and Port, when set, replace its parts; port 0 in Addr
// ("127.0.0.1:0") picks any free port (see App.MCPAddress). At run
// time the GIODE_MCP_ADDR, GIODE_MCP_HOST and GIODE_MCP_PORT
// environment variables override all three. Binding beyond
// loopback ("0.0.0.0") exposes the app to the network: set Token
// when doing so.
Addr string
// Host is the address to listen on: "127.0.0.1" by default,
// "0.0.0.0" for every interface.
Host string
// Port is the TCP port, 7600 by default.
Port int
// Token, when set, is required from clients as a bearer token.
Token string
// Stdio serves the protocol on stdin/stdout instead of HTTP, for
// MCP clients that launch the app as a subprocess. Nothing else
// may write to stdout then.
Stdio bool
// Name and Version identify the server; Name defaults to the
// window title.
Name, Version string
// Instructions are sent to clients to explain the app; a default
// describing the built-in tools is used when empty.
Instructions string
// ReadOnly registers only the tools that observe the app (UI
// snapshot, screenshot, state reads), none that act on it.
ReadOnly bool
// DisableBuiltinTools registers no built-in tools, leaving only
// those added with App.MCPTool.
DisableBuiltinTools bool
// AllowedOrigins lists extra browser origins allowed to call the
// HTTP endpoint (localhost origins always are).
AllowedOrigins []string
// Timeout bounds how long a tool waits for the UI thread. Defaults
// to 5 seconds.
Timeout time.Duration
}
MCPOptions configures the built-in MCP server enabled with Config.MCP. The zero value serves Streamable HTTP on 127.0.0.1:7600 at /mcp with every built-in tool.
type MarkdownOptions ¶
type MarkdownOptions = ui.MarkdownOptions
MarkdownOptions configures Markdown.
type MediaOptions ¶
type MediaOptions struct {
// Limit caps how many items the user can pick; 0 allows as many as
// the picker does.
Limit int
// Photos and Videos choose what's offered; with neither set, both
// are.
Photos, Videos bool
}
MediaOptions configures PickMedia.
type MentionsElement ¶
type MentionsElement = ui.MentionsElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type MenuBarItem ¶
type MenuBarItem struct {
// Label is the item's text.
Label string
// Shortcut is the item's key equivalent, as the shortcut package
// spells it: "Mod+S", "Mod+Shift+Z", "Mod+," (Mod is Cmd on macOS).
Shortcut string
// Disabled greys the item out; Checked shows a check mark.
Disabled, Checked bool
// Separator makes the item a divider line.
Separator bool
// Items makes the item a submenu.
Items []MenuBarItem
// OnClick runs on the UI goroutine when the item is chosen.
OnClick func()
// Role makes the item a standard one, done by giode: the edit
// commands reach the focused text field as their keys would.
Role MenuRole
}
MenuBarItem is an item of a MenuBarMenu.
type MenuBarMenu ¶
type MenuBarMenu struct {
Title string
Items []MenuBarItem
}
MenuBarMenu is a menu of the application's native menu bar: on macOS the menus at the top of the screen, after the app menu. Windows and Linux apps keep their menus in the window (TitleBar's menus), where SetMenuBar does nothing.
func EditMenu ¶
func EditMenu() MenuBarMenu
EditMenu is the standard Edit menu: Undo, Redo, Cut, Copy, Paste and Select All, which act on the focused text field.
func WindowMenu ¶
func WindowMenu() MenuBarMenu
WindowMenu is the standard Window menu: Minimize, Zoom and Enter Full Screen.
type MenuElement ¶
type MenuElement = ui.MenuElement
MenuElement is a Menu: a context menu, a menu bar's menu, or a DocTabs tab menu to add items to.
type MenuItem ¶
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type MotionPreference ¶
type MotionPreference int
MotionPreference is whether animations play (Config.Motion).
const ( // MotionSystem follows the system's reduce-motion setting. MotionSystem MotionPreference = iota // MotionReduced finishes animations at once. MotionReduced // MotionFull plays them whatever the system says. MotionFull )
type MouseButton ¶
type MouseButton = ui.MouseButton
type MultiSelectElement ¶
type MultiSelectElement = ui.MultiSelectElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type NamedKey ¶
NamedKey is a key, with exactly the modifiers to hold, that an OnKey handler asks for by name: Tab and Shift+Tab reach only a handler that names them. See OnKey.
type Orientation ¶
type Orientation int
Orientation restricts how a mobile app may be rotated.
const ( // OrientationAny lets the app follow the device's rotation. OrientationAny Orientation = iota // OrientationPortrait keeps the app in portrait. OrientationPortrait // OrientationLandscape keeps the app in landscape. OrientationLandscape )
type PaginationElement ¶
type PaginationElement = ui.PaginationElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type PaletteCommand ¶
type PaletteCommand = ui.PaletteCommand
PaletteCommand is a CommandPalette command.
type PhotoOptions ¶
type PhotoOptions struct {
Source PhotoSource
// MaxSide scales the photo down so its longer side is at most this
// many pixels; 0 keeps its size.
MaxSide int
}
PhotoOptions configures PickPhoto.
type PhotoSource ¶
type PhotoSource int
PhotoSource selects where PickPhoto takes the photo from.
const ( // PhotoLibrary picks an existing photo: the system photo picker on // Android, an image file elsewhere. PhotoLibrary PhotoSource = iota // Camera takes a new photo with the camera: Android, and iOS when // the app's Info.plist has NSCameraUsageDescription. It needs the // github.com/xmhrnx/giode/takephoto package imported, so that only // apps that take photos carry the camera code. Camera )
type PickOptions ¶
type PickOptions struct {
// Types limits the files offered, as MIME types ("application/pdf",
// "image/*") or extensions ("md", ".txt"). Empty allows any file.
Types []string
// Multiple lets the user pick several files.
Multiple bool
}
PickOptions configures PickFiles.
type PickedFile ¶
type PickedFile struct {
io.ReadCloser
// Name is the display name ("Q3 report.pdf"), without a directory.
Name string
// MIME is the content type, from the name's extension or, failing
// that, the first bytes of the content.
MIME string
// Size is the length in bytes, or -1 when unknown.
Size int64
// Path is the file's absolute path on desktops, for work that
// needs the file itself rather than a stream (opening a disk image
// at random offsets, reopening it later); on iOS, the path of the
// picker's copy in the app's temporary directory. It's empty on
// Android and the web, whose pickers give content without a path.
Path string
}
PickedFile is a file the user picked, open for reading, with what's known about it.
type Placement ¶
Placement is the side of its trigger a tooltip (or any portal placed with elements.RegisterPortalAround) goes.
type Platform ¶
Platform is a set of platforms, for OnlyOn and IsPlatform; PlatformViews an element per platform, for ByPlatform.
type PlatformViews ¶
type PlatformViews = ui.PlatformViews
type PortalFrame ¶
type PortalFrame uint8
PortalFrame selects the frame around a portal window.
const ( // PortalFrameApp follows the main window: the platform's frame, or // Giode's title bar when Config.Frameless is set. The default. PortalFrameApp PortalFrame = iota // PortalFrameOS is the platform's own title bar and borders. PortalFrameOS // PortalFrameTitleBar is a frameless window with Giode's TitleBar // across its top: the portal's title, a drag area and the window // buttons, in the app's theme. PortalOptions.TitleBar adjusts it. PortalFrameTitleBar // PortalFrameNone has no frame at all: the view fills the window // and draws whatever chrome it wants (a TitleBar of its own, a // WindowDragArea) - a floating palette, a splash. PortalFrameNone )
type PortalOptions ¶
type PortalOptions struct {
// Title is the window's title.
Title string
// Size is the window's size in dp; zero is 480x360.
Size image.Point
// MinSize and MaxSize bound its size in dp when set.
MinSize, MaxSize image.Point
// FixedSize keeps it at Size.
FixedSize bool
// Frame selects its frame; PortalFrameApp by default.
Frame PortalFrame
// TitleBar, with PortalFrameTitleBar (or PortalFrameApp in a
// frameless app), adjusts the title bar before it's first shown:
// its variant, menus, icon, styles.
TitleBar func(t *titlebar.TitleBar)
// Background fills the window under the view; empty takes the
// app's Config.Background.
Background properties.Color
// AlwaysOnTop keeps it above other windows.
AlwaysOnTop bool
// Center places it in the middle of the screen.
Center bool
// OnClose runs on the UI goroutine once it closed, whether by the
// user, Close or the app's exit.
OnClose func()
}
PortalOptions configures a portal window; see App.OpenPortal.
type PortalWindow ¶
type PortalWindow struct {
// contains filtered or unexported fields
}
PortalWindow is a window of its own showing part of the app: a tool palette, a detached tab, an inspector on a second screen. It shares the app - its State, its theme and language, Post - and lays its view out in turn with the main window's, so a State changed in one shows in both. Open it with App.OpenPortal.
Phones and the web have one window per app: there a portal covers the main window instead, with a title bar holding the title and a close button, and Back closes it.
func (*PortalWindow) Close ¶
func (w *PortalWindow) Close()
Close closes it. Safe from any goroutine; closing a closed portal does nothing.
func (*PortalWindow) Closed ¶
func (w *PortalWindow) Closed() bool
Closed reports whether it closed.
func (*PortalWindow) Focused ¶
func (w *PortalWindow) Focused() bool
Focused reports whether it has the keyboard focus: the window in front, or for one covering the main window, the main window's.
func (*PortalWindow) Invalidate ¶
func (w *PortalWindow) Invalidate()
Invalidate asks for a new frame of it.
func (*PortalWindow) Maximized ¶
func (w *PortalWindow) Maximized() bool
Maximized reports whether it's maximized.
func (*PortalWindow) Raise ¶
func (w *PortalWindow) Raise()
Raise brings it to the front and gives it focus.
func (*PortalWindow) SetTitle ¶
func (w *PortalWindow) SetTitle(title string)
SetTitle changes its title, in the platform's frame and its title bar.
func (*PortalWindow) ToggleMaximize ¶
func (w *PortalWindow) ToggleMaximize()
ToggleMaximize maximizes it, or restores it when it's maximized.
func (*PortalWindow) Window ¶
func (w *PortalWindow) Window() *app.Window
Window exposes its *app.Window for low-level Gio access; nil where it covers the main window instead.
type Preference ¶
type Preference int
Preference is whether a setting follows the system or is forced.
const ( // PreferenceSystem follows the system's setting, checked as the app // runs. PreferenceSystem Preference = iota // PreferenceOff turns it off whatever the system says. PreferenceOff // PreferenceOn turns it on whatever the system says. PreferenceOn )
type PressState ¶
type PressState = ui.PressState
MemoCache caches a subtree's painted output across frames; see Memo.
type PressableElement ¶
type PressableElement = ui.PressableElement
type ProgressElement ¶
type ProgressElement = ui.ProgressElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type Rect ¶
type Rect struct {
X, Y, Width, Height float32
}
Rect is an area of the desktop in dp: X and Y are its top left corner, from the primary screen's top left.
type Renderer ¶
type Renderer int
Renderer selects the GPU API of the app's window.
const ( // RendererDefault is Gio's choice: Metal on macOS and iOS, Direct3D // 11 on Windows, OpenGL ES elsewhere. RendererDefault Renderer = iota // RendererOpenGL asks for OpenGL (ES) on every platform, for // engines that render with OpenGL (libmpv, most video, 3D and map // engines): on Windows through ANGLE (libEGL.dll and libGLESv2.dll // next to the executable), on macOS and iOS through the nometal // build tag (renderer = "opengl" in giode.toml). RendererOpenGL )
type RichEditorElement ¶
type RichEditorElement = ui.RichEditorElement
RichEditorElement is RichEditor's type.
type RichSubmitMode ¶
type RichSubmitMode = ui.RichSubmitMode
RichSubmitMode is what Enter does in a rich editor; RichSuggester supplies its suggestions.
type RichSuggester ¶
type RichSuggester = ui.RichSuggester
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type RichSuggestion ¶
type RichSuggestion = ui.RichSuggestion
RichSuggestion is an entry of a RichEditor suggestion list.
type RichTextElement ¶
type RichTextElement = ui.RichTextElement
Style value and element types, for declaring variables and helpers that take them.
type RichTextSpan ¶
type RichTextSpan = ui.RichTextSpan
RichTextSpan is one run of a RichText paragraph, made with Span or Link.
type Screen ¶
type Screen struct {
// Bounds is the whole screen.
Bounds Rect
// WorkArea is the part of it windows go in: without the taskbar,
// the Dock and menu bar, or desktop panels.
WorkArea Rect
// Scale is the screen's pixels per dp.
Scale float32
}
Screen describes the screen (monitor) showing the window.
type ScrollAlign ¶
type ScrollAlign = ui.ScrollAlign
type ScrollAnchor ¶
type ScrollAnchor = ui.ScrollAnchor
ScrollAxis selects the directions a Scroll scrolls in, and ScrollAnchor where it keeps growing content; see scroll.Scroll.Axis and Anchor.
type ScrollAxis ¶
type ScrollAxis = ui.ScrollAxis
ScrollAxis selects the directions a Scroll scrolls in, and ScrollAnchor where it keeps growing content; see scroll.Scroll.Axis and Anchor.
type SecureStorage ¶
type SecureStorage struct {
// Service names the app in the credential store, keeping its
// entries apart from other apps'. It defaults to the executable's
// name; set it before first use to something stable, such as a
// reverse-DNS app ID.
Service string
}
SecureStorage keeps small secrets - API keys, tokens - in the platform's credential store rather than a file: the Keychain on iOS and macOS (accessible after first unlock, this device only, on iOS), the Android Keystore (values encrypted with a key that never leaves the device), the Secret Service (GNOME Keyring, KWallet) on Linux, and DPAPI-encrypted files on Windows. Values copied off the device, such as in a backup, can't be read elsewhere.
Use the SecureStore value; its methods may be called from any goroutine, but can block (a Linux keyring may prompt to unlock), so keep them off the UI goroutine.
func (*SecureStorage) Delete ¶
func (s *SecureStorage) Delete(name string) error
Delete removes the value stored under name; deleting a missing name is not an error.
type SemanticContainer ¶
type SemanticContainer = ui.SemanticContainer
type SemanticKind ¶
type SemanticKind = ui.SemanticKind
type SemanticNode ¶
type SemanticNode = ui.SemanticNode
type ShareFiles ¶
type ShareFiles struct {
// it's guessed from the extensions: their shared type, else the
// shared kind ("image/*"), else any.
MIME string
Title string
}
ShareFiles shares several files at once: the pages of a scan as JPEGs, a batch of exports. On desktops it shows the first in the file manager.
type Shareable ¶
type Shareable interface {
// contains filtered or unexported methods
}
Shareable is something App.Share can hand to the system: ShareText, ShareFile or ShareFiles.
type SharedContent ¶
type SharedContent struct {
// they arrive, while Android's permission to read them lasts. Their
// Path is empty. Close each one.
Files []PickedFile
SharedContent is what another app shared with this one through the system share sheet: files, text (a note, a link) or both. See Config.OnShareReceived.
type SheetElement ¶
type SheetElement = ui.SheetElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type SheetMode ¶
SheetMode selects when a Select opens as a bottom sheet; see dropdown.Select.Sheet.
type SingleInstanceLock ¶
type SingleInstanceLock struct {
// UniqueID identifies the application; it must be unique per app.
UniqueID string
// OnSecondInstanceLaunch runs in the second instance in place of
// the UI.
OnSecondInstanceLaunch func()
// OnLaunchArgs runs in the running instance, on the UI goroutine,
// with the command-line arguments (without the program name) of a
// second instance that started and exited - a file opened with the
// app, a URL. The window comes to the front either way. Context
// actions go to Config.OnContextAction instead.
OnLaunchArgs func(args []string)
}
SingleInstanceLock prevents a second instance of the application from running. When a second instance launches, its OnSecondInstanceLaunch callback runs and the instance exits without showing a window.
type SkipLinkElement ¶
type SkipLinkElement = ui.SkipLinkElement
SkipLinkElement is the link SkipLink returns.
type SpinnerElement ¶
type SpinnerElement = ui.SpinnerElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type StartInTray ¶
type StartInTray int
StartInTray says when the app starts with its window hidden in the tray (Config.StartInTray).
const ( // StartInTrayNever shows the window at start (the default). StartInTrayNever StartInTray = iota // StartInTrayAtLogin starts in the tray when the app was started at // login, and shows the window when the user opens it. StartInTrayAtLogin // StartInTrayAlways always starts in the tray. StartInTrayAlways )
type State ¶
State is a minimal global-state primitive: an observable value readable/writable from anywhere, including a goroutine outside the render loop (a network response, a timer), not just from within a Layout call. Create it with NewState.
func NamedState ¶
NamedState returns a State registered under name, so tooling - the MCP server's state_list/state_set tools - can read and set it. T must be JSON-encodable for that.
type StyleTransition ¶
type StyleTransition = ui.StyleTransition
type SubmitMode ¶
type SubmitMode = ui.SubmitMode
SubmitMode selects which keys submit an Input; see input.Input.SubmitOn.
type SwipeAction ¶
type SwipeAction = ui.SwipeAction
SwipeAction is a button revealed behind a Swipeable row.
type SwipeableElement ¶
type SwipeableElement = ui.SwipeableElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type TabsElement ¶
type TabsElement = ui.TabsElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type TerminalElement ¶
type TerminalElement = ui.TerminalElement
TerminalElement is the element Terminal returns; TerminalPalette its colors.
type TerminalPalette ¶
type TerminalPalette = ui.TerminalPalette
TerminalElement is the element Terminal returns; TerminalPalette its colors.
type TextAnchor ¶
type TextAnchor = ui.TextAnchor
Style value and element types, for declaring variables and helpers that take them.
type TextDecoration ¶
type TextDecoration = ui.TextDecoration
Style value and element types, for declaring variables and helpers that take them.
type TextElement ¶
type TextElement = ui.TextElement
Style value and element types, for declaring variables and helpers that take them.
type TextOverflow ¶
type TextOverflow = ui.TextOverflow
type TextTransform ¶
type TextTransform = ui.TextTransform
type TimePickerElement ¶
type TimePickerElement = ui.TimePickerElement
DatePickerElement and the others are the date and time fields' types.
type TitleBarButton ¶
type TitleBarButton = ui.TitleBarButton
type TitleBarElement ¶
type TitleBarElement = ui.TitleBarElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type TitleBarPlacement ¶
type TitleBarPlacement = ui.TitleBarPlacement
type TitleBarVariant ¶
type TitleBarVariant = ui.TitleBarVariant
type TitleBarWindow ¶
type TitleBarWindow = ui.TitleBarWindow
type ToastPlacement ¶
type ToastPlacement = ui.ToastPlacement
type ToasterElement ¶
type ToasterElement = ui.ToasterElement
type TooltipElement ¶
type TooltipElement = ui.TooltipElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
type Transcript ¶
Transcript is one result of Dictate: the text recognized so far, replaced by each later result, until the Final one.
type TransitionElement ¶
type TransitionElement = ui.TransitionElement
type TransitionKind ¶
type TransitionKind = ui.TransitionKind
type Tray ¶
type Tray struct {
// contains filtered or unexported fields
}
Tray is the app's icon in the system tray: the notification area on Windows, the menu bar on macOS (where it can show text too) and the status notifier area on Linux desktops that have one (KDE, most others with an extension; GNOME needs the AppIndicator extension). Get it with App.Tray; it appears once something is set on it:
app.Tray().
SetIcon(iconPNG).
SetTooltip("Pocket Agent").
SetMenu(
giode.TrayAction("Open", app.ShowWindow),
giode.TraySeparator(),
giode.TrayAction("Quit", app.Quit),
)
On Windows and Linux, clicking the icon shows or hides the window unless OnClick says otherwise, and the menu opens with a right-click. On macOS, as menu bar items do, a click opens the menu (or runs OnClick when set). Config.MinimizeToTray and Config.CloseToTray hide the window to the tray instead of minimizing or closing it.
Methods may be called from any goroutine, menu and click callbacks included, and never wait for the tray: changes reach it a moment later, in order. Menu and click callbacks run on the UI goroutine. On Android, iOS and the web the tray does nothing: TraySupported reports false.
func (*Tray) OnClick ¶
OnClick sets what a click on the icon does, on the UI goroutine. By default it shows the window, or hides it when it's showing - except on macOS, where a click opens the menu unless OnClick is set.
func (*Tray) SetIcon ¶
SetIcon sets the icon from PNG bytes. Without one the tray uses Config.Icon. Small icons work best: 32x32 or 64x64.
func (*Tray) SetTemplateIcon ¶
SetTemplateIcon sets an icon that macOS tints to match the menu bar, light or dark: PNG bytes, black shapes on transparency. Elsewhere it is a plain icon.
func (*Tray) SetTitle ¶
SetTitle sets text shown next to the icon: in the macOS menu bar, and on Linux panels that show it. Use it for live information - an unread count, a timer, a status. Windows doesn't show it; set the tooltip there.
func (*Tray) SetTooltip ¶
SetTooltip sets the text shown when the pointer rests on the icon.
type TrayItem ¶
type TrayItem struct {
// Label is the item's text.
Label string
// Tooltip is shown on hover where the platform supports it.
Tooltip string
// Disabled greys the item out.
Disabled bool
// Checkable shows a check mark when Checked.
Checkable, Checked bool
// Separator makes the item a divider line; the other fields are
// ignored.
Separator bool
// Items makes the item a submenu.
Items []TrayItem
// OnClick runs on the UI goroutine when the item is chosen.
OnClick func()
}
TrayItem is an entry of the tray's menu. Build them with TrayAction, TrayCheckbox, TraySeparator and TraySubmenu, or fill in the fields.
func TrayAction ¶
TrayAction returns a menu item running fn.
func TrayCheckbox ¶
TrayCheckbox returns a menu item with a check mark when checked. It doesn't toggle itself: fn updates your state, and the next SetMenu shows it.
func TraySubmenu ¶
TraySubmenu returns a submenu of items.
type TreeRowState ¶
type TreeRowState = ui.TreeRowState
type TreeViewElement ¶
type TreeViewElement = ui.TreeViewElement
type VirtualListElement ¶
type VirtualListElement = ui.VirtualListElement
type Visibility ¶
type Visibility = ui.Visibility
type Watch ¶
type Watch[T comparable] = ui.Watch[T]
Watch tracks the fields a component caching its own output draws from; see MemoCache.LayoutOwn.
type WindowStartState ¶
type WindowStartState int
WindowStartState selects the initial state of the window.
const ( // WindowStartNormal starts the window in its normal state. WindowStartNormal WindowStartState = iota // WindowStartMinimized starts the window minimized. WindowStartMinimized // WindowStartMaximized starts the window maximized. WindowStartMaximized // WindowStartFullscreen starts the window fullscreen. WindowStartFullscreen )
type WindowState ¶
type WindowState int
WindowState is the current state of the window, as reported by the platform. It changes through App methods (Maximize, Minimize, SetFullscreen, ...) as well as through the user (a double-click on the title bar, snapping, the taskbar).
const ( // WindowNormal is a regular, restored window. WindowNormal WindowState = iota // WindowMinimized is a window minimized to the taskbar or dock. WindowMinimized // WindowMaximized fills the available screen area. WindowMaximized // WindowFullscreen covers the whole screen. WindowFullscreen )
type ZoomElement ¶
type ZoomElement = ui.ZoomElement
The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).
Source Files
¶
- a11ypref.go
- app.go
- appauth.go
- appwindow.go
- clipboard.go
- clipboardimage.go
- closereq.go
- config.go
- contextactions.go
- contextserver.go
- device.go
- dictate.go
- downloads.go
- drag.go
- elevate.go
- filedrag.go
- files.go
- framerate.go
- frametimes.go
- giode.go
- glread.go
- haptic.go
- host.go
- icon.go
- insets.go
- intl.go
- invalidate.go
- keepawake.go
- login.go
- mcp.go
- menubar.go
- motion.go
- native.go
- notify.go
- openedurl.go
- openurl.go
- openwith.go
- passkey.go
- photos.go
- pick.go
- pickfolder.go
- pickmedia.go
- portal.go
- post.go
- power.go
- reexport.go
- securestore.go
- share.go
- sharetarget.go
- singleinstance.go
- sound.go
- systembars.go
- systemtheme.go
- tray.go
- underlay.go
- version.go
- windowpos.go
- windowstate.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package android calls Java from Go on Android: static methods of the app's own classes (from a jar in one of its packages, which giode build adds to the APK) and of the Android SDK, through the app's class loader.
|
Package android calls Java from Go on Android: static methods of the app's own classes (from a jar in one of its packages, which giode build adds to the APK) and of the Android SDK, through the app's class loader. |
|
Package audio streams the microphone and the speaker: capture for recording, dictation and calls, playback for calls and generated sound, with device selection.
|
Package audio streams the microphone and the speaker: capture for recording, dictation and calls, playback for calls and generated sound, with device selection. |
|
Package auth signs people in with OAuth 2.0 and OpenID Connect: Google, Microsoft (Entra ID), Okta, Auth0, Keycloak, any identity provider, and through them SAML-backed company SSO.
|
Package auth signs people in with OAuth 2.0 and OpenID Connect: Google, Microsoft (Entra ID), Okta, Auth0, Keycloak, any identity provider, and through them SAML-backed company SSO. |
|
Package background runs the app's work while it isn't on screen: a sync every hour or so, a cleanup at night while charging.
|
Package background runs the app's work while it isn't on screen: a sync every hour or so, a cleanup at night while charging. |
|
Package biometric unlocks an app with the fingerprint reader or face recognition, as an app lock does:
|
Package biometric unlocks an app with the fingerprint reader or face recognition, as an app lock does: |
|
Package camera shows a live camera preview inside a Giode view and takes full-resolution pictures: a document scanner's viewfinder, a QR scanner, a photo booth.
|
Package camera shows a live camera preview inside a Giode view and takes full-resolution pictures: a document scanner's viewfinder, a QR scanner, a photo booth. |
|
components
|
|
|
accordion
Package accordion provides a stateful list of expand/collapse sections.
|
Package accordion provides a stateful list of expand/collapse sections. |
|
appshell
Package appshell provides a full-window application layout: an optional fixed header, navbar, aside and footer around a main content area that's automatically offset so it never sits under them.
|
Package appshell provides a full-window application layout: an optional fixed header, navbar, aside and footer around a main content area that's automatically offset so it never sits under them. |
|
autocomplete
Package autocomplete provides a stateful text field with a filtered, portal-rendered list of suggestions.
|
Package autocomplete provides a stateful text field with a filtered, portal-rendered list of suggestions. |
|
avatar
Package avatar provides avatars: a person's or assistant's picture, or their initials on a color derived from their name, in a circle.
|
Package avatar provides avatars: a person's or assistant's picture, or their initials on a color derived from their name, in a circle. |
|
badge
Package badge provides badges: small counters or dots, alone or pinned to the corner of another element.
|
Package badge provides badges: small counters or dots, alone or pinned to the corner of another element. |
|
button
Package button provides a stateful clickable button component built on the stateless elements.
|
Package button provides a stateful clickable button component built on the stateless elements. |
|
calendarview
Package calendarview provides calendar views of events: a month, a week, a day and an agenda, with overlapping events side by side, all-day and multi-day events in bars, dragging to create, move and resize events, the current time, and time zones.
|
Package calendarview provides calendar views of events: a month, a week, a day and an agenda, with overlapping events side by side, all-day and multi-day events in bars, dragging to create, move and resize events, the current time, and time zones. |
|
chart
Package chart draws charts: line, area, bar (grouped, stacked, horizontal), pie and donut, funnel, scatter and bubble, gauge, heatmap and sparklines, with axes, legends, tooltips, selection, brushing, zoom and pan, animated data changes, theme colors, right-to-left layout and a data table for screen readers.
|
Package chart draws charts: line, area, bar (grouped, stacked, horizontal), pie and donut, funnel, scatter and bubble, gauge, heatmap and sparklines, with axes, legends, tooltips, selection, brushing, zoom and pan, animated data changes, theme colors, right-to-left layout and a data table for screen readers. |
|
checkbox
Package checkbox provides a stateful checkbox with an optional label.
|
Package checkbox provides a stateful checkbox with an optional label. |
|
chip
Package chip provides chips: small rounded labels for filters, tags and choices, optionally selectable and removable.
|
Package chip provides chips: small rounded labels for filters, tags and choices, optionally selectable and removable. |
|
colorpicker
Package colorpicker provides a color picker: a saturation and brightness square, a hue bar, an optional alpha bar, a hex field and preset swatches.
|
Package colorpicker provides a color picker: a saturation and brightness square, a hue bar, an optional alpha bar, a hex field and preset swatches. |
|
combobox
Package combobox provides searchable selection inputs: Combobox picks one option from a list or an asynchronous source as the user types, MultiSelect picks several as removable chips (a tag input when it may create new ones), and List is their keyboard-driven option panel, also used by the command palette.
|
Package combobox provides searchable selection inputs: Combobox picks one option from a list or an asynchronous source as the user types, MultiSelect picks several as removable chips (a tag input when it may create new ones), and List is their keyboard-driven option panel, also used by the command palette. |
|
copybutton
Package copybutton provides a button that copies text to the clipboard and briefly confirms it with a check mark.
|
Package copybutton provides a button that copies text to the clipboard and briefly confirms it with a check mark. |
|
datagrid
Package datagrid provides DataGrid: a virtualized table for large data sets - pipelines, contact lists, reports, issue lists - with a header that stays at the top, frozen leading columns, resizable columns, sorting on one or several columns, row selection by click, Shift, Ctrl/Cmd and checkboxes, keyboard navigation and copying rows as tab-separated text.
|
Package datagrid provides DataGrid: a virtualized table for large data sets - pipelines, contact lists, reports, issue lists - with a header that stays at the top, frozen leading columns, resizable columns, sorting on one or several columns, row selection by click, Shift, Ctrl/Cmd and checkboxes, keyboard navigation and copying rows as tab-separated text. |
|
datepicker
Package datepicker provides date and time inputs: a month calendar (DateCalendar), a date field with a calendar popover (DatePicker), a range of dates (DateRangePicker), a time field (TimePicker) and a date and time together (DateTimeField).
|
Package datepicker provides date and time inputs: a month calendar (DateCalendar), a date field with a calendar popover (DatePicker), a range of dates (DateRangePicker), a time field (TimePicker) and a date and time together (DateTimeField). |
|
dialog
Package dialog provides a stateful centered modal dialog.
|
Package dialog provides a stateful centered modal dialog. |
|
drawer
Package drawer provides a stateful slide-out side panel.
|
Package drawer provides a stateful slide-out side panel. |
|
dropdown
Package dropdown provides a stateful dropdown.
|
Package dropdown provides a stateful dropdown. |
|
emojipicker
Package emojipicker provides an emoji picker: a searchable grid of Unicode's emoji by category, with skin tones and recently used ones first.
|
Package emojipicker provides an emoji picker: a searchable grid of Unicode's emoji by category, with skin tones and recently used ones first. |
|
icon
Package icon renders icons you bring: Giode ships no icon set, so an app only carries the icons it actually uses, under whatever license it picked them.
|
Package icon renders icons you bring: Giode ships no icon set, so an app only carries the icons it actually uses, under whatever license it picked them. |
|
imageutil
Package imageutil renders plain images with fit modes.
|
Package imageutil renders plain images with fit modes. |
|
kit
Package kit provides the small building blocks used to create custom components: color state shading, hover tracking and overlay positioning (used by elements.RegisterPortal to keep click/hover popups inside the window).
|
Package kit provides the small building blocks used to create custom components: color state shading, hover tracking and overlay positioning (used by elements.RegisterPortal to keep click/hover popups inside the window). |
|
licenses
Package licenses shows the open-source licenses of the modules an app is built from: the notices screen app stores and licenses ask for.
|
Package licenses shows the open-source licenses of the modules an app is built from: the notices screen app stores and licenses ask for. |
|
numberinput
Package numberinput provides a numeric field with − and + steppers, a range and a step.
|
Package numberinput provides a numeric field with − and + steppers, a range and a step. |
|
pagination
Package pagination provides a stateful page-number control built on Button.
|
Package pagination provides a stateful page-number control built on Button. |
|
palette
Package palette provides a command palette: a search box over the app's commands, opened with Mod+K (Command+K on Apple systems, Ctrl+K elsewhere), that runs the one picked.
|
Package palette provides a command palette: a search box over the app's commands, opened with Mod+K (Command+K on Apple systems, Ctrl+K elsewhere), that runs the one picked. |
|
progress
Package progress provides a determinate progress bar.
|
Package progress provides a determinate progress bar. |
|
richedit
Package richedit is Giode's rich text editor: paragraphs, headings, lists, checklists, quotes, code, tables, images and rules, with inline formatting, mentions and other atoms, Markdown shortcuts, slash commands, undo, and Markdown, JSON and HTML in and out.
|
Package richedit is Giode's rich text editor: paragraphs, headings, lists, checklists, quotes, code, tables, images and rules, with inline formatting, mentions and other atoms, Markdown shortcuts, slash commands, undo, and Markdown, JSON and HTML in and out. |
|
skiplink
Package skiplink provides landmarks - the large parts of a window, such as the navigation and the main content - and skip links, which let a keyboard user jump past the navigation straight to a landmark.
|
Package skiplink provides landmarks - the large parts of a window, such as the navigation and the main content - and skip links, which let a keyboard user jump past the navigation straight to a landmark. |
|
slider
Package slider provides a stateful horizontal slider.
|
Package slider provides a stateful horizontal slider. |
|
spinner
Package spinner provides an indeterminate circular loading indicator.
|
Package spinner provides an indeterminate circular loading indicator. |
|
tabs
Package tabs provides a stateful tab bar with per-tab views.
|
Package tabs provides a stateful tab bar with per-tab views. |
|
terminal
Package terminal is a terminal: a VT100/xterm emulator (Emulator), the key and mouse encodings programs expect, and Terminal, the element that draws one and takes the keyboard for it, running a shell or any program in a pseudo-terminal (package pty) or fed by the app (an SSH session, a serial port).
|
Package terminal is a terminal: a VT100/xterm emulator (Emulator), the key and mouse encodings programs expect, and Terminal, the element that draws one and takes the keyboard for it, running a shell or any program in a pseudo-terminal (package pty) or fed by the app (an SSH session, a serial port). |
|
title
Package title provides heading text.
|
Package title provides heading text. |
|
toggle
Package toggle provides an on/off switch with an animated knob, the standard settings control on iOS and Android.
|
Package toggle provides an on/off switch with an animated knob, the standard settings control on iOS and Android. |
|
Package crash records the app's crashes and hands them back on the next start, to show the user or send to you.
|
Package crash records the app's crashes and hands them back on the next start, to show the user or send to you. |
|
Package datetime holds what dates and times need beyond the time package: calendar systems (Gregorian, Persian, or an app's own), locale conventions (first day of the week, 12 or 24 hours, month and weekday names, date patterns, digits), formatting, relative times ("in 2 days", "yesterday"), time zones, and day arithmetic that daylight saving doesn't break.
|
Package datetime holds what dates and times need beyond the time package: calendar systems (Gregorian, Persian, or an app's own), locale conventions (first day of the week, 12 or 24 hours, month and weekday names, date patterns, digits), formatting, relative times ("in 2 days", "yesterday"), time zones, and day arithmetic that daylight saving doesn't break. |
|
Package dictate transcribes speech from the microphone, for a microphone button in a composer:
|
Package dictate transcribes speech from the microphone, for a microphone button in a composer: |
|
Package elements provides the stateless building blocks of Giode: box, flex, text and raw.
|
Package elements provides the stateless building blocks of Giode: box, flex, text and raw. |
|
dnd
Package dnd is in-app drag and drop: Draggable sources, DropTarget areas that accept them, insertion slots in lists (ListItem), a preview that follows the pointer or finger, auto-scrolling of the scroll containers under it, and a keyboard way to do the same.
|
Package dnd is in-app drag and drop: Draggable sources, DropTarget areas that accept them, insertion slots in lists (ListItem), a preview that follows the pointer or finger, auto-scrolling of the scroll containers under it, and a keyboard way to do the same. |
|
internal/base
Package base provides the shared runtime every element package is built on: the Element interface, the frame and color helpers, the absolute-position, portal, semantic and Back/OnKey registries, and the keyed and memo caches.
|
Package base provides the shared runtime every element package is built on: the Element interface, the frame and color helpers, the absolute-position, portal, semantic and Back/OnKey registries, and the keyed and memo caches. |
|
platform
Package platform shows elements only on some platforms:
|
Package platform shows elements only on some platforms: |
|
examples
|
|
|
attach
command
Command attach is an "attach a photo" row: take one with the camera (package takephoto, which an app imports only when it takes photos) or pick one from the library (core giode).
|
Command attach is an "attach a photo" row: take one with the camera (package takephoto, which an app imports only when it takes photos) or pick one from the library (core giode). |
|
call
command
Command call rings itself and, once answered, runs a video call over WebRTC between two peers inside the app: the microphone and camera go out through one, come back through the other and play on the speaker and screen, so you hear and see yourself as the other side would.
|
Command call rings itself and, once answered, runs a video call over WebRTC between two peers inside the app: the microphone and camera go out through one, come back through the other and play on the speaker and screen, so you hear and see yourself as the other side would. |
|
custom
command
Command custom demonstrates creating a custom component with the component kit: a clickable star rating built on the stateless elements, Gio's clickable and the kit helpers.
|
Command custom demonstrates creating a custom component with the component kit: a clickable star rating built on the stateless elements, Gio's clickable and the kit helpers. |
|
dictation
command
Command dictation is a note field with a microphone button: hold a thought, tap the button, speak.
|
Command dictation is a note field with a microphone button: hold a thought, tap the button, speak. |
|
hello
command
Command hello is a minimal Giode demo: a frameless, draggable window with a counter button and a global right-click menu.
|
Command hello is a minimal Giode demo: a frameless, draggable window with a counter button and a global right-click menu. |
|
inbox
command
Command inbox shows rich notifications: a message with Like and Reply buttons, threads that group by conversation, a quiet channel, and the badge count.
|
Command inbox shows rich notifications: a message with Like and Reply buttons, threads that group by conversation, a quiet channel, and the badge count. |
|
mcp
command
Command mcp is a small todo app exposed to AI agents through Giode's built-in MCP server: one option turns it on, and one call adds a custom tool next to the built-in ones (ui_snapshot, ui_click, ui_type, ui_set_value, screenshot, state_list, state_set, ...).
|
Command mcp is a small todo app exposed to AI agents through Giode's built-in MCP server: one option turns it on, and one call adds a custom tool next to the built-in ones (ui_snapshot, ui_click, ui_type, ui_set_value, screenshot, state_list, state_set, ...). |
|
player
command
Command player plays a video or audio file, or a URL, with the media package's controls: play and pause, seeking, speed, volume and SRT or WebVTT captions.
|
Command player plays a video or audio file, or a URL, with the media package's controls: play and pause, seeking, speed, volume and SRT or WebVTT captions. |
|
scanner
command
Command scanner is a small document scanner built on Giode's camera, OCR, printing and biometric packages.
|
Command scanner is a small document scanner built on Giode's camera, OCR, printing and biometric packages. |
|
screenshare
command
Command screenshare captures a display and shows it live, the way a call would share it: pick a display, start, and frames stream in at the chosen rate.
|
Command screenshare captures a display and shows it live, the way a call would share it: pick a display, start, and frames stream in at the chosen rate. |
|
showcase
command
|
|
|
titlebar
command
Command titlebar shows a frameless window with Giode's custom title bar: drag it to move the window, double-click it to maximize, use the File menu, and switch between the Windows and Mac looks.
|
Command titlebar shows a frameless window with Giode's custom title bar: drag it to move the window, double-click it to maximize, use the File menu, and switch between the Windows and Mac looks. |
|
tour
command
Command tour is a small task list: a sidebar, a progress card, a text field and checkable rows, styled with CSS-like properties and following the light or dark theme.
|
Command tour is a small task list: a sidebar, a progress card, a text field and checkable rows, styled with CSS-like properties and following the light or dark theme. |
|
transitions
command
Command transitions shows every built-in transition kind, with the speed and easing chosen from the toolbar.
|
Command transitions shows every built-in transition kind, with the speed and easing chosen from the toolbar. |
|
voicememo
command
Command voicememo records the microphone and plays it back, with a level meter, a device picker and an echo test that hears itself through a voice stream's echo cancellation.
|
Command voicememo records the microphone and plays it back, with a level meter, a device picker and an echo test that hears itself through a voice stream's echo cancellation. |
|
workbench
command
Command workbench exercises the interactive building blocks together: browse folders in a lazily loaded TreeView, drop files onto the window to list them in a VirtualList, click rows (Pressable, Keyed state), copy a path (clipboard), and get notified with toasts.
|
Command workbench exercises the interactive building blocks together: browse folders in a lazily loaded TreeView, drop files onto the window to list them in a VirtualList, click rows (Pressable, Keyed state), copy a path (clipboard), and get notified with toasts. |
|
Package fonts holds the text shaper shared by all Giode elements.
|
Package fonts holds the text shaper shared by all Giode elements. |
|
Package form validates and tracks a form's fields: rules per field (required, lengths, email, patterns, matching another field), errors shown after the user leaves a field or tries to submit, a summary of what's wrong, required markers, and whether anything changed since it was loaded or saved.
|
Package form validates and tracks a form's fields: rules per field (required, lengths, email, patterns, matching another field), errors shown after the user leaves a field or tries to submit, a summary of what's wrong, required markers, and whether anything changed since it was loaded or saved. |
|
Package formula typesets mathematics written in LaTeX notation: fractions, roots, superscripts and subscripts, sums and integrals with their limits, delimiters sized to what they enclose, accents (vectors, hats, dots), Greek, and lines aligned at & for derivations.
|
Package formula typesets mathematics written in LaTeX notation: fractions, roots, superscripts and subscripts, sums and integrals with their limits, delimiters sized to what they enclose, accents (vectors, hats, dots), Greek, and lines aligned at & for derivations. |
|
Package gallery saves pictures and videos to the device's photo gallery, where photo apps show them: a scanned page exported as JPEG, say.
|
Package gallery saves pictures and videos to the device's photo gallery, where photo apps show them: a scanned page exported as JPEG, say. |
|
Package host has the platform services of giode.App that don't need its window, for apps that host Giode themselves - in a GLFW window, as an embedded view (see docs/low-level.md): keeping the screen on, the single-instance lock, and the clipboard bridge between Gio's input router and the host's clipboard.
|
Package host has the platform services of giode.App that don't need its window, for apps that host Giode themselves - in a GLFW window, as an embedded view (see docs/low-level.md): keeping the screen on, the single-instance lock, and the clipboard bridge between Gio's input router and the host's clipboard. |
|
Package i18n translates an app's text and tells its layout which way to read: messages by locale with plurals and placeholders, the system's locale, and right-to-left languages.
|
Package i18n translates an app's text and tells its layout which way to read: messages by locale with plurals and placeholders, the system's locale, and right-to-left languages. |
|
internal
|
|
|
bridge
Package bridge helps giode's platform packages (push, store, review) call into Java and Objective-C: asynchronous requests answered by a callback with an id, and, on Android, static Java calls.
|
Package bridge helps giode's platform packages (push, store, review) call into Java and Objective-C: asynchronous requests answered by a callback with an id, and, on Android, static Java calls. |
|
cmd/reexport
command
Command reexport writes the root giode package's reexport.go: an alias for every exported name of package ui, so `giode.Box` and `ui.Box` are the same thing and a custom host can import ui without the root package's App (and gioui.org/app).
|
Command reexport writes the root giode package's reexport.go: an alias for every exported name of package ui, so `giode.Box` and `ui.Box` are the same thing and a custom host can import ui without the root package's App (and gioui.org/app). |
|
cmd/skilldocs
command
Command skilldocs copies the documentation (docs/, without the contributor-only pages) into the agent skill's references folder, skills/giode/references, so the skill carries the docs wherever it's installed.
|
Command skilldocs copies the documentation (docs/, without the contributor-only pages) into the agent skill's references folder, skills/giode/references, so the skill carries the docs wherever it's installed. |
|
linear
Package linear prepares images with transparency for Gio's GPU renderer, which decodes textures from sRGB and blends in linear light: their pixels must be premultiplied in linear light, then encoded.
|
Package linear prepares images with transparency for Gio's GPU renderer, which decodes textures from sRGB and blends in linear light: their pixels must be premultiplied in linear light, then encoded. |
|
mathhook
Package mathhook connects Markdown to the formula package without importing it: package formula registers its renderer when imported, so apps that don't set formulas don't carry the math font.
|
Package mathhook connects Markdown to the formula package without importing it: package formula registers its renderer when imported, so apps that don't set formulas don't carry the math font. |
|
mcpbridge
Package mcpbridge is the built-in MCP server of giode apps (Config.MCP): tools that let an agent see and drive the running UI.
|
Package mcpbridge is the built-in MCP server of giode apps (Config.MCP): tools that let an agent see and drive the running UI. |
|
mobile
Package mobile reaches the Android services Gio doesn't expose - the system share sheet and the activity lifecycle - through a small Java helper (mobile_android.java, shipped as mobile_android.jar, which gogio packs into the APK).
|
Package mobile reaches the Android services Gio doesn't expose - the system share sheet and the activity lifecycle - through a small Java helper (mobile_android.java, shipped as mobile_android.jar, which gogio packs into the APK). |
|
optin
Package optin connects the core package to the opt-in packages that hold the platform code of features touching privacy-sensitive APIs: dictate, takephoto and gallery.
|
Package optin connects the core package to the opt-in packages that hold the platform code of features touching privacy-sensitive APIs: dictate, takephoto and gallery. |
|
platform
Package platform holds what giode's platform packages share: the errors the root package re-exports.
|
Package platform holds what giode's platform packages share: the errors the root package re-exports. |
|
platform/a11y
Package a11y exposes the UI's semantic tree to the platform's accessibility services: UI Automation, AT-SPI, NSAccessibility and UIAccessibility, and Android's AccessibilityNodeProvider.
|
Package a11y exposes the UI's semantic tree to the platform's accessibility services: UI Automation, AT-SPI, NSAccessibility and UIAccessibility, and Android's AccessibilityNodeProvider. |
|
platform/clipimage
Package clipimage reads images from the system clipboard.
|
Package clipimage reads images from the system clipboard. |
|
platform/ctxmenu
Package ctxmenu installs the app's actions in file managers' context menus: Explorer, Finder's Services, Nautilus, Dolphin, Caja and Nemo.
|
Package ctxmenu installs the app's actions in file managers' context menus: Explorer, Finder's Services, Nautilus, Dolphin, Caja and Nemo. |
|
platform/dirs
Package dirs finds the user's folders: Downloads, Pictures.
|
Package dirs finds the user's folders: Downloads, Pictures. |
|
platform/filedrag
Package filedrag carries file drags between the app's window and the system: files dragged in from the file manager, and Draggable.Export dragging out.
|
Package filedrag carries file drags between the app's window and the system: files dragged in from the file manager, and Draggable.Export dragging out. |
|
platform/giopatch
Package giopatch connects giode to the Gio patches the giode CLI builds with (the giode_gio* build tags): the window's first color, the keyboard's return key, AutoFill hints.
|
Package giopatch connects giode to the Gio patches the giode CLI builds with (the giode_gio* build tags): the window's first color, the keyboard's return key, AutoFill hints. |
|
platform/gl
Package gl finds OpenGL functions and reads framebuffers, for Config.Underlay.
|
Package gl finds OpenGL functions and reads framebuffers, for Config.Underlay. |
|
platform/lifecycle
Package lifecycle reports the app going to the background and coming back, where the system rather than the window says so.
|
Package lifecycle reports the app going to the background and coming back, where the system rather than the window says so. |
|
platform/login
Package login registers the app to start when the user signs in.
|
Package login registers the app to start when the user signs in. |
|
platform/menubar
Package menubar installs the macOS menu bar.
|
Package menubar installs the macOS menu bar. |
|
platform/notify
Package notify shows simple notifications.
|
Package notify shows simple notifications. |
|
platform/picker
Package picker shows the system's pickers: files, folders, photos and media.
|
Package picker shows the system's pickers: files, folders, photos and media. |
|
platform/power
Package power reports the computer going to sleep and waking.
|
Package power reports the computer going to sleep and waking. |
|
platform/prefs
Package prefs reads the user's system preferences: dark mode, reduced motion, contrast, bold text and text size.
|
Package prefs reads the user's system preferences: dark mode, reduced motion, contrast, bold text and text size. |
|
platform/sandbox
Package sandbox has what the macOS App Sandbox needs: the APIs it allows for opening files and URLs and for login items, and bookmarks keeping access to folders the user chose.
|
Package sandbox has what the macOS App Sandbox needs: the APIs it allows for opening files and URLs and for login items, and bookmarks keeping access to folders the user chose. |
|
platform/sharetarget
Package sharetarget receives what other apps share with this one.
|
Package sharetarget receives what other apps share with this one. |
|
platform/shell
Package shell opens files, folders and URLs in the system's apps.
|
Package shell opens files, folders and URLs in the system's apps. |
|
platform/signin
Package signin runs the platform's sign-in sheets and passkey prompts.
|
Package signin runs the platform's sign-in sheets and passkey prompts. |
|
platform/sound
Package sound plays short WAV sounds on each platform, for giode.App.PlaySound.
|
Package sound plays short WAV sounds on each platform, for giode.App.PlaySound. |
|
platform/speech
Package speech transcribes the microphone with the platform's speech recognizer.
|
Package speech transcribes the microphone with the platform's speech recognizer. |
|
platform/systray
Package systray shows the app's icon and menu in the system tray (the notification area, the macOS menu bar, a StatusNotifierItem).
|
Package systray shows the app's icon and menu in the system tray (the notification area, the macOS menu bar, a StatusNotifierItem). |
|
platform/window
Package window places the app's window and sets its native chrome: position and screen, always on top, transparency and title bar buttons.
|
Package window places the app's window and sets its native chrome: position and screen, always on top, transparency and title bar buttons. |
|
raster
Package raster rasterizes vector shapes - icons, glyphs - into images on the CPU, once, so they're drawn as cached textures instead of paths the GPU renderer rasterizes again every frame.
|
Package raster rasterizes vector shapes - icons, glyphs - into images on the CPU, once, so they're drawn as cached textures instead of paths the GPU renderer rasterizes again every frame. |
|
textrender
Package textrender lays out and draws text for giode's text elements.
|
Package textrender lays out and draws text for giode's text elements. |
|
webauthn
Package webauthn reads WebAuthn's JSON options (what a server's generateRegistrationOptions or BeginLogin returns, as PublicKeyCredentialCreationOptionsJSON and RequestOptionsJSON) and writes the credentials platforms return in the JSON servers verify.
|
Package webauthn reads WebAuthn's JSON options (what a server's generateRegistrationOptions or BeginLogin returns, as PublicKeyCredentialCreationOptionsJSON and RequestOptionsJSON) and writes the credentials platforms return in the JSON servers verify. |
|
winrt
Package winrt calls the few Windows Runtime APIs giode needs (toast notifications, push channels) without a projection: activation factories, HSTRINGs, vtable calls and polling of async operations.
|
Package winrt calls the few Windows Runtime APIs giode needs (toast notifications, push channels) without a projection: activation factories, HSTRINGs, vtable calls and polling of async operations. |
|
Package mcp is a small, dependency-free Model Context Protocol server: tools described by Go functions, served over Streamable HTTP or stdio.
|
Package mcp is a small, dependency-free Model Context Protocol server: tools described by Go functions, served over Streamable HTTP or stdio. |
|
Package media plays audio and video files and streams on each platform's own engine: AVPlayer on iOS and macOS, MediaPlayer on Android, Media Foundation's media engine on Windows and GStreamer on Linux (loaded when a player opens; nothing is needed to build).
|
Package media plays audio and video files and streams on each platform's own engine: AVPlayer on iOS and macOS, MediaPlayer on Android, Media Foundation's media engine on Windows and GStreamer on Linux (loaded when a player opens; nothing is needed to build). |
|
Package multicast lets an Android app receive multicast and broadcast packets: LAN discovery (mDNS, SSDP, LocalSend's multicast announcements) that Android otherwise filters out on Wi-Fi to save battery.
|
Package multicast lets an Android app receive multicast and broadcast packets: LAN discovery (mDNS, SSDP, LocalSend's multicast announcements) that Android otherwise filters out on Wi-Fi to save battery. |
|
Package notification shows system notifications with more than a title and a body: buttons, a reply field, grouping by conversation, channels the user can tune, replacing and removing notifications, and the app icon's badge count.
|
Package notification shows system notifications with more than a title and a body: buttons, a reply field, grouping by conversation, channels the user can tune, replacing and removing notifications, and the app icon's badge count. |
|
Package ocr recognises text in images on the device: no network, no account.
|
Package ocr recognises text in images on the device: no network, no account. |
|
Package printing prints documents through the system's print dialog:
|
Package printing prints documents through the system's print dialog: |
|
Package pty runs a program in a pseudo-terminal: the program sees a terminal (a shell prompts, colors and full-screen programs work, Ctrl+C interrupts) while the app reads what it draws and writes what's typed.
|
Package pty runs a program in a pseudo-terminal: the program sees a terminal (a shell prompts, colors and full-screen programs work, Ctrl+C interrupts) while the app reads what it draws and writes what's typed. |
|
Package push receives remote push notifications: Firebase Cloud Messaging (FCM) on Android, the Apple Push Notification service (APNs) on iOS and macOS, the Windows Push Notification Services (WNS) on Windows, and UnifiedPush on Linux.
|
Package push receives remote push notifications: Firebase Cloud Messaging (FCM) on Android, the Apple Push Notification service (APNs) on iOS and macOS, the Windows Push Notification Services (WNS) on Windows, and UnifiedPush on Linux. |
|
Package review asks the user to rate the app without leaving it: Google Play's in-app review on Android, the App Store's rating prompt on iOS and macOS.
|
Package review asks the user to rate the app without leaving it: Google Play's in-app review on Android, the App Store's rating prompt on iOS and macOS. |
|
Package richdoc is the document model of Giode's rich text editor: blocks (paragraphs, headings, lists, tasks, quotes, code, tables, images, rules) holding text spans with inline marks and atoms (mentions, references, emoji).
|
Package richdoc is the document model of Giode's rich text editor: blocks (paragraphs, headings, lists, tasks, quotes, code, tables, images, rules) holding text spans with inline marks and atoms (mentions, references, emoji). |
|
Package router provides a simple navigation layer: define views as routes, navigate between them with Push/Navigate/Back and link to them with Link.
|
Package router provides a simple navigation layer: define views as routes, navigate between them with Push/Navigate/Back and link to them with Link. |
|
Package rtc makes audio and video calls and data connections over WebRTC, on pion.
|
Package rtc makes audio and video calls and data connections over WebRTC, on pion. |
|
Package screencap captures the screen, for sharing it in a call or recording it: a stream of frames from a display.
|
Package screencap captures the screen, for sharing it in a call or recording it: a stream of frames from a display. |
|
Package settings keeps small values that outlive the app - settings, progress, the last opened file - as JSON in the app's data directory (the browser's local storage on the web).
|
Package settings keeps small values that outlive the app - settings, progress, the last opened file - as JSON in the app's data directory (the browser's local storage on the web). |
|
Package shortcut parses keyboard shortcuts written as text ("Mod+T", "Ctrl+Shift+P", "F5", "Mod+,"), matches them against key events and formats them for display the way each platform writes them.
|
Package shortcut parses keyboard shortcuts written as text ("Mod+T", "Ctrl+Shift+P", "F5", "Mod+,"), matches them against key events and formats them for display the way each platform writes them. |
|
Package spellcheck checks spelling with the platform's spell checker: NSSpellChecker on macOS, UITextChecker on iOS, the Windows spell checker, Android's spell checker service, and Hunspell on Linux (loaded when first used, with the dictionaries the system has installed).
|
Package spellcheck checks spelling with the platform's spell checker: NSSpellChecker on macOS, UITextChecker on iOS, the Windows spell checker, Android's spell checker service, and Hunspell on Linux (loaded when first used, with the dictionaries the system has installed). |
|
Package state provides a minimal global-state primitive: an observable value that can be read and written from anywhere - not just from within a Layout call, but a goroutine outside the render loop too (a network response, a timer) - and requests a redraw when it changes.
|
Package state provides a minimal global-state primitive: an observable value that can be read and written from anywhere - not just from within a Layout call, but a goroutine outside the render loop too (a network response, a timer) - and requests a redraw when it changes. |
|
Package store sells in-app products and subscriptions: Google Play Billing on Android, the App Store (StoreKit) on iOS and macOS.
|
Package store sells in-app products and subscriptions: Google Play Billing on Android, the App Store (StoreKit) on iOS and macOS. |
|
Package support lets the app's users report a problem and support its development.
|
Package support lets the app's users report a problem and support its development. |
|
Package takephoto lets the user take a photo with the system camera screen, for an "attach a photo" button:
|
Package takephoto lets the user take a photo with the system camera screen, for an "attach a photo" button: |
|
Package telecom puts an app's calls in the phone's own call system: the full-screen incoming call screen (even when the phone is locked), the call in the status bar and recents, and answering from a headset or a car.
|
Package telecom puts an app's calls in the phone's own call system: the full-screen incoming call screen (even when the phone is locked), the call in the status bar and recents, and answering from a headset or a car. |
|
Package update keeps a desktop app up to date from a feed you host: it checks for a newer version, downloads it, verifies it, replaces the app and restarts it.
|
Package update keeps a desktop app up to date from a feed you host: it checks for a newer version, downloads it, verifies it, replaces the app and restarts it. |
|
Package video shows moving pictures: a Surface takes frames from any goroutine (a decoder, a call's remote track, a screen capture) and its View element draws the latest one.
|
Package video shows moving pictures: a Surface takes frames from any goroutine (a decoder, a call's remote track, a screen capture) and its View element draws the latest one. |
|
web
|
|
|
snippets/home
command
|
|
|
snippets/recipes
command
|