Gtk Qt Web to make a GUI?

I have recently a good experience creating a GUI using the GLMakie.jl infrastructure. The up side is that the result is cross-platform (Windows, Mac, Linux), and that the Julia infrastructure to distribute binaries (such as the underlying Fortran code) is great (in summary, you’ll have your binary code stored as a Julia package in Yggdrasil and have it as a dependency of the interface package) - the Julia built in package manager takes care of all dependencies. I currently use that just to distribute a Fortran code, with a very thin Julia package wrapping it, and I have less issues with user installations than ever.

The downside is that, currently, it is easy to distribute the interface if the user does not have a barrier towards installing Julia and running a few commands in the Julia REPL. The alternative is to distribute an app pack, but which will be quite heavy, to carry the Julia runtime and the dependencies.

The example GUI I have is this one:

When run there is an interactive bouncing of the particles there and updates of the plots.

From this package, which simulates chemical reactions for education purposes (this one does not have Fortran code inside, but could have).

3 Likes

Personally I use Python with PyQt or PySide and pyqtgraph (https://www.pyqtgraph.org/) for the graphics.

I use Fortran for speeding some critical part of the applications. Consider that I’m mostly displaying and analyzing experimental data, and a fast graphic is essential (matplotlib is too slow).
One feature that I found quite interesting in pyqtgraph is that I can plot a vertical line that can be moved on a graph and act like a slider (actually every graphic object can react to an action on them).

I had a look at GLMakie and I found it interesting, the problem that I still have is that in order to zoom differently along the x or the y of a plot I need to use the keyboard, while in pyqtgraoh there is the same convention of matpltolib: you can “pan” with the left mouse button and zoom with the right mouse button.

1 Like

I attempted to use fortran with gtk recently. Chatgpt turned to be extremely useful and time-saving in providing a template for the problem I was trying to solve. It also spelled out all dependencies. The solution wasn’t perfect, but it took me one hour instead of days fighting with gtk.

1 Like

You can find a list of GTK tutorials here: Tutorials · vmagnin/gtk-fortran Wiki · GitHub
The two first are in C. A moderate knowledge of that language is of course an advantage to dive into the GTK world.

1 Like

I draw icon with opengl in intel Fortran. One good thing is I can make it big. Should be able to read svg icon file and draw.