Communicating with the GUI

Now that the basic layout is coded, we will add functionality to present some data from a mock email server. As with the Walk example, we will load the model definitions and a test email server from the github.com/PacktPublishing/Hands-On-GUI-Application-Development-in-Go/client package.

First of all, let's write the code to load content from our model into the user interface. We will create a SetEmail(EmailMessage) function that sets the content of an email into the user interface. To help with converting from client.Email and time.Time to string, we will use the helper ToEmailString() and DateString() functions. This function will be called during interface load and also whenever we change the selected email: ...

Get Hands-On GUI Application Development in Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.