JuliaGtk / Gtk4Makie.jl

GLMakie + Gtk4
Other
20 stars 2 forks source link

Main loop issues on startup on Mac OS #19

Open jwahlstrand opened 4 months ago

jwahlstrand commented 4 months ago

In the examples "interactive.jl" and "widgets.jl", there is some code (only run if Sys.isapple()) that waits for the Gtk4 event loop to be started before "using Gtk4Makie". Without this, on my Mac, the GTK event loop freezes. This wait shouldn't be required.

jonathanBieler commented 3 months ago

Hey, I think I'm hitting this issue but I'm not totally sure. I'm trying to use Gtk4Makie inside a package, and the window just doesn't show up. Since I'm in a package I can't wait for the main loop to start before using Gtk4Makie. Is that the same issue ?

For now I'm doing this as a workaround :

using Gtk4; win = GtkWindow(); show(win); destroy(win); using MyApp; win = MyApp.start()

But would be better to fix it.

jwahlstrand commented 2 months ago

When I use Gtk4Makie inside a package on Linux and Windows I don't need to do anything special. The event loop on Mac OS is handled a little differently because of a REPL issue (https://github.com/JuliaGtk/Gtk4.jl/issues/23) and I suspect that's related.

jonathanBieler commented 2 months ago

Alright thanks, I'll have a look.