Closed LeMinaw closed 2 months ago
Hey, welcome back! :) Btw, I think I don't mention you for the logo, and when I noticed, I already forgot the exact name so I couldn't find you :D Feel free to create a PR to correct this!
Gtk integration is possible, but Gtk segfaulted on my, and there is no OpenGL support on OSX. This may have changed, but that made it a nogo for me to invest time into this ;)
Btw, I think I don't mention you for the logo, and when I noticed, I already forgot the exact name so I couldn't find you :D Feel free to create a PR to correct this!
No problem, no need to clutter docs or readme files with this imo 😉
Gtk integration is possible, but Gtk segfaulted on my, and there is no OpenGL support on OSX. This may have changed, but that made it a nogo for me to invest time into this ;)
The lack of OpenGL support in OSX is a shame, but I can personnaly can live without it.
Wich UI toolkit do your recommand for use with Makie ? Maybe Qt5 through QML.jl ?
MakieLayout, I guess :D
MakieLayout is great, but I find it somewhat limited when apps start to be complex. For exemple, it lacks features like tabs or multiple dialog boxes.
Also, I don't really like Makie's font rendering, it looks pretty blurry: Left, random text in MS Word for comparsion. Right, some text rendered in Makie through MakieLayout.
I guess this is because it uses OpenGL to draw characters ?
Yeah, and there is still a bug in the opengl text rendering... In theory, it should look much nicer :D
There is also: https://github.com/Gnimuc/CImGui.jl which works much better with opengl!
There is also: https://github.com/Gnimuc/CImGui.jl which works much better with opengl! Thanks, it looks very promising :)
Any clue about how I can hook CImGui into the GL context Makie creates ? I gave it a try and it sounds really unfamilliar to me.
Maybe this code, which uses CairoMakie, can be adapted to use GtkGLArea. https://github.com/MakieOrg/Makie.jl/issues/568#issuecomment-1299103853
Maybe this code, which uses CairoMakie, can be adapted to use GtkGLArea. #568 (comment)
Any idea what kinds of adaptations this needs? Or what the status of GLMakie-in-Gtk is? I'm currently trying to embed interactive plots in a GUI to create a data analysis application (for Windows). I have something working with CairoMakie+Gtk based on that issue, but of course interactivity is missing. 😢
https://github.com/jwahlstrand/GtkMakie.jl from @jwahlstrand seems to be at a point where one should be able to at least prototype GUIs with GLMakie + Gtk pretty well ;) Of course not really "production ready" yet...
Thanks for the pointer! I'll see how far along I can prototype before I cut myself on a sharp edge. 😂 The open PR and issue suggest to me that the ride might be rough.
Seat belts might be a good idea. GtkMakie currently just creates a window with a single Makie widget, just like the GLFW-based backend. I've tried some examples of interactive Makie graphics, including sliders, menus, etc., and they seem to work. A Makie widget that you can place alongside other widgets is my goal, and it seems like it should be possible, but it's not working yet. It segfaults very consistently in the GLMakie rendering code -- maybe some sort of OpenGL issue with the GTK4 library, but more likely a mistake I'm making.
I just added a GtkGrid between the GtkGLArea for Makie and the GtkWindow so that other widgets can at least be placed next to it. This seems to work. BTW this uses Gtk4.jl, not Gtk.jl, so your Gtk code may have to be modified a bit.
Update: I was able to assemble something, and can display and interact with plots. 🥳
Sometimes there are very weird long delays until newly added plots show up (not all), and various save()
attempts crash either the application or the whole Julia process, but I don't have a good repro for these problems (might also be my lack of experience).
I'm plotting out of an HDF5 file, and using plain GLMakie in the REPL works quickly (plot all traces in ~1s).
Only when it's in the GUI (GtkMakie+Gtk4) that things are sometimes delayed several(!) seconds when I select another plot trace. In summary, I do an empty!(ax)
, then lines(ax,...)
, then display(Screen, f.scene)
in the callback.
For me it doesn't rerender until the cursor is over the plot. If I replace display(...)
at the end of the callback with
Gtk4.queue_render(GtkMakie.win2glarea[screen.glscreen])
it seems to work reliably. That's pretty ugly so I'll work on making this happen automatically when the figure changes -- I need to learn more about GLMakie internals.
Ha, I did not realise that that is what's been going on -- indeed, that seems to be the source of the delays. This seems to have cured the delay problem. Thanks!
See also #568
Is it possible to embed Makie in a GTK application, for exemple using a
GtkGLArea
widget as OpenGL context for GLMakie ?https://github.com/JuliaPlots/Makie.jl/issues/568 discuss this for the Cairo backend.
(btw, coming back to the Makie ecosystem after a year or so, and I'm amazed by its progress! Maybe you remember me, Simon, I'm the one who made the logo ;-) )