Skip to content

Meet the first book about Golang GUI programming

As people following this blog may know I had become frustrated at how difficult it is to create cross-platform native applications for desktop systems. Most of the languages and APIs are out dated, require complex compilation or large run-time dependencies. It was in an effort to do something about this that I started to learn Go – it seemed like a really easy to learn language that could be applied to graphical application development.

Thankfully I was not alone in thinking this was a good match – many members of the Go community were thinking about this and also the team at Packt Publishing had already considered a book on the subject. When given the opportunity to write this book I thought it was a great chance to further the cause!

What toolkits are there?

The first question to answer is what tools could be used? Searching the internet on this topic yields many unanswered, or ambiguous questions, such as:

What is the desktop GUI situation like for Go? from golang

Golang GUI framework from golang

So we decided that the available toolkits should be compared – some traditional ones (Walk, andlabs UI, Go-GTK, qt) and some more cutting-edge projects (Shiny, nk, Fyne). Armed with this list of toolkits I set out to show what was possible and how easy some well structured Go code could make this!

Building GUIs with Go

It seemed like the best way to explore the options available was to try them all out. For each toolkit covered by the book we look at the project aims and ambitions, the platforms they support and the design of their APIs and tools. We then build a standard application that demonstrates the strengths and weaknesses of each toolkit.

In some instances the Go APIs were lightweight bindings to existing widget toolkits – some being platform specific and others cross-platform. It was refreshing to see how easily we could build robust GUI software that looks familiar using the Go language. See below the resulting email application built using the Go-GTK bundings to GTK+.

gomail-clearlooks

Other toolkits offer a completely different look – a modern user interface taking inspiration from design language such as Material Design (the aesthetic behind the Android user interface). As these are earlier in development they did not all have a complete widget set so we introduced a new demo application – an image viewer. Using efficient scaling and asynchronous loading code we created a graphical application such as the following built with the Fyne toolkit.

goimage_finished_dark

Best practice

As well as exploring the code to create graphical applications the book discusses how to plan and structure a growing GUI app and the code it depends upon. The last section looks at how to work with unit tests, continuous integration and how to keep maintainable code as you integrate networking and cloud services.

The final chapters look at how to package and distribute a cross platform application for delivery to end users. As well as metadata and packaging formats it describes the process for publishing on your website or submitting to app stores and software listings.

I want to know more!

If you are interested in any of this and want to know more you can get your copy online right now. It’s available to buy directly from Packt or from Amazon (if you prefer a Kindle edition);

Thanks for reading, I hope that if you purchase the book that you enjoy it. Please leave comments below or a review on the product page.

Leave a Reply

%d bloggers like this: