Fortran Wiki
GUI Development

GUI Development in modern Fortran


The gtk-fortran library is a set of Fortran modules that allow the GTK libraries to be called using the C interoperability features of modern Fortran. It can be used with GTK 4 for new projects, but also with GTK 3. Gtk-fortran is cross-platform: Linux, MSYS2 in Windows, FreeBSD, macOS, Raspbian on Raspberry Pi…

In addition to the standard GTK routines (along with GLib, GDK and Cairo) there is a high-level interface which uses Fortran’s optional argument system to create a programming interface to the most common widgets that should be more comfortable to IDL (Interactive Data Language) programmers. There is also an interface with the PLplot scientific plotting library, and additional tools like gtkf-sketcher to build graphical user interfaces using Glade 3.

Although the gtk-fortran project is licensed under GNU GPL v3 (with the additional permissions described in the GCC Runtime Library Exception version 3.1), there is also a gtk-fortran-extra repository with examples under MIT license, that you can use to start your own GTK scientific application without worrying about license problems. These examples also demonstrates how you can obtain an application that can be built with or without its GUI.

See that example screenshot.


The forGE project is “a framework designed to simplify construction of modern Fortran programs using the GTK GUI functions” from Gtk-fortran.