Hands-On GUI Application Development in Go
上QQ阅读APP看书,第一时间看更新

Summary

In this chapter, we started the exploration of GUI toolkits by first looking at the Walk API for Windows' graphical application development. We looked at how to get a Go-based Windows application running, and learned how the Walk project is structured into separate declarative and native APIs. We also saw how each of these APIs provides different benefits and how they are best combined to create a simple application.

As the Walk design was heavily inspired by the Qt project (which we will return to in Chapter 7, Go-Qt - Multiple Platforms with Qt), we were able to use the interface-designer features of Qt Creator to mock up a basic email application that we then built out using the declarative API. This email application is a design that can be reused for each of the toolkit-exploration chapters. To support the example applications, we imported another package that is provided in this book's source code, which provides some data models and test data. By combining our UI code, the email client library, and the data binding capabilities of the Walk toolkit, we were able to create a simple email application that would run natively on the Windows platform using the system-provided widgets. Through some small alterations, it was shown that this could be part of a wider cross-platform strategy where each platform's graphical presentation is provided by different toolkits.

In the next chapter, we will move our focus to code that provides a native look and feel across multiple platforms. We will be looking specifically at andlabs UI—a GUI toolkit that aims to provide a look and feel that matches the current operating system. If used on Windows, this will be similar to Walk, but it also adapts to different desktop platforms while only needing to write the user-interface code once.