Section 1: Graphical User Interface Development
Chapter 1, The Benefits of Native Graphical Applications, contains a re-introduction to the GUI and its role in the modern software ecosystem. It discusses the benefits of coding a native GUI for a responsive user experience and platform integration. By the end of the chapter, you will be comfortable deciding which of your projects would benefit from a native graphical interface.
Chapter 2, Graphical User Interface Challenges, shows how GUIs present various challenges to the designer and developer beyond that of a web app or systems application. This chapter will explore the details of the most common challenges, including look and feel, performance, platform integration, and distribution. On completion of this chapter, you will be familiar with the additional complications of building a graphical desktop application, and know what to consider when designing a GUI.
Chapter 3, Go to the Rescue!, shows how the design of the Go language is well suited to solving the challenges described in the previous chapter. It will demonstrate how the Go language, despite not having a standard user interface API, has all the required constructs to ease development of graphical applications. At the end of this chapter, you will be ready to progress to the detailed toolkit API descriptions that follow in Section 2, Toolkits Using Existing GUIs.
Section 2: Toolkits Using Existing GUIs
Chapter 4, Walk - Building Graphical Windows Applications, discusses Walk, which is a Windows Application Library Kit for the Go programming language. This chapter covers API design, common usage patterns, and how to use the library as part of a multi-platform strategy. You will learn how to build a simple Windows application using the Walk toolkit through examples and illustrations.
Chapter 5, andlabs UI – Cross-Platform Native UIs, explores Andlabs UI, which is a popular GUI toolkit that uses the existing graphical technologies on each of the platforms it supports. This chapter discusses the benefits of such an approach and shows how the API is designed. You will learn how to build a simple application using the andlabs UI toolkit through examples and illustrations.
Chapter 6, Go-GTK – Multiple Platforms with GTK, here, Go-GTK examines the Go language bindings for GTK+, a multi-platform toolkit for creating GUIs. GTK+ supports many platforms and comes preinstalled on many environments. In this chapter, we look at the details of the GTK+ toolkit, the platforms it supports, and how to make use of it in your application. You will learn how to build a simple application using the Go-GTK API through examples and illustrations.
Chapter 7, Go-Qt – Multiple Platforms with QT, explains that Go-Qt allows you to write Qt-based graphical applications in Go. Qt is a cross-platform application framework that is used for developing applications that can be run on various software and hardware platforms. In this chapter, we look at the details of the Qt framework, the platforms it supports, and how to make use of it in your application. You will learn how to build a simple application using the Go-Qt API through examples and illustrations.
Section 3: Modern Graphical Toolkits
Chapter 8, Shiny – Go's Experimental API, looks at the Shiny project, an experimental GUI library written in pure Go, and is designed to create portable apps that have a consistent look across multiple platforms. This chapter explores how to write portable cross-platform applications with Shiny. You will learn how to build a simple cross-platform graphical application using the Shiny APIs through examples and illustrations.
Chapter 9, nk – Nuklear for Go, explains that Nuklear is a lightweight widget library that focuses purely on the graphical interface (rather than window management and platform integration) to create an easy-to-use API. The graphical interface, originally designed for embedded applications, renders identically across all supported platforms. Its implementation has no dependencies and achieves this by avoiding a standard render context and operating system drivers. You will learn how to set up a render context and use this toolkit to create an example application.
Chapter 10, Fyne – Material Design-Based GUI, explores the Fyne project, designed to be an easy to use UI toolkit and app API written in Go that follows the Material Design principles. It uses OpenGL backend to provide cross-platform graphics that look identical on any supported platform. This chapter explores how to write beautiful applications for multiple platforms with Fyne. You will learn how to build a simple multi-platform graphical application using the Fyne toolkit through examples and illustrations.
Section 4: Growing and Distributing your Application
Chapter 11, Navigation and Multiple Windows, covers the workflows and growing complexity of expanding a graphical application. As well as planning and presenting a clear navigation and workflow, it also covers how to manage multiple windows, dialogs, and application instances. It also explores the differences between how desktop operating systems consider application life cycles, and how this may impact your application design. After completing this chapter, you will be confident in how to adapt your application design as you expand its functionality.
Chapter 12, Concurrency, Networking, and Cloud Services, explains how more advanced aspects of large application programming fit within a graphical Go application. We cover concurrency and networking, looking at how to work with goroutines and long-running threads, remote resources, and how to handle the user impact of unreliable network conditions. Additionally, you will learn how to connect with and utilize cloud services to provide a rich user experience, both online and offline.
Chapter 13, Best Practices in Go GUI Development, illustrates that the Go language comes with a well-understood set of best practices, covering features such as style, documentation, and code structure. In this chapter, you will learn how to apply these to the development of graphical applications, and which additional practices are recommended. You will learn how the toolkits described in the previous chapters agree on topics such as binary packaging and managing platform specific code.
Chapter 14, Distributing your Application, shows how distribution of applications for multiple platforms is a challenge, but it's important that your users have a seamless experience. In this final chapter, you will learn how to package your application and its assets for consistent distribution across the operating systems you target. We will explore the various options for app-store or marketplace deployment, along with how to deliver direct downloads. At the end of this chapter, you should have the knowledge to design, build, and distribute your graphical application using the Go language.