Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vmagnin/gtkzero_fpm
We demonstrate how gtk-fortran can be used as a fpm (Fortran Package Manager) dependency.
https://github.com/vmagnin/gtkzero_fpm
fortran fortran-package-manager gtk gtk-fortran gui
Last synced: 12 days ago
JSON representation
We demonstrate how gtk-fortran can be used as a fpm (Fortran Package Manager) dependency.
- Host: GitHub
- URL: https://github.com/vmagnin/gtkzero_fpm
- Owner: vmagnin
- License: mit
- Created: 2021-06-03T13:17:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-08T09:05:14.000Z (8 months ago)
- Last Synced: 2024-11-09T14:52:29.625Z (2 months ago)
- Topics: fortran, fortran-package-manager, gtk, gtk-fortran, gui
- Language: Fortran
- Homepage:
- Size: 147 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Using gtk-fortran as a fpm dependency
We demonstrate how the Fortran Package Manager [fpm](https://fpm.fortran-lang.org/) 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](https://github.com/vmagnin/gtk-fortran/blob/gtk4/examples/gtkzero_gapp.f90) 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:
```bash
├── 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:
```toml
[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:
```bash
$ git clone [email protected]: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.