Best GUI package for beginners

Hey, I am trying to create a GUI which should be very basic in nature. I just want to have some input field for the parameters and a plot button, and when I click the plot button it should plot it on the GUI.

I have been trying to set up something described above, but I am failing to do so. Gtk is no longer being maintained, as I have learned. Gtk4 is, but it is also not so reliable. I also installed Mousetrap but that also doesn’t seem fit for the job, as for plotting their widget MousetrapMakie is not working atm.

Now the thing is, what gets plotted is the solution of a complex PDE. Designing a GUI in Python is much more reliable according to my experience but the problem is of course the speed of Julia. it takes <1 second with Julia to calculate the PDE whereas in python >90 seconds.

I have also considered using a Python GUI with a Julia backend PDE calculator, but somehow I also couldnt get this to work.

I am not sure what to do. Any kind of help is appreciated!

I’m not saying “best” but it’s easy enough to do simple GUIs with GLMakie, and if you want to plot things anyway why not go with a plotting package.

For example this video from the Menu reference page at docs.makie.org/stable/reference/blocks/menu

If by “input field for the parameters” you mean a full text editing widget, though, we don’t have that. Only simple text boxes for single lines currently.

3 Likes

Right, I don’t know which is best, since I’ve not used any of the the options, but since I’ve been recommending Mousetrap.jl on perception I would like to know what works well with it and what doesn’t.

People DO recommend QML.jl over it. But I think the former also just works with some non-OpenGL plotting. I don’t know it it’s CairoMakie.jl or something completely unrelated from Makie.

That’s also an option, anything from Python for the GUI, then juliacall, i.e. PythonCall.jl to call Julia.

FYI: I decided to test and see what breaks with Mousetrap.jl or well MousetrapMakie.jl. At first I only got the former to install. In the end I could sort of use “the latter” and get a window…

Note, Moustrap.jl alone seems to work, i.e. “the Hello World” I tried from the README.

The latter was supposed to work with this code here: `gdk_x11_surface_get_xid` Segmentation Fault when initializing Mousetrap · Issue #25 · Clemapfel/Mousetrap.jl · GitHub

But for the errors you get, like:

ERROR: UndefVarError: `retina_scaling_factor` not defined

I just tried to remove prefixes like GLMakie. in front, until it would parse… Then I got this broken window/screenshot:

I tested with Julia 1.10.5:

$ julia --project=

Note there’s mousetrap_jll but I didn’t use libmousetrap_jll since I couldn’t find it nor install (is it supposed to be the same and was renamed?). There’s also available that I didn’t install: mousetrap_apple_jll, mousetrap_windows_jll, and mousetrap_linux_jll

I had this installed at the time:

(pharaldsson) pkg> st
Status `~/Project.toml`
  [09cdc199] BasicAutoloads v1.0.2
  [992eb4ea] CondaPkg v0.2.23
⌃ [1f15a43c] CxxWrap v0.14.2
  [a10d1c49] DBInterface v2.6.1
  [a93c6f00] DataFrames v1.7.0
  [e9467ef8] GLMakie v0.10.15
  [5c1252a2] GeometryBasics v0.4.11
  [ee78f7c6] Makie v0.21.15
  [5deeb4b9] Mousetrap v0.3.1 `https://github.com/clemapfel/Mousetrap.jl#main`
  [aebf437e] MousetrapMakie v0.1.0 `https://github.com/clemapfel/MousetrapMakie.jl#main`
  [be6f12e9] ODBC v1.1.2
  [5736bd91] ObjectOriented v0.1.4
  [7240a794] Oracle v0.3.3
  [6099a3de] PythonCall v0.9.23
  [6f49c342] RCall v0.14.6
  [65257c39] ShaderAbstractions v0.4.1
  [2b41e42f] StippleMarkdown v0.2.0
  [86993f9b] TidierDB v0.5.0
  [287f9a42] libmousetrap_jll v0.3.0+0 `https://github.com/clemapfel/mousetrap_jll#main`
  [0e90efc8] mousetrap_jll v0.3.0+0

This did not stop me:

[ Info: Precompiling GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a]
┌ Warning: attempting to remove probably stale pidfile
│   path = "/home/pharaldsson/.julia/compiled/v1.10/Makie/iZ1Bl_mupLX.ji.pidfile"
└ @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:244

This did:

PkgPrecompileError: The following 1 direct dependency failed to precompile:

MousetrapMakie [aebf437e-4a9b-4da2-be5f-abfe051cab05]

Failed to precompile MousetrapMakie [aebf437e-4a9b-4da2-be5f-abfe051cab05] to "/home/pharaldsson/.julia/compiled/v1.10/MousetrapMakie/jl_ZzCTIv".
ERROR: LoadError: UndefVarError: `retina_scaling_factor` not defined

Did you try QML? I think this is the most mature option. Makie is also an option, but I use it for 3D graphics only. If you need nice classical GUI elements like drop-down boxes etc, then I think QML is a better choice than Makie.

You can also combine them, but that works only with some older Makie version.

So many nice examples: GitHub - barche/QmlJuliaExamples: Examples for the QML.jl package

2 Likes

This is also a question I have been wondering about. Mousetrap seemed promising, but I was not able to Render a rectangle with OpenGL in its examples. With the author on sick leave, I would want to wait until he is back.
For me, ideally the GUI will work on the Raspberry PI 4 as well as more powerful machines. OpenGL is not supported well on the RPI, where CairoMakie and GLMakie seem to be too demanding on the hardware. I have not yet tried QML.jl but it has received some recommendations in discourse in the past. I would be curious what people also recommend for the RPI.
@ufechner7
Edit: ufechner7 answered while I was composing my reply!

I have some good experiences with

though I wouldn’t say it’s for beginners. But by adapting the extensive demo it’s also not too hard to get a working GUI.