Skip to content

We demonstrate how gtk-fortran can be used as a fpm (Fortran Package Manager) dependency.

License

Notifications You must be signed in to change notification settings

vmagnin/gtkzero_fpm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using gtk-fortran as a fpm dependency

We demonstrate how the Fortran Package Manager fpm can be used to build and run a gtk-fortran program, using gtk-fortran as a fpm dependency. The present gtkzero_fpm example is based on the GTK 4 gtkzero_gapp example and just opens an empty GTK window.

Requirements

  • The GTK 4 development files are supposed to be installed on your system.
  • You need fpm,
  • and a modern Fortran compiler (>= Fortran 2008).

The sources

The original gtkzero_gapp.f90 has been divided in two files main.f90 and handlers.f90. This is the tree of the project, before building:

├── app
│   └── main.f90
├── build
├── fpm.toml
├── LICENSE
├── README.md
├── src
│   └── handlers.f90
└── test
    └── check.f90

The fpm.toml manifest must contain a dependencies section with gtk-fortran:

[dependencies]
gtk-fortran = { git = "https://github.com/vmagnin/gtk-fortran.git", branch = "gtk4" }

Building and running

The project can be downloaded, built and run very simply:

$ git clone git@github.com:vmagnin/gtkzero_fpm.git
$ cd gtkzero_fpm
$ fpm run

You should see on screen an empty GTK window with an "hello world" title.

License

This example is under MIT license. You can therefore use it to begin your own project, and just copy that license above the concerned code sections.

About

We demonstrate how gtk-fortran can be used as a fpm (Fortran Package Manager) dependency.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published