Make sure you have Gtk4 installed:
- On MacOS, do
brew install gtk4
- On Debian-based Linux systems, you can do
sudo apt install libgtk-4-dev
You can check the installation by running pkg-config --cflags gtk4
- it should succeed.
The bindings are published to Maven central, with gtk4 specifically being available at the following coordinates:
com.indoorvivants.gnome::gtk4::<version> // Scala CLI/Mill format
"com.indoorvivants.gnome" %%% "gtk4" % "<version>" // SBT format
This repository contains a very small app you can run.
$ pkg-config --cflags gtk4 | xargs -n1 > compilationFlags
$ pkg-config --libs gtk4 | xargs -n1 > linkingFlags
$ scala-cli run ./examples/src/main/scala/example.scala --native --native-compile @$PWD/compilationFlags --native-linking @$PWD/linkingFlags --dep com.indoorvivants.gnome::gtk4::0.0.4 # or change the version to latest
Bindings generated using sn-bindgen