To explore the Fyne toolkit further, let's build our latest version of the GoMail application designed in Chapter 4, Walk – Building Graphical Windows Applications. We will start by setting out the basic application layout.
Creating a complex layout with Fyne is a case of combining multiple containers, each of which are using one of the layouts provided. It would be possible to write our own layout to set up the interface with a single container, but for this exploration, we will use only the built-in components. Let's start by creating the main application window.
To load the first window of a Fyne application, we must create a new application instance using app.New()
. After that, we can call the NewWindow()
function on this application object. The returned fyne.Window
object allows us to control the window on screen and to set its content:
import "fyne.io/fyne/app" func main() { mailApp := app.New() browse := mailApp.NewWindow("GoMail...