« Previous 1 2 3
Program GUIs in Go with Fyne
Fyne Work
Compiling
To compile the program, change to the directory with the source code files and fire off:
go mod init checksum go build
The two-liner produces an executable binary named checksum
.
Fyne also comes with a cross-compiler named fyne-cross
[4] that can be used to compile executables for most operating systems:
$ go get github.com/fyne-io/fyne-cross $ ~/go/bin/fyne-cross <operating system> $ fyne-cross <operating system> -help
The cross-compiler requires a previously set up Docker image for the install (first line); then, a call to the cross-compiler in the directory containing the source code files is all it takes to compile an executable for the desired operating system (second line); and further options for configuring the compile are provided by the fyne-cross
online help (final line).
Conclusions
All told, developing a GUI with the Fyne GUI toolkit is not rocket science. If you have at least a solid basic knowledge of Go or are perhaps moving from some other programming language, you will be able to find your way around quickly. In the present version 2.0, the framework already feels very rounded. If you want to learn more, take a closer look at a book by Fyne creator Andrew Williams [5].
Infos
- Fyne: https://fyne.io
- Graphics driver: https://developer.fyne.io/started/
- Demo app: https://fyne.io/fyne/v2/cmd/fyne_demo
- fyne-cross: https://github.com/fyne-io/fyne-cross
- Williams, Andrew. Building Cross-Platform GUI Applications with Fyne . Packt, 2021: https://www.packtpub.com/product/building-cross-platform-gui-applications-with-fyne/9781800563162
« Previous 1 2 3
Buy this article as PDF
(incl. VAT)
Buy ADMIN Magazine
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Most Popular
Support Our Work
ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.