Background processing
As you may have realized from the first line of andlabs UI code (ui.Main(func() { ... })), multithreading is something that needs to be considered when building using this API. This is due to the fact that most of the toolkits it integrates with will require graphical updates to all execute on the same thread (often, the main application thread). The andlabs UI aims to hide this complexity by managing the threads internally and provides helper methods to manage this.
As a result of this design, any user interface updates outside of the ui.Main() setup (or callbacks on controls created there) must be passed to the ui.QueueMain() method in the form of a function, as with the initial setup. This allows andlabs UI code to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access