February 2019
Intermediate to advanced
450 pages
11h 59m
English
To communicate with the Walk user interface, we need to define another data model. This view model is designed to communicate information in a way that the declarative API understands. We will create a type named EmailClientModel, which will handle translating data from our client code to our user interface definition. Create a new file, model.go, where you can start to define these models. The first section of the code allows an email server to be set causing the email list to update accordingly.
For brevity, the trivial methods for walk.TreeModel have been left out—you can find them in the full code listing for this book:
type EmailClientModel struct { Server *client.EmailServer root walk.TreeItem itemsResetPublisher walk.TreeItemEventPublisher ...
Read now
Unlock full access