Summary

In this chapter, we explored andlabs UI toolkit, which provides a single API to build graphical Go applications using the native widgets of the running operating system. We stepped through getting set up to build an andlabs UI application on macOS, Windows, and Linux, and showed how a simple hello world application could be run on each system from a single Go source file. We then looked in detail at the widget API for building applications and the drawing APIs for custom rendering.

With this knowledge, we revisited the GoMail application from Chapter 4Walk - Building Graphical Windows Applications, and built the user interface again using andlabs UI library. While there were some limitations with the current version, we were able to simulate some of the missing widgets to almost completely recreate the application. The benefit, of course, is that we could then run the GUI on Windows, Linux, and macOS from the same source code.

Testing an application built with a library where the user interface varies, and ensuring it looks as consistent as possible, may be difficult depending on your app design. Additionally, the simple cross-compilation that Go provides is significantly harder with andlabs UI due to the way it implements using operating-system-specific widget APIs. We explored how to work within these constraints and build applications for different platforms. 

In the next two chapters, investigate existing cross-platform widget libraries that have been made available through Go APIs. GTK+ (which we saw being used by andlabs UI for Linux) and QT both present a standard widget set, which will seem familiar to users of existing desktop applications. We'll start by exploring GTK+ in detail in the next chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.84.169