February 2019
Intermediate to advanced
450 pages
11h 59m
English
All user interface code with Walk must run on the main thread; this is a constraint of the winAPI that handles the widgets. This means that any work in the background must change threads before running any UI code. This is done using the Synchronize() function on walk.Window. It takes a single function as a parameter and ensures that the code it contains will be run appropriately.
To handle the updating when an incoming email arrives, we create a new function, incomingEmail(), that will update our email list model. This function will cause an email to be added to the model, which will happen on the main thread so that the user interface can be updated to reflect the new data:
func (g *GoMailUIBrowse) incomingEmail(email ...
Read now
Unlock full access