Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On GUI Application Development in Go

You're reading from   Hands-On GUI Application Development in Go Build responsive, cross-platform, graphical applications with the Go programming language

Arrow left icon
Product type Paperback
Published in Feb 2019
Publisher Packt
ISBN-13 9781789138412
Length 450 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Andrew Williams Andrew Williams
Author Profile Icon Andrew Williams
Andrew Williams
Arrow right icon
View More author details
Toc

Table of Contents (24) Chapters Close

Preface 1. Section 1: Graphical User Interface Development FREE CHAPTER
2. The Benefits of Native Graphical Applications 3. Graphical User Interface Challenges 4. Go to the Rescue! 5. Section 2: Toolkits Using Existing Widgets
6. Walk - Building Graphical Windows Applications 7. andlabs UI - Cross-platform Native UIs 8. Go-GTK - Multiple Platforms with GTK 9. Go-Qt - Multiple Platforms with Qt 10. Section 3: Modern Graphical Toolkits
11. Shiny - Experimental Go GUI API 12. nk - Nuklear for Go 13. Fyne - Material Design-Based GUI 14. Section 4: Growing and Distributing Your Application
15. Navigation and Multiple Windows 16. Concurrency, Networking, and Cloud Services 17. Best Practices in Go GUI Development 18. Distributing Your Application 19. Installation Details 20. Cross Compiler Setup 21. Comparison of GUI Toolkits
22. Connecting GoMail to a Real Email Server 23. Other Books You May Enjoy

Walk in a cross-platform application

Walk is clearly a library aimed at creating graphical user interfaces for the Microsoft Windows platform—but this doesn't mean that building your application with Walk limits you to Windows only. Using the techniques explored in Chapter 3, Go to the Rescue!, we can set the code for Windows to be conditionally included when building for the platform, and introduce other files that could provide a user interface for other platforms.

The first step is to update the files we have built so far to only build on Windows. We do this using the build constraints comment format (you could also use file naming for this step if you wish):

// +build windows

package main

...

We then introduce a new file that will handle the fallback case when we're on a different platform. For this simple project we will call it nonwindows.go ...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime