How fyne-io/fyne works
Fyne is a Go UI toolkit and app API for building desktop and mobile applications from one codebase. The main workflow is an app developer creating an app and window, assembling widgets into containers, then showing the UI through a platform driver. Internally, canvas objects are rendered by painter implementations. The README also documents storage, themes, and the fyne utility for packaging and release. Some subsystem paths are known only from the tree; links to their runtime callers are omitted where the excerpts do not establish them.
Main entry points: app.go App API · driver.go Platform drivers · image.go Canvas objects · window.go Window API
Components 23
App and UI API
- App API
app/app.go - Window API
window.go
Widgets and presentation
- Widgets
widget/widget.go - Text entry
widget/entry.go - Containers and tabs
container/tabs.go - Layouts
layout/boxlayout.go - Canvas objects
canvas/image.go - Themes and icons
theme/icons.go - Dialogs
dialog/dialog.go
Rendering and platform runtime
- Platform drivers
driver/driver.go - Desktop runtime
internal/driver/glfw/driver.go - Mobile runtime
internal/driver/mobile/app/app.go - Painter
internal/painter/draw.go - Software renderer
internal/painter/software/draw.go - SVG renderer
internal/svg/svg.go
Data and app services
- Data binding
data/binding/trees.go - Storage API
storage/uri.go - Resource repositories
internal/repository/memory.go - Preferences
internal/preferences.go
App packaging utility
- fyne utility
cmd/fyne/main.go - App commands
cmd/fyne/internal/commands/package.go
Other components
- App developer
- Desktop or mobile OS
Connections 23
- App developer → App API: creates app
- App API → Window API: creates window
- App developer → Widgets: assembles UI
- App developer → Containers and tabs: arranges content
- App developer → Window API: sets content
- Window API → Platform drivers: shows UI
- App API → Platform drivers: creates window
app/app.go - Widgets → Canvas objects: draws as
- Containers and tabs → Widgets: hosts content
container/tabs.go - Text entry → Data binding: binds data
widget/entry.go - Canvas objects → SVG renderer: renders SVG
canvas/image.go - Painter → Canvas objects: draws objects
internal/painter/draw.go - Desktop runtime → Desktop or mobile OS: runs on
- Mobile runtime → Desktop or mobile OS: runs on
- Platform drivers → Desktop runtime: selects platform
- Platform drivers → Mobile runtime: selects platform
- Software renderer → Canvas objects: renders objects
- Themes and icons → SVG renderer: uses SVG
theme/icons.go - App API → Resource repositories: registers repository
app/app.go - App API → Storage API: initializes storage
app/app.go - Storage API → Resource repositories: uses URI repository
storage/uri.go - App developer → fyne utility: packages app
- fyne utility → App commands: registers commands
cmd/fyne/main.go