A GTK4 bindings generator for Go.
Package documentation | Package examples | GIR documentation | Progress tracker
All generated packages are in pkg/. The generation code is in gir/girgen/.
Examples are put in another repository, diamondburned/gotk4-examples, along with instructions on getting started with using these packages. Refer to its README for more information.
pkg/gtk/v4 binds the full introspectable GTK4 API — a coverage guard test
(TestGTK4Coverage) enforces that every public GTK4 type is generated or
explicitly excluded — and most of pkg/gtk/v3 is ready for most purposes.
Memory leaks and occasional crashes may still occur in certain parts of the
API; in that case, an issue should be opened.
| GTK Versions | Branch |
|---|---|
| 4.22 | 4, main |
| 4.16 | 4.16 |
Requires Go 1.26+.
For contributing guidelines, see CONTRIBUTING.md.
For questions and discussions, join the gotk4 Matrix room!
gotk4 contains 3 directories licensed differently:
gotk4/giris licensed under the GNU Affero General Public License v3. This license does not apply to the code generated by itself.gotk4/pkgis licensed under the Mozilla Public License v2.gotk4/pkg/cairois licensed under the MIT license, originally written by "Conformal Systems", later maintained by the gotk3 organization.
Some small snippets of code were taken from tinyzimmer's go-glib, which implements type subclassing.
The logo is licensed under the Creative Commons CC0 1.0 Universal Public Domain Dedication from egonelbre/gophers. It was modified to have a GTK4 logo.
The Gopher itself is licensed under the Creative Commons Attribution 4.0 by Renee French.
The GTK logo is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported by Andreas Nilsson, taken from the GNOME Project.
