Many GUI libraries requests to process functions inside the main thread. I need to call/delegate routines/events to other threads. Problem is, setting text of text area in Gtk4+ will block in this case and I would not to process any other events, when my event is processed. What I do:
- Delegate event to another thread,
- Create event source (idle)and context, attaching source to context,
- Running loop of context,
- My special function will delegate events (callbacks) to this source.
I think problem is there should be main loop, when setting text to gtk's text area.