-
Notifications
You must be signed in to change notification settings - Fork 43
Home
The gtk-fortran project provides bindings to the Fortran language for the GTK libraries (GTK, Cairo, GdkPixbuf, GLib...) and is licensed under GNU GPLv3 (with GCC Runtime Library Exception 3.1, see Licenses for more details). Like GTK and Fortran, it is cross-platform (Linux, macOS, BSD, Windows, Raspberry Pi).
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.
You can ask support either in the Issues tab with the label "Support request" or in the Fortran-lang Discourse.
![gtk-fortran developing](wiki/gtk-fortran_developing.png)
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... |
- 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.
- 2024-04-19: release of gtk-fortran 4.6.0, with interfaces to GTK 4.14 and GLib 2.80. It also fixes a problem with the macOS linker and demonstrates in
examples/bazaar.f90
how you can play an audio file by using a GtkMediaStream. - 2024-03-04: a new example has been added in the gtk-fortran-extra repository (MIT license). It uses the ForColormap library and creates a movie with Turing patterns, displayed with various colormaps.
- 2023-05-11: a few short video tutorials are available.
- 2023-04-22: a new example has been added in the gtk-fortran-extra repository (MIT license). It is a gtk-fortran application to encode a text using Peter Saville's color code.
- 2023-04-04: a new How to hack the cfwrapper for people wanting to try it with other C libraries.
- 2022-05-30: a new example has been added in the gtk-fortran-extra repository (MIT license). It demonstrates how you can use modern Fortran parallel features (coarrays, events, teams, collective routines) with gtk-fortran. It computes a Buddhabrot.
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
- Installation
- My first gtk-fortran application
- Drawing an image in a PNG file (without GUI)
- A program also usable without GUI
- Using Glade3 and gtkf-sketcher (GTK 3)
- Using gtk-fortran as a fpm dependency
- Debugging with GtkInspector
- Learning from examples
- Video tutorials
- How to start my own project from a gtk-fortran example
- git basics
- CMake basics
- Alternatives to CMake
- How to migrate to GTK 4
- How to contribute to gtk-fortran
- How to hack the cfwrapper