Closed zencd closed 3 years ago
Yes - that will be a problem because you are blocking the main thread (which handles both input and updates).
The solution is to move the blocking operation to another thread using the async programming model of your choice. You can see examples of that with the terminal and maps demos.
self.screen.force_update()
does the trick. Called from a thread ofc. Thank you!
Great! I assume this is now resolved, so closing.
My asciimatics app performs some long lasting operations. I'd like to display "Updating..." before the operation started and "Updated" after all, so a user can be informed what's happening. But I can't manage to get the first title ever displayed - only the second one, and only after all is done. In the example below I use a pause to emulate the operation, but it's all the same with a real code.
How should I force UI to refresh in this case?