Background processing

One of the benefits of an immediate mode user interface toolkit is that there's no hidden state. When we see a new email arrive, we don't have to communicate the change to a list widget (or equivalent) to instruct it to add a new row. As long as the model data updates when an event occurs, there's no additional work to do. Our nk code will automatically add the new data on the next frame and so the user interface will refresh accordingly.

This also means that we don't have to handle multiple thread complications in our user interface code. If you ensure that any model data is thread-safe (using standard Go tools) then the user interface will continue to render from the main thread on each refresh. It's a requirement that all render code runs on the same thread, but that's unlikely to be a problem due to the way the toolkit is designed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.93.12