i had a few small issues when i was writing GUI code that instead of definding data types uses functional architecture to execute a collection of operations constructed ad-hoc to define the render queue - in this way of designing GUI, known as Immediate Mode GUI (imgui is the first of this type, but really this is rooted back in the design of Newsqueak, which is the real great grand-daddy of Go) you have to avoid doing processing in the render queue to avoid it triggering blocking in this thread, and for which reason newsqueak (and Go GUIs) need to shift the model out of the view part, to use MVC model... the model is the data, the controller is execution, and the view is the render, the render thread needs to be clean and do minimal computation, only as much as is required to turn the data into a paint