@decentral1se so it does some magic because the Gtks callbacks don't play nice with trio itself?
When do you want to use this? Are the buttons/etc otherwise nonresponsive while calculating something in the background?
@jasper there are no stupid questions :)
Gtk has its own event loop so you cant use the Trio API directly, you need to run this "guest loop".
You'd want to use this if you have some background things happening in your GUI app. Say, when you drag & drop a file and want to do something with it but dont want to freeze the screen.
Gtks documentation says that you should just basically use threads for this stuff: https://pygobject.readthedocs.io/en/latest/guide/threading.html but they are really hard to manage...
chaos.social – a Fediverse instance for & by the Chaos community