February 2019
Intermediate to advanced
450 pages
11h 59m
English
Communicating with the graphical interface (in most frameworks) means managing threads correctly. In the preceding example, we could have updated a GUI within the dirSize() method, adding a row to a table, for instance. In theory, that would have avoided the need for a channel and the struct that we passed back to the reportUsage() function. However, changing threads is a (relatively) slow process depending on other application activities, and moreover we should try to separate our logic and processing from the user interface code. Doing so will make it easier to reuse code later and possibly to change toolkit if our requirements change.
Our design to handle most of the user interaction in a single function ...
Read now
Unlock full access