Packt Publishing, 2019. — 450 p.
Conceptualize and build state-of-art GUI applications with Golang (Go)
Tackle the complexity of varying GUI application sizes with a structured and scalable approach
Get hands-on experience of GUI development with Shiny, and labs/ui, Fyne, and Walk
ObjectivesUnderstand the benefits and complexities of building native graphical applications
Gain insights into how Go makes cross-platform graphical application development simple
Build platform-native GUI applications using andlabs/ui
Develop graphical Windows applications using Walk
Create multiplatform GUI applications using Shiny, Nuklear, and Fyne
Use Go wrappers for GTK and Qt for GUI application development
Streamline your requirements to pick the correct toolkit strategy
Go is often compared to C++ when it comes to low-level programming and implementations that require faster processing, such as Graphical User Interfaces (GUIs). In fact, many claim that Go is superior to C++ in terms of its concurrency and ease of use. Most graphical application toolkits, though, are still written using C or C++, and so they don't enjoy the benefits of using a modern programming language such as Go.
This guide to programming GUIs with Go 1.11 explores the various toolkits available, including UI, Walk, Shiny, and Fyne. The book compares the vision behind each project to help you pick the right approach for your project. Each framework is described in detail, outlining how you can build performant applications that users will love. To aid you further in creating applications using these emerging technologies, you'll be able to easily refer to code samples and screenshots featured in the book. In addition to toolkit-specific discussions, you'll cover more complex topics, such as how to structure growing graphical applications, and how cross-platform applications can integrate with each desktop operating system to create a seamless user experience. By delving into techniques and best practices for organizing and scaling Go-based graphical applications, you'll also glimpse Go's impressive concurrency system. In the concluding chapters, you'll discover how to distribute to the main desktop marketplaces and distribution channels.
By the end of this book, you'll be a confident GUI developer who can use the Go language to boost the performance of your applications.
The Benefits of Native Graphical ApplicationsReturn of the graphical application
Native performance
Integrated user experience
Reliability and offline functionality
Maintainability and testing
Graphical User Interface ChallengesStandard look and feel or app theme
GUIs and visual hierarchy
Concurrency and multi-threading
Web services and cloud integration
Developing for multiple platforms
Packaging and distribution
Go to the Rescue!Cross-platform for any application
Concurrency in language design
Web services included as standard
Choosing your look and feel
Walk - Building Graphical Windows ApplicationsBackground and aims
Get started with walk
Benefits of a declarative API
Building a user interface
Walk in a cross-platform application
andlabs UI - Cross-platform Native UIsBackground and history
Getting started with andlabs UI
Generic API for multiple platforms
Building a user interface
Challenges with multiple native GUIs
Go-GTK - Multiple Platforms with GTKGTK+ background
Getting started with Go-GTK
Signals and namespaces
Sample application
Theming
ummary
Go-Qt - Multiple Platforms with QtQt background
Getting started with therecipe/qt
Object model and event handling
Sample application
Theming
Shiny - Experimental Go GUI APIBackground and the vision for Shiny
Design and supported platforms
Getting started with Shiny
Widgets and material design
Getting started continued
Building a user interface
nk - Nuklear for GoBackground and design of Nuklear
Rendering and platform support
Getting started with nk
Widgets, layout, and skinning
Building a user interface
Fyne - Material Design-Based GUIBackground and vision for Fyne
Getting started with Fyne
Rendering and vector graphics
Canvas, widgets, and layouts
Building a user interface
Building an image viewer
Navigation and Multiple WindowsPlanning application layout
Navigating your application
Window types and keeping things clean
Notifications and task status
Platform-specific considerations
Concurrency, Networking, and Cloud ServicesConcurrency, threads, and GUI updates
Network resources and caching
Connecting to cloud services
Consistent user experience when offline
Best Practices in Go GUI DevelopmentSeparation of concerns
Test-driving UI development
Continuous integration for GUIs
Managing platform specifics
Distributing Your ApplicationMetadata and icons
Bundling assets
Building a release
Distributing to platform marketplaces