Gtk-fortran 20.04 released, preparing for GTK 4

Thank you for this new Fortran reference site !

gtk-fortran 20.04 released

gtk-fortran 20.04 is based on GTK 3.24.18 and GLib 2.64.2.

The main objective of this release was to prepare the future GTK 4 migration. A lot of clean-up has been made: scripts, build tools, examples (a lot of deprecated functions were removed)…

Toward GTK 4

A gtk4 development branch has been created. The core of the library is ready for GTK 4 (3.98.3, available for example in Fedora 32). Some examples are already running. The big work will be to upgrade each example and the HL library and its examples.

GTK 4 could be released at the end of this year. See:


Thanks for the announcement @vmagnin and welcome!

Is the entry for gtk-fortran at accurate?

Yes, it’s OK. Thank you for it @certik !

It seems the release badge shows only the latest “true release”, not the “tagged releases” (I don’t know if it is the official term). For example, for gtk-fortran 20.04 I have just made a tagged release. I don’t know if it is possible to change that.

Or perhaps it’s me who should make a full release…

I don’t quite understand how it works either. Here is the entry:

it somehow picks up the latest release from GitHub, but I noticed it sometimes has problems. @lkedward do you know what the issue could be here?

You can always specify a version field and put there a version that you want. Just send us a PR.

Welcome @vmagnin!

From this page it looks v20.04 is a tag but somehow not a release. Perhaps it’s still a release draft that needs to be published. I’m confused about how GitHub treats releases vs. git tags. If you (as the repo owner) click on your v20.04 tag page, is there a button there that says “Publish this release” or similar?

1 Like

Thanks for your help @milancurcic and @certik
I am happy to see I am not the only one confused with that ! :wink:
You are right, although the tagged versions appear in the “Releases” page, they are not releases… But with the button “Draft a new release” on the right, I was able to transform my tagged version into a true release.
And it was immediately detected on the page
Thanks again !


Vincent, have you considered presenting the latest Gtk-Fortran at FortranCon 2020? I’m personally am very interested in hearing you talk about it and giving a live demo.

It’s remote-friendly and free to register. The deadline for abstract submission is June 1.

(Disclosure: I’m on the scientific committee of the event and review abstracts in the selected presentations track.)

The (remote) presentation gtk-fortran: a GTK / Fortran binding has been accepted at FortranCon 2020 :switzerland: :

I don’t know yet exactly which tools will be used (live or recorded video, slides and audio ?) but I will do my best to present the project in an attractive way.


My gtk-fortran presentation is on Friday 13:30 - 13:55 (UTC+2 - CEST) in the Session D Interfacing. I will use a PDF presentation but also will share my screen to show you how to build the project and to run some cool examples, and show some code if I have time.

And I am preparing my best oral English for you ! :woozy_face:


I have created in the wiki documentation a Tutorials page:
and a first tutorial (my first gtk-fortran application):
which gives the user the gtk-fortran basics: creating a GtkApplication with a window, add some widgets and finally draw an image, the Feigenbaum fractal, also known as the bifurcation diagram of the logistic map.

Every comments welcome! :ear:

More tutorials will follow. And I plan to reorganize the documentation.

1 Like

@vmagnin the links use some kind of a redirect and say " There’s been a glitch…"

1 Like

Thanks a lot Ondrej,
it is corrected. It seems Slack made strange things with my link. I don’t know what happened…

Thanks. The tutorial looks great.

I agree it’s good to have ways to create a GUI, very common for scientific applications. I recently learned how to use Qt (from C++, and then I link in Fortran code) and it’s great to be able to design a GUI.

My understanding is that GTK itself is LGPL, so you might be able to license your wrappers as LGPL also (instead of the current GPL license) which might get you more users.

1 Like

Yes, I will reopen the “License Issue”. I think there would no problem for changing the license of the Fortran interfaces, because they are automatically generated by a script. Is it possible to distribute a project with a license for a part of the code and another license for the other part ?

Concerning the code written by human beings, I guess every developer should agree to change the license.

Note also that our license includes the following exception:

! Under Section 7 of GPL version 3, you are granted additional
! permissions described in the GCC Runtime Library Exception, version
! 3.1, as published by the Free Software Foundation.

But sincerely I am not sure to understand clearly :face_with_raised_eyebrow: what it really permits with gtk-fortran:

Interesting. If I understand you write the GUI in C++ ? How do you link C++ and Fortran ?
Ten years ago I had the choice of trying to work with Qt, WxWidgets, both written in C++, and GTK written in C. I choose GTK because of the ISO_C_BINDING.

Qt is quite complicated (it has a UI Designer, which generates some xml files which then generates some C++ code; also it has custom C++ extension for “slots” which must be handled appropriately), and cmake has great support for it. Since CMake supports Fortran, I just compile everything together. The main application is in C++, but I use Fortran for all the computational parts.

I have never worked with Qt but GTK is probably as complicated as Qt. The two are general purpose GUI frameworks, and that can not be simple…

In GTK you can also use an UI Designer, called Glade, which generates an XML file. And you can use that file with the gtkf-sketcher.f90 tool in gtk-fortran to generate Fortran code which handles that XML file. It can be useful for complicated GUIs. Note that it’s the only tool that we have yet to port to GTK 4.

But for a simple GUI (<=a few tens of widgets), you can also program it using directly the GTK functions.

The “advantage” (perhaps not an advantage for everyone) of gtk-fortran is that your program is 100% Fortran.

1 Like

That’s great, thank you for maintaining the wrappers.

I used to do GUIs all the time using Delphi in the 1990s. It was so simple and natural. Then I haven’t done any GUI until about a year ago using Qt. What do you recommend for plotting for GTK? For Qt I am using this library:

It works really great.

1 Like

gtk-fortran includes an interface to PLplot ( You can see some hl_plplot*.png screenshots here:

In the 90’s I practiced Visual Basic, also great for GUIs!
In the 80’s, I remember how easy it was to draw pixels in Basic or Turbo Pascal.
After 1995, I used a lot Visual Fortran (Digital then Compaq). I was happy with it on Windows and I even now and then still use it under Linux thanks to the Wine library! (it works quite fine, not perfectly, the debugger does not work, and there is some speed loss).

Thanks for making a proper tutorial for this tool.
To me, a poor fortran programmer, GTK looks daunting without having much experience with C, and it doesn’t help much that I haven’t been able to find any book about the later 3 version. So far I have just learned how to configure my enviroment with MSYS2 and CodeblocksFortran on Windows 10 to compile the 1st sample program in GTK’s documentation… with proper window icons.
Anyway, I fully expect to dive into gtk-fortran sometime!

1 Like