rhx / SwiftGtk

A Swift wrapper around gtk-3.x and gtk-4.x that is largely auto-generated from gobject-introspection
https://rhx.github.io/SwiftGtk/
BSD 2-Clause "Simplified" License
317 stars 26 forks source link

GTK MainLoop and Swift/Foundation MainLoop Integration #56

Closed austintatiousness closed 1 year ago

austintatiousness commented 1 year ago

How does one go about integrating the Swift/Foundation main loop with GTK MainLoop. Specifically, I need concurrency (Tasks, et cetera) to work properly.

rhx commented 1 year ago

What you probably want to look at is using the standard Swift/Foundation RunLoop together with mainIterationDo(blocking: false). This way you can make both runloops co-exist.