Fyne (software)

Last updated
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 releaseFebruary 5, 2018;6 years ago (2018-02-05)
Stable release
2.4.4 / February 13, 2024;21 days ago (2024-02-13) [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. It is designed to enable developers to build applications that run on multiple desktop and mobile platforms/versions from a single code base [2] . 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. [3] 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 [4] and in early February 2020 it was trending as #1 project in GitHub trending ranks. [5]

Contents

Development

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

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

Example

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

packagemainimport("fyne.io/fyne/v2/app""fyne.io/fyne/v2/container""fyne.io/fyne/v2/widget")funcmain(){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. [12] The Fyne toolkit is built in various layers, with each in separate packages. Notable layers include: [13]

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:

Use

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

There are many other applications being built using the toolkit, those that are open source can be found in an application listing [15] 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 ]

Related Research Articles

<span class="mw-page-title-main">Qt (software)</span> Object-oriented framework for software development

Qt is cross-platform software for creating graphical user interfaces as well as cross-platform applications that run on various software and hardware platforms such as Linux, Windows, macOS, Android or embedded systems with little or no change in the underlying codebase while still being a native application with native capabilities and speed.

In computing, cross-platform software is computer software that is designed to work in several computing platforms. Some cross-platform software requires a separate build for each platform, but some can be directly run on any platform without special preparation, being written in an interpreted language or compiled to portable bytecode for which the interpreters or run-time packages are common or standard components of all supported platforms.

<span class="mw-page-title-main">Swing (Java)</span> Java-based GUI toolkit

Swing is a GUI widget toolkit for Java. It is part of Oracle's Java Foundation Classes (JFC) – an API for providing a graphical user interface (GUI) for Java programs.

<span class="mw-page-title-main">Standard Widget Toolkit</span> Graphical widget toolkit for use with the Java platform

The Standard Widget Toolkit (SWT) is a graphical widget toolkit for use with the Java platform. It was originally developed by Stephen Northover at IBM and is now maintained by the Eclipse Foundation in tandem with the Eclipse IDE. It is an alternative to the Abstract Window Toolkit (AWT) and Swing Java graphical user interface (GUI) toolkits provided by Sun Microsystems as part of the Java Platform, Standard Edition (J2SE).

<span class="mw-page-title-main">FLTK</span>

Fast Light Toolkit (FLTK) is a cross-platform widget library for graphical user interfaces (GUIs), developed by Bill Spitzak and others. Made to accommodate 3D graphics programming, it has an interface to OpenGL, but it is also suitable for general GUI programming.

<span class="mw-page-title-main">Fox toolkit</span>

The FOX toolkit is an open-source, cross-platform widget toolkit, i.e. a library of basic elements for building a graphical user interface (GUI). FOX stands for Free Objects for X.

wxPython Python wrapper for wxWidgets

wxPython is a wrapper for the cross-platform GUI API wxWidgets for the Python programming language. It is one of the alternatives to Tkinter. It is implemented as a Python extension module.

<span class="mw-page-title-main">Google Web Toolkit</span> Free Java library

Google Web Toolkit, or GWT Web Toolkit, is an open-source set of tools that allows web developers to create and maintain JavaScript front-end applications in Java. It is licensed under Apache License 2.0.

Enthought, Inc. is a software company based in Austin, Texas, United States that develops scientific and analytic computing solutions using primarily the Python programming language. It is best known for the early development and maintenance of the SciPy library of mathematics, science, and engineering algorithms and for its Python for scientific computing distribution Enthought Canopy.

A software widget is a relatively simple and easy-to-use software application or component made for one or more different software platforms.

<span class="mw-page-title-main">Vaadin</span>

Vaadin is an open-source web application development platform for Java. Vaadin includes a set of Web Components, a Java web framework, and a set of tools that enable developers to implement modern web graphical user interfaces (GUI) using the Java programming language only, TypeScript only, or a combination of both.

<span class="mw-page-title-main">GTK</span> Free and open-source cross-platform widget toolkit for creating graphical user interfaces

GTK is a free software cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and proprietary software to use it. It is one of the most popular toolkits for the Wayland and X11 windowing systems.

<span class="mw-page-title-main">Abstract Window Toolkit</span> Java-based GUI toolkit

The Abstract Window Toolkit (AWT) is Java's original platform-dependent windowing, graphics, and user-interface widget toolkit, preceding Swing. The AWT is part of the Java Foundation Classes (JFC) — the standard API for providing a graphical user interface (GUI) for a Java program. AWT is also the GUI toolkit for a number of Java ME profiles. For example, Connected Device Configuration profiles require Java runtimes on mobile telephones to support the Abstract Window Toolkit.

<span class="mw-page-title-main">Kivy (framework)</span> Free and multi-platform graphical library for Python

Kivy is a free and open source Python framework for developing mobile apps and other multitouch application software with a natural user interface (NUI). It is distributed under the terms of the MIT License, and can run on Android, iOS, Linux, macOS, and Windows.

JWt is an open-source widget-centric web application framework for the Java programming language developed by Emweb. It has an API that uses established GUI application development patterns. The programming model is component-based and event-driven, similar to Swing.

mpv (media player) Free and open-source media player software

mpv is free and open-source media player software based on MPlayer, mplayer2 and FFmpeg. It runs on several operating systems, including Unix-like operating systems and Microsoft Windows, along with having an Android port called mpv-android. It is cross-platform, running on ARM, PowerPC, x86/IA-32, x86-64, and MIPS architecture.

Flutter is an open-source UI software development kit created by Google. It is used to develop cross platform applications from a single codebase for any web browser, Fuchsia, Android, iOS, Linux, macOS, and Windows. First described in 2015, Flutter was released in May 2017.

<span class="mw-page-title-main">Immediate mode GUI</span> Type of graphical user interface

An immediate mode graphic user interface (GUI), also known as IMGUI, is a graphical user interface design pattern which uses an immediate mode API to render controls, as opposed to a retained mode one.

References

  1. "Lots of bug fixes and speed improvements for 2.4". github.com. 2023-02-13.
  2. Aurélie, Vache (25 August 2021). "Learning Go by examples: part 7 - Create a cross-platform GUI/Desktop app in Go".
  3. "Scaling and Geometry".
  4. Fyne [@Fyne_io] (December 19, 2019). "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" (Tweet). Retrieved 2021-01-07 via Twitter.
  5. Fyne [@Fyne_io] (February 11, 2020). "Oh wow, the ⁦@Fyne_io⁩ project is currently in the #1 slot on GitHub trending list!!! https://t.co/oeRtXklEK9 #congratulations #goland #gui #trending https://t.co/HMy1TpJ3u5" (Tweet). Retrieved 2021-01-07 via Twitter.
  6. "Contributors to fyne-io/fyne · GitHub". GitHub . 2020-02-25.
  7. Houston, Stephen [@stephenmhouston] (December 31, 2019). "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 https://t.co/jKqWriYrIG" (Tweet). Retrieved 2021-01-07 via Twitter.
  8. "Unusual uses for Go: GUIs (Go Time #116)".
  9. "fyne/CONTRIBUTING.md at master · fyne-io/fyne · GitHub". GitHub . 2020-02-25.
  10. "Fyne.io - Travis CI".
  11. "Coveralls.io - Test Coverage History and Statistics".
  12. "The careful process behind Fyne's simplicity".
  13. Archived at Ghostarchive and the Wayback Machine : "GoLab 2019 - Andrew Williams - Easily build cross platform graphical applications with Fyne". YouTube .
  14. "A full desktop environment for Linux/Unix using Fyne: Fyne-io/Desktop". GitHub . 2020-02-24.
  15. "Fyne Apps Listing".

Bibliography