Skip to content
vmagnin edited this page May 11, 2025 · 591 revisions

The gtk-fortran project provides Fortran bindings to the GTK collection of libraries (GTK, Cairo, GdkPixbuf, GLib...). It is cross-platform (Linux, macOS, BSD, Windows, Raspberry Pi) and licensed under GNU GPLv3 (with GCC Runtime Library Exception 3.1, see Licenses for more details).

With gtk-fortran you can build GTK graphical user interfaces (GUI), you can use GdkPixbuf to draw bitmaps, you can use Cairo to make vector graphics (on screen, in SVG files, PDF...) and also integrate scientific plotting via its additional PLplot interface. But it's not all about graphical interface, since you can also access the numerous functions of the generalist GLib library (regular expressions, hash, strings, hash tables, file utilities...). You can even play media files.

The gtk-fortran library can either be built and installed with CMake or be used as a simple Fortran Package Manager fpm dependency. It is also available on conda-forge for Linux and macOS. Its documentation and examples are designed to help you learn and use gtk-fortran and GTK.

Two associated repositories offer additional gtk-fortran material under MIT License:

  • gtkzero_fpm demonstrates how to use gtk-fortran as a fpm dependency.
  • gtk-fortran-extra offers more examples, especially concerning long scientific computations, parallel computation and use of the ForColormap project for scientific visualization.

You can ask support either here by opening an Issue (set the label "Support request") or in the Fortran-lang Discourse.

gtk-fortran developing

In this documentation

Tutorials
Get started with gtk-fortran
(install it, write your first application...)
How-to
Step by step guides
for common tasks
Explanation
Understand the workings of gtk-fortran
Reference
Technical information, APIs...

News

  • 2025-04-25: release of gtk-fortran 4.8.0, with interfaces to GTK 4.18 and GLib 2.84.
  • 2025-04-20: release of gtk-fortran 3.24.49 with interfaces to the latests GTK 3.24.49 and GLib 2.84.1. Includes the cfwrapper fixes of the 4.7.1 and 4.7.0 releases.
  • 2025-03-04: release of gtk-fortran 4.7.1 which fixes the interfaces of 98 functions (Issue #290).
  • 2024-11-05: release of gtk-fortran 4.7.0, with interfaces to GTK 4.16 and GLib 2.82.
  • 2024-05-08: exceptional release of gtk-fortran 3.24.41 with interfaces to the latest GTK 3.24.41, GLib 2.80.0, Cairo 1.18.0 and many things backported from gtk4 branch. It can now be used as a fpm dependency.

Citing gtk-fortran

You can acknowledge the use of gtk-fortran by citing this paper:

Vincent Magnin, James Tappin, Jens Hunger, Jerry De Lisle, "gtk-fortran: a GTK+ binding to build Graphical User Interfaces in Fortran", Journal of Open Source Software, 4(34), 1109, 12th January 2019, https://doi.org/10.21105/joss.01109

Star History

Star History Chart

Clone this wiki locally