Mousetrap.jl: a GUI library for Julia and C++ that wraps GTK4
github.com
github.com
[1] https://docs.juliahub.com/Gtk4/rFcBQ/0.5.0/ [2] https://juliagizmos.github.io/GtkObservables.jl/stable/
At this point it seems that the deployment story missing. There is the BinaryBuilder.jl, but what steps does one need to take to make application bundles for multiple platforms at once and how large those bundles would be? Also, wouldn’t it make sense to bundle Julia with a precompilation file instead of using BinaryBuilder.jl?
https://docs.juliahub.com/GTK4_jll/XRLGj/4.10.5+0/#Platforms
But you could provide an API that allows the toolkit user to do their own main loop instead of having the toolkit do that. There isn't really that much of a benefit though - in theory it makes mixing with other libraries that might handle UIs easier, but in practice (having worked in a codebase that did that by mixing two toolkits - because of migration that never finished) tends to become a mess and for anything else an "idle callback" will work just fine.
You can, if you want to, reimplement the abstract API of the Glib event loop, and use that with GTK instead.
Note also that on macOS, GTK has to integrate both the Glib event loop and the event loop used by NeXTStep/Cocoa, because it is not always the case that the same one is in control (e.g. during drag-n-drop processing). It handles this "just fine", for some definition of "just fine".
[1] https://github.com/stackotter/swift-cross-ui/tree/main [2] https://github.com/TokamakUI/Tokamak