This is the code repository for Building Cross-Platform GUI Applications with Fyne, published by Packt.
Create beautiful, platform-agnostic graphical applications using Fyne and the Go programming language
The history of graphical application development is long and complicated, with various development challenges that persist to this day. The mix of technologies involved and the need to use different programming languages lead to a very steep learning curve for developers looking to build applications across multiple platforms.
This book covers the following exciting features: Become well-versed with the history of GUI development and how Fyne and the Golang programming language make it easier Explore how the Fyne toolkit is architected and the various modules are provided Discover how Fyne apps can be tested and constructed using best practices Construct five complete applications and deploy them to your devices Customize the design of your apps by extending widgets and themes Understand the separation and presentation of data and how to test and build applications that present dynamic data
If you feel this book is for you, get your copy today!
All of the code is organized into folders. For example, Chapter02.
The code will look like the following:
package main
import (
"log"
"os/exec"
)
Following is what you need for this book: This Fyne-Golang GUI book is for developers from any background who are looking to build cross-platform applications with a modern toolkit. It will also be useful for Go developers who are looking to explore graphical apps and GUI developers looking for a new toolkit for cross-platform development. Basic knowledge of Graphical User Interface (GUI) development is assumed (although a brief history is also included in the book). The book also features a short introduction to the Go language as a quick refresher.
With the following software and hardware list you can run all code files present in the book (Chapter 1-10).
Chapter | Software required | OS required |
---|---|---|
1 | Go 1.12 (or newer) | Windows, Mac OS X, and Linux (Any) |
2 | Fyne 2.0 | iOS, iPad or Android |
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.
In the first edition of this book the import path for fyne is listed as fyne.io/fyne
. However since the January release of v2.0.0 the imports should be fyne.io/fyne/v2
.
For example, on page 49 the line:
import "fyne.io/fyne/app"
should read
import "fyne.io/fyne/v2/app"
In addition to the code changes commands that install Fyne tools are impacted, so to install the fyne
tool the correct command on page 52 would be:
go get fyne.io/fyne/v2/cmd/fyne_demo
With these changes applied, or by using the code directly in this repository, the examples will all operate as described in the book content.
Page 121 example of pop-up menu code should read:
menu := fyne.NewMenu("",
fyne.NewMenuItem("Item 1", func() {}),
fyne.NewMenuItem("Item 2", func() {}),
)
pos := fyne.NewPos(20, 20)
widget.ShowPopUpMenuAtPosition(menu, w.Canvas(), pos)
References to ThemeColourName
should read ThemeColorName
Andrew Williams graduated from the University of Edinburgh in 2003 with a bachelor’s degree, with honors, in computer science. After university, he went to work as a software engineer and has gained over 15 years of commercial software development experience across a variety of programming languages, including Java, C, Objective-C, and Go. Andrew has spent many years working as a CTO with many early-stage and growing software start-ups. He has been a core developer in large open source projects, including Enlightenment, EFL, and Maven, as well as involved in maintaining various community websites and tutorials. Andrew’s passion for building tools and services that make software development simpler led him to start authoring books on the subject.