Go bindings for GTK3
The gotk3 project provides Go bindings for GTK 3 and dependent projects. Each component is given its own subdirectory, which is used as the import path for the package. Partial binding support for the following libraries is currently implemented:
Care has been taken for memory management to work seamlessly with Go's garbage collector without the need to use or understand GObject's floating references.
for better understanding see package reference documation
On Linux, see which version your distribution has here with the search terms:
The following example can be found in Examples.
…To build the example:
$ go build example.goTo build this example with older gtk version you should use gtk_3_10 tag:
$ go build -tags gtk_3_10 example.go……Each package's internal go doc style documentation can be viewed
online without installing this package by using the GoDoc site (links
to cairo,
glib,
gdk, and
gtk documentation).
You can also view the documentation locally once the package is
installed with the godoc tool by running godoc -http=":6060" and
pointing your browser to
http://localhost:6060/pkg/github.com/gotk3/gotk3
gotk3 currently requires GTK 3.6-3.24, GLib 2.36-2.46, and Cairo 1.10 or 1.12. A recent Go (1.8 or newer) is also required.
For detailed instructions see the wiki pages: installation
By default, deprecated GTK features are not included in the build.
By specifying the e.g. build tag gtk_3_20, any feature deprecated in GTK 3.20 or earlier will NOT be available.
To enable deprecated features in the build, add the tag gtk_deprecated.
Example:
$ go build -tags "gtk_3_10 gtk_deprecated" example.goThe same goes for
Package gotk3 is licensed under the liberal ISC License.
Actually if you use gotk3, then gotk3 is statically linked into your application (with the ISC licence). The system libraries (e.g. GTK+, GLib) used via cgo use dynamic linking.
No open issues yet, or sync has not completed.