February 2019
Intermediate to advanced
450 pages
11h 59m
English
The first new function, setMessage(), will simply call SetText() on each of our widget.Label elements. This requires saving a reference to the to, from, date, subject, and content label widgets that were created earlier in this section. Their content can be updated using the SetText() function as follows:
func setMessage(email *client.EmailMessage) { subject.SetText(email.Subject) to.SetText(email.ToEmailString()) from.SetText(email.FromEmailString()) date.SetText(email.DateString()) content.SetText(email.Content)}
We will also create another helper function, addEmail(), to add a new email to the list. This is a change from the initial list of widget.Labels that we added to widget.Group—we are using buttons to utilize their ...
Read now
Unlock full access