5

Have seen that GTK has binding for different language preferences - C, C++, Python.

Does it have bindings for Fortran though ? Have come across gtk-fortran library, but do not know whether it is part of GTK or a separate library. And would it be compatible with the GTK releases (GTK-4) at https://www.gtk.org/ ?

Gavat
  • 63
  • 2
    It's one thing to write number-crunching code in Fortran. But graphical applications, seriously?? – leftaroundabout Sep 13 '23 at 22:11
  • 2
    At least old school GTK is designed to offer a completely OOP style interface to C - which is not an OOP language. Tends to end up in extremely heavy handed code though (more code dealing with the OOP abstraction than actually doing stuff), even more heavy handed than pure C windows API code. Learning enough of that procedural oop-emulation (including manual reference management etc) might take just as long as learning eg python and fitting a python frontend to your fortran code. – rackandboneman Sep 13 '23 at 23:35
  • I am not afraid of work, – Gavat Sep 14 '23 at 13:01

2 Answers2

17

I confirm there are no official Fortran bindings provided by the GTK Project.

I was one of the founders of the gtk-fortran project in 2011 and I have maintained it since (the version 4.5 should be released at the beginning of November, with bindings to GTK 4.12 and GLib 2.78). It is based on a Python script I have developed to generate the Fortran interfaces from the C development files.

vmagnin
  • 186
3

According to their GitHub repo https://github.com/vmagnin/gtk-fortran, the gtk-fortran project supports GTK4.

Also, it is not officially maintained by the GTK project. However, it seems to be a well-maintained project.

Archisman Panigrahi
  • 28,338
  • 18
  • 105
  • 212
  • Do you mean to say that the GTK Project does not actually provide bindings for Fortran ? – Gavat Sep 13 '23 at 00:36
  • 1
    I don't know that. What I meant is, this code seems to be written by independent developers not affiliated with GTK project, but this code does help you write GUI apps using the GTK toolkit and the Fortran language – Archisman Panigrahi Sep 13 '23 at 00:47