Fyne

Short description: Graphical toolkit for building cross platform GUIs

Fyne

Screenshot of fyne_demo showcasing many widgets

Original author(s)| Andrew Williams
Developer(s)| Andrew Williams, Cedric Bail, Changkun Ou, Charles Daniels, Drew Weymouth, Jacob Alzén, Luca Corbo, Pablo Fuentes, Steve O'Connor, Stephen Houston, Stuart Scott, Tilo Prütz
Initial release| February 5, 2018; 6 years ago (2018-02-05)
Stable release|

2.4.3 / December 23, 2023; 6 months ago (2023-12-23)[1]

Written in| Go
Operating system| Linux, Unix-like, macOS, Windows, IOS, Android (operating system)
Type| Widget toolkit
License| New BSD License
Website| fyne.io

Fyne is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs) across desktop and mobile platforms. Fyne uses OpenGL to provide cross-platform graphics. It is inspired by the principles of Material Design to create applications that look and behave consistently across all platforms.[2] It is licensed under the terms of the 3-clause BSD License, supporting the creation of free and proprietary applications. In December 2019 Fyne became the most popular GUI toolkit for Go, by GitHub star count[3] and in early February 2020 it was trending as #1 project in GitHub trending ranks.[4]

## Contents

* 1 Development
* 2 Example
* 3 Design
* 3.1 API
* 3.2 Vector graphics
* 3.3 Hierarchy
* 3.3.1 Canvas
* 3.3.2 CanvasObject
* 3.3.3 Container
* 3.3.4 Widget
* 3.4 Packages
* 4 Use
* 5 References
* 6 Bibliography
* 7 External links

## Development

Fyne is currently developed by a team of volunteers and is supported by around 40 contributors.[5] Members of this group also work on the FyneDesk project to create a new Linux desktop environment.[6]

The Fyne toolkit is written primarily in Go.[7] The team focuses on clean APIs and follows the principles of Clean Code to sustain maintainability of the project.[8] All Fyne projects are continuously tested to check correctness, stability as well as formatting and documentation.[9][10]

## Example

The code required for a simple "Hello World" application is minimal, as follows:

package main

import (
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/widget"

func main() {
a := app.New()
w := a.NewWindow("Hello")

hello := widget.NewLabel("Hello Fyne!")
w.SetContent(container.NewVBox(
hello,
widget.NewButton("Hi!", func() {
hello.SetText("Welcome :)")
}),

w.ShowAndRun()

To build this application you will need the Go language and a C compiler installed, as well as a graphics driver that supports OpenGL. It can be built and run using the command: ` $ go run main.go `

## Design

Design of the Fyne API and user interface components follows a careful process to ensure the simplicity.[11] The Fyne toolkit is built in various layers, with each in separate packages. Notable layers include:[12]

### API

API, or Application programming interface, is an interface or protocol that allows for communication across different parts of the software. Fyne has a self-documenting API that is also extensible resulting in the ability for each developer to create custom tools unique to their project that will mesh with Fyne itself.

### Vector graphics

The use of vector graphics to paint the UI provides a method of adapting to different device and display sizes without losing image fidelity. This allows the programmer to only need to create the UI once and it will look as expected on any device.

### Hierarchy

#### Canvas

Canvas contains all of the contents of a window ranging from the full screen to a group of CanvasObjects.

#### CanvasObject

CanvasObjects are what actually get rendered on screen such as Text, Rectangle, Line. The objects store size, position and color information for the rendering process.

#### Container

Containers are groups of CanvasObjects, each container can specify a layout which will contain the sizing and position of its child components. Layouts help the developer arrange components in a manner that response to the container or window size, with several layout types provided including Border, Center, and Grid.

#### Widget

All of the components of a window in a CanvasObject are widgets that contain standard user interface elements. Fyne widgets include but are not limited to UI basics such as: Button, Check, Form, Hyperlink, Label, Radio, Select and Toolbar as well as container widgets like AppTabs and Split. Since 1.4 there are additional collection widgets that provide high-performance presentation of large data in a List, Table or Tree view. All the built-in UI widgets ensure that standard aspects of GUI interactivity act in a predictable and expected way across applications. This helps improve quality of programs while assisting the programmer by removing the need for them to create these tools themself.

### Packages

All components of Fyne are split into packages and then connected via the API to create a final GUI application. In addition to the canvas, layout, and widget packages, notable packages include:

* App package which is the main entry point for the app which manages understanding the type of device the application is running on and ensures the code will run as expected on that device.
* Test package enabling test-driven development to validate the GUI itself functions as expected.

## Use

The largest project currently using the Fyne toolkit is the FyneDesk project, a complete desktop environment for Linux.[13]

There are many other applications being built using the toolkit, those that are open source can be found in an application listing[14] website managed by the project.

Many businesses are using the Fyne toolkit to quickly add a graphical user interface to command line tools which they have already built using Go. [citation needed]

## References

1. ↑ "Happy holidays and enjoy a better Fyne for your coding projects :)". 2023-12-24. https://github.com/fyne-io/fyne/releases/tag/v2.4.3.
2. ↑ "Scaling and Geometry". https://developer.fyne.io/architecture/geometry.
3. ↑ Fyne [@Fyne_io] (2019-12-19). "We are very excited to announce that Fyne is now the most popular* GUI toolkit for Go! Great news and a huge milestone :). Now we need to figure how to bring the joy of Fyne to the wider coding community. [* According to GitHub stargazer count ⭐️ #golang #winning #future"] (in en). https://twitter.com/Fyne_io/status/1207621758414704640.
4. ↑ Fyne [@Fyne_io] (2020-02-11). "Oh wow, the ⁦@Fyne_io⁩ project is currently in the #1 slot on GitHub trending list!!! t.co/oeRtXklEK9 #congratulations #goland #gui #trending t.co/HMy1TpJ3u5" (in en). https://twitter.com/Fyne_io/status/1227238218879291398.
5. ↑ "Contributors to fyne-io/fyne · GitHub". 2020-02-25. https://github.com/fyne-io/fyne/graphs/contributors.
6. ↑ Houston, Stephen [@stephenmhouston] (2019-12-31). "I am so proud of how far we have made it with this desktop in less than a year of work. It is a really great experience and very aesthetically pleasing. Please consider using it if you are a #linux user! #fyne #golang #go #linuxdesktop #desktop t.co/jKqWriYrIG" (in en). https://twitter.com/stephenmhouston/status/1212078602889641984.
7. ↑ "Unusual uses for Go: GUIs (Go Time #116)". https://changelog.com/gotime/116.
8. ↑ "fyne/CONTRIBUTING.md at master · fyne-io/fyne · GitHub". 2020-02-25. https://github.com/fyne-io/fyne/blob/master/CONTRIBUTING.md.
9. ↑ "Fyne.io - Travis CI". https://travis-ci.org/fyne-io.
10. ↑ "Coveralls.io - Test Coverage History and Statistics". https://coveralls.io/github/fyne-io.
11. ↑ "The careful process behind Fyne's simplicity". https://changelog.com/posts/the-careful-process-behind-fynes-simplicity.
12. ↑ Archived at Ghostarchive and the Wayback Machine: "GoLab 2019 - Andrew Williams - Easily build cross platform graphical applications with Fyne". https://www.youtube.com/watch?v=jbsYrrNiqAs.
13. ↑ "A full desktop environment for Linux/Unix using Fyne: Fyne-io/Desktop". 2020-02-24. https://github.com/fyne-io/desktop/.
14. ↑ "Fyne Apps Listing". https://apps.fyne.io/.

## Bibliography

* Williams, Andrew (25 February 2019), Hands-On GUI Application Development in Go (1st ed.), Packt, ISBN 978-1-78913-841-2, https://www.packtpub.com/gb/application-development/hands-gui-application-development-go
* Schilli, Mike (1 November 2019), Linux Magazine 229 - Straight to the Point, Linux New Media, http://www.linux-magazine.com/Issues/2019/229/Straight-to-the-Point
* Williams, Andrew (25 January 2021), Building Cross-Platform GUI Applications with Fyne (1st ed.), Packt, ISBN 978-1-80056-316-2, https://www.packtpub.com/product/building-cross-platform-gui-applications-with-fyne/9781800563162
* Bail, Cédric (March 2023), GNU Linux Magazine / France 262 - Application Native Moderne en Go, Les Éditions Diamond, https://boutique.ed-diamond.com/home/1651-gnulinux-magazine-262.html
* Bail, Cédric (May 2023), GNU Linux Magazine / France 263 - Application Native Moderne en Go: Manipulation de Données, Tests Unitaires, Intégration et GitHub, Les Éditions Diamond, https://boutique.ed-diamond.com/home/1651-gnulinux-magazine-263.html
* Williams, Andrew (August 2023), Linux Magazine 273 - Designing Cross-Platform GUI Apps with Fyne, Linux New Media, https://www.linux-magazine.com/Issues/2023/273/GUI-Apps-with-Fyne

## External links

* Fyne tour
* Developer guides
* GoDoc documentation

* v
* t
* e

List of widget toolkits

Low-level|

| On AmigaOS|

* Intuition

|

On Classic Mac OS,
macOS|

| Unknown, native|

* Macintosh Toolbox

|

* Carbon

On Windows|

* Windows API

On Unix,
under X11|

* Xlib
* XCB
* X Toolkit Intrinsics, Xt, X-Toolkit

On BeOS, Haiku|

* BeOS, ZETA, Haiku

On cross-platform|

| CLI|

* OpenTK

|

* GDK
* SDL

Java|

* JOGL

On Android|

| CLI|

* Xamarin.Android

|

High-level|

| On AmigaOS|

* BOOPSI
* MUI
* ReAction GUI
* Zune

|

On Classic Mac OS,
macOS|

| Object Pascal|

* MacApp (v1, v2)

|

Objective-C,
Swift|

| Desktop|

* Cocoa

|

Mobile|

* Cocoa Touch

C++|

* MacApp (v3)
* PowerPlant
* THINK Class Library

CLI|

| Desktop|

* Xamarin.Mac

|

Mobile|

* Xamarin.iOS

On Windows|

| CLI|

| Desktop|

* Windows Forms
* XAML (Silverlight, WinRT XAML, WPF)
* XNA Framework

|

Web|

* XAML (Silverlight)

Mobile|

* XNA Framework

C++|

* MFC
* ATL
* WTL
* OWL

Object Pascal|

* VCL

On Unix,
under X11|

* Athena (Xaw)
* LessTif
* Motif
* OLIT
* XForms

On Android|

| C++|

* Qt for Android

|

Cross-platform,
by language|

| C|

* GTK
* IUP
* Tk
* wxC
* XForms
* XVT

|

C++|

* CEGUI
* CLX
* FLTK
* FOX toolkit
* GLUI
* Gtkmm
* JUCE
* Nana
* Qt
* Rogue Wave Views
* TnFOX
* Ultimate++
* VCF
* Wt
* wxWidgets
* YAAF
* SFML

Objective-C|

* GNUstep

CLI|

| Desktop|

* Gtk#
* Tao (OpenTK, TaoClassic)
* wx.NET
* UIML.NET
* MonoGame

|

Web|

* Moonlight

Mobile|

* MonoGame
* Xamarin.Forms

* DFL
* DlangUI
* DWT
* GtkD
* QtD
* wxD

Flash|

* Apache Flex (MXML)

Haskell|

* Gtk2Hs
* wxHaskell

Java|

| Desktop|

* AWT
* FXML (JavaFX)
* Qt Jambi
* Swing
* SWT
* wx4j
* jUIML

|

Web|

* GWT
* FXML (JavaFX)

Mobile|

* LWUIT

JavaScript|

* Dojo Toolkit
* Echo
* Ext JS
* Google Closure
* jQuery UI
* Qooxdoo
* YUI

Common Lisp|

* CAPI
* CLIM
* Common Graphics
* Ltk
* McCLIM

Lua|

* IUP
* wxLua

Pascal|

| Desktop|

* LCL

|

Mobile|

* LCL

Object Pascal|

| Desktop|

* CLX
* fpGUI
* IP Pascal
* LCL

|

Mobile|

* LCL

Perl|

* Perl/Tk
* wxPerl

PHP|

* PHP-GTK
* PHP-Qt
* wxPHP

Python|

* PyGObject
* PyGTK
* Pyjs
* PyQt
* PySide
* Tkinter
* wxPython

Ruby|

* Shoes
* FXRuby
* Ruby-GNOME2
* qtbindings
* QtRuby
* wxRuby

Tcl|

* Tcl/Tk

XML|

* GladeXML
* Lively Kernel
* Pyjs
* Rialto Toolkit
* XAML
* XUL
* UXP
* Wt

shell|

* whiptail
* dialog

0.00

(0 votes)

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Software:Fyne&oldid=3472023"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template