$ show fyne-io/fyne
Fyne is a cross-platform GUI toolkit for the Go programming language, designed to build native desktop, mobile, and web applications from a single codebase. The repository contains the core framework including window management, event handling, a rich set of widgets (button, label, entry, list, table, tree, etc.), canvas primitives (lines, rectangles, arcs, text), layout managers, data binding, theming, storage abstraction, and platform-specific drivers (GLFW for desktop, mobile for Android/iOS, WebAssembly, and an embedded/no-OS driver). It also provides a command-line tool (`cmd/fyne`) for packaging, bundling resources, and releasing applications. The architecture is modular with clear interfaces (`fyne.App`, `fyne.Window`, `fyne.Widget`, `fyne.Canvas`) and extensive use of build tags for platform adaptation. The codebase is production-grade, well-tested with both unit and visual regression tests, and actively maintained by the Fyne community.
The LLM identified 9 files worth highlighting for reuse:
Provides a generic, thread-safe object pool (`Pool[T any]`) with `Get` and `Put` methods. It is fully self-contained, uses no internal Fyne imports beyond standard library, and can be extracted for any Go project needing a bounded or unbounded object reuse pool to reduce allocation pressure.
Implements `CanvasObjectQueue`, an unbounded, lock-free queue using a linked list of fixed-size slots. Designed for high-performance, concurrent producer-consumer patterns. The implementation is generic (`T any`) and could be reused in any Go project requiring a non-blocking queue with minimal overhead.
A generic concurrent map (`Map[K comparable, V any]`) with lock-free reads and a stripe-locking write strategy. Provides `Get`, `Set`, `Delete`, `Len`, `Keys`, `Values` methods. Isolated and reusable; suitable for any Go codebase needing a high-performance concurrent map without external dependencies.
Defines an `expiringCache` base type with generic key-value storage, configurable time-to-live, and lazy expiration. Used internally for texture, SVG, font metric, and widget renderer caches. The core pattern (cache with expiration, periodic cleanup) is reusable as a standalone in-memory cache with TTL.
Provides `Scale` and `ScaleToFyne` functions to convert between screen pixels and Fyne's abstract coordinate system, supporting arbitrary DPI scaling. Pure math, no Fyne imports, easily extractable for any Go project that needs resolution-independent coordinate transformation.
Contains allocation-free helpers for computing minimum and maximum sizes of a set of `fyne.Size` values (`MaxSizes`, `MinSizes`). Also provides `Min` and `Max` for float32. These are generic utility functions usable in any Go project dealing with 2D layout calculations.
Implements a fully functional in-memory storage repository that satisfies `fyne.URIReadWriter`, `ListableURI`, and hierarchical operations (create, list, delete, move). Ideal for testing storage-dependent code or as a lightweight file system mock. Self-contained and reusable.
Provides bidirectional type converters (`BoolToString`, `IntToString`, `FloatToString`, `StringToInt`, etc.) with optional format strings. These are isolated utility functions that can be reused in any Go application needing typed conversion with change notification, independent of Fyne's widget system.
Detects the system locale by checking environment variables (`LANG`, `LC_ALL`, `LC_MESSAGES`) and the user-preferred language list on mobile. Returns a BCP 47 language tag. The logic is platform-aware via build tags and can be extracted for any Go project needing locale detection without external dependencies.