Related tags

Images tools go-gtk3



Hopefully GTK3 Bindings using gobject binding for Go.

Goal is to have fairly complete gtk3 widgets
with pango, gdkpixbuf and cairo objects.


go get github.com/norisatir/go-gtk3/gtk3

For demo:

cd $GOPATH/src/github.com/norisatir/go-gtk3/demo
go build

(Demo apps are taken from gtk3 demo apps, translated to go)


Under same terms and conditions as the Go language,
BSD style license


"Gtk" has been stripped from the names.


  • AccelGroups
  • Clipboard


  • Widget
  • Container
  • Bin
  • Range


  • Window
  • Dialog
  • MessageDialog
  • Invisible
  • Assistant


  • Label
  • ProgressBar
  • Image
  • Statusbar
  • Spinner
  • InfoBar


  • Button
  • ToggleButton
  • CheckButton
  • RadioButton
  • LinkButton
  • Switch


  • Entry
  • EntryBuffer
  • EntryCompletion
  • Scale
  • SpinButton


  • TextTag
  • TextTagTable
  • TextIter
  • TextBuffer
  • TextChildAnchor
  • TextView


  • TreePath
  • TreeRowReference
  • TreeIter
  • TreeModel
  • ListStore
  • TreeStore
  • CellArea
  • CellAreaContext
  • CellLayout
  • CellView
  • CellRenderer (and brothers)
  • TreeViewColumn
  • TreeSelection
  • TreeView


  • ComboBox
  • ComboBoxText
  • MenuShell
  • Menu
  • MenuBar
  • MenuItem (and brothers)


  • ColorButton


  • Action


  • Grid
  • Box
  • ButtonBox
  • Paned
  • Notebook


  • Frame
  • Separator


  • ScrollBar
  • ScrolledWindow


  • Application


  • Matej Knific
  • go-gtk3 stopped working

    go-gtk3 stopped working

    Something in my system must have been updated so that go-gtk3 does not work anymore. When starting the freshly compiled go-gtk3 demo on the current go weekly i get the following error:

    $ ./demo 
    panic: runtime error: assignment to entry in nil map
    goroutine 1 [running]:
    github.com/norisatir/go-gtk3/gobject.RegisterGoType(0x40, 0x42856b, 0x42ccea, 0x4f6e6a)
            go/src/pkg/github.com/norisatir/go-gtk3/gobject/_obj/closure.cgo1.go:722 +0x43
            go/src/pkg/github.com/norisatir/go-gtk3/gobject/_obj/closure.cgo1.go:37 +0x2d
            go/src/pkg/github.com/norisatir/go-gtk3/gobject/_obj/closure.cgo1.go:1164 +0x5e
            go/src/pkg/github.com/norisatir/go-gtk3/pango/_obj/pango.cgo1.go:3 +0x45
           go/src/pkg/github.com/norisatir/go-gtk3/demo/demo.go:0 +0x3b

    I was able to compile the same program on the 4th of January. I looked at my distributions update log (archlinux) but could not find an update to gtk3 or similar.

    opened by dersebi 11
  • License


    Although you already state the the license in the README, would you please consider adding a LICENSE and/or COPYING file? This will keep the legal guys of my distro happier as I package this for our repos.

    Thanks for the package!

    opened by gnanderson 1
  • Trying to install go-gtk3 yields; gobject-2.0 appears to be missing???

    Trying to install go-gtk3 yields; gobject-2.0 appears to be missing???

    Executing the following Go Get command: $ go get github.com/norisatir/go-gtk3/gtk3

    The following diagnostic text shows up on my console: pkg-config --cflags gobject-2.0 Package gobject-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gobject-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gobject-2.0' found pkg-config: exit status 1

    What am I missing here? Any help to get this resolved would be greatly appreciated.


    opened by peteArnt 0
  • error: 'g_type_init' is deprecated

    error: 'g_type_init' is deprecated


    When trying to:

    go get github.com/norisatir/go-gtk3/gtk3

    It fails, saying that:

    # github.com/norisatir/go-gtk3/gobject
    gobject.go:91:1: error: 'g_type_init' is deprecated (declared at /usr/include/glib-2.0/gobject/gtype.h:669) [-Werror=deprecated-declarations]
       val, err := ConvertToGo(gv.GetPtr(), gv.gtype)
    cc1: all warnings being treated as errors

    When disabling the deprecation warning/error, I get the following errors instead:

    # github.com/norisatir/go-gtk3/gobject
    gobject.go: In function ‘_cgo_37d2f2f5c597_Cfunc_g_type_init’:
    gobject.go:274:2: warning: ‘g_type_init’ is deprecated (declared at /usr/include/glib-2.0/gobject/gtype.h:669) [-Wdeprecated-declarations]
    # github.com/norisatir/go-gtk3/gobject
    In file included from /usr/lib/glib-2.0/include/glibconfig.h:9:0,
                     from /usr/include/glib-2.0/glib/gtypes.h:34,
                     from /usr/include/glib-2.0/glib/galloca.h:34,
                     from /usr/include/glib-2.0/glib.h:32,
                     from ./go-gobject.h:6,
                     from ./go-gobject.c:1:
    ./go-gobject.c: In function ‘_g_clear_object’:
    /usr/include/glib-2.0/glib/gmacros.h:181:53: error: size of array ‘_GStaticAssertCompileTimeAssertion_0’ is negative
     #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
    /usr/include/glib-2.0/glib/gmacros.h:178:47: note: in definition of macro ‘G_PASTE_ARGS’
     #define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
    /usr/include/glib-2.0/glib/gmacros.h:181:44: note: in expansion of macro ‘G_PASTE’
     #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
    /usr/include/glib-2.0/glib/gmem.h:115:5: note: in expansion of macro ‘G_STATIC_ASSERT’
         G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer));                       \
    /usr/include/glib-2.0/gobject/gobject.h:650:36: note: in expansion of macro ‘g_clear_pointer’
     #define g_clear_object(object_ptr) g_clear_pointer ((object_ptr), g_object_unref)
    ./go-gobject.c:23:2: note: in expansion of macro ‘g_clear_object’
    ./go-gobject.c:23:2: error: cannot convert to a pointer type

    I'm currently on 32-bit Arch Linux with gtk 3.10.2, go 1.1.2 and gcc 4.8.2.

    Thanks for looking into this.

    Best regards, Alexander Rødseth

    opened by xyproto 3
  • gdk threads compile error

    gdk threads compile error

    gdk3.go: In function '_gdk_threads_init': gdk3.go:7:2: error: 'gdk_threads_init' is deprecated (declared at /usr/include/gtk-3.0/gdk/gdkthreads.h:43) [-Werror=deprecated-declarations] gdk3.go: At top level: gdk3.go:37:1: error: 'gdk_threads_leave' is deprecated (declared at /usr/include/gtk-3.0/gdk/gdkthreads.h:47) [-Werror=deprecated-declarations] gdk3.go:69:1: error: 'gdk_threads_enter' is deprecated (declared at /usr/include/gtk-3.0/gdk/gdkthreads.h:45) [-Werror=deprecated-declarations] cc1: all warnings being treated as errors

    opened by hwch 0
  • gtk_widget_get_pointer is deprecated

    gtk_widget_get_pointer is deprecated

    # github.com/norisatir/go-gtk3/gtk3
    gtk3.go:1341:1: error: 'gtk_widget_get_pointer' is deprecated (declared at /usr/include/gtk-3.0/gtk/gtkwidget.h:747): Use 'gdk_window_get_device_position' instead [-Werror=deprecated-declarations]
    cc1: all warnings being treated as errors

    I get this error with libgtk-3-dev 3.4.0-0ubuntu3~oneiric1.

    Replacing line 1066: C.gtk_widget_get_pointer(self.object, &cx, &cy)

    with: C.gdk_window_get_device_position(C.gtk_widget_get_window(self.object), C.gtk_get_current_event_device(), &cx, &cy, nil)

    seems to solve the issue.

    opened by colemickens 3
nori satir
nori satir
Go bindings for GLFW 3

GLFW 3.3 for Go Installation GLFW C library source is included and built automatically as part of the Go package. But you need to make sure you have d

OpenGL with Golang 1.3k Dec 25, 2022
Go bindings for OpenGL (generated via glow)

gl This repository holds Go bindings to various OpenGL versions. They are auto-generated using Glow. Features: Go functions that mirror the C specific

OpenGL with Golang 947 Dec 12, 2022
Go bindings to OpenGL Utility Library

GLU This package offers minimal bindings for GLU functions. Usage go get github.com/go-gl-legacy/glu License Copyright 2012 The go-gl Authors. All ri

go-gl legacy 21 Aug 18, 2018
Go bindings for audio capture and playback with ALSA and libasound

Go ALSA bindings These bindings allow capture and playback of audio via ALSA using the alsa-lib library. Installation go get github.com/cocoonlife/goa

null 38 Nov 26, 2022
naive go bindings to GnuPlot

go-gnuplot Simple-minded functions to work with gnuplot. go-gnuplot runs gnuplot as a subprocess and pushes commands via the STDIN of that subprocess.

Sebastien Binet 26 Nov 8, 2021
Experimental OpenAL bindings for Go.

Experimental OpenAL bindings for Go. ==================================== Everything is evolving quickly and nothing is totally done. If you want to

Peter H. Fröhlich 30 Jul 24, 2022
Go bindings for OpenCV / 2.x API in gocv / 1.x API in opencv

Go OpenCV binding A Golang binding for OpenCV. OpenCV 1.x C API bindings through CGO, and OpenCV 2+ C++ API (GoCV) through SWIG. Disclaimer This is a

go-opencv 1.3k Dec 21, 2022
Go bindings for GStreamer (retired: currently I don't use/develop this package)

Retired. I don't use/develop this package anymore. Go bindings for GStreamer at a very early stage of maturity. This package is based on GLib bindings

Michał Derkacz 166 Nov 10, 2022
Go bindings for libVLC and high-level media player interface

Go bindings for libVLC 2.X/3.X/4.X and high-level media player interface. The package can be useful for adding multimedia capabilities to applications

Adrian-George Bostan 328 Dec 31, 2022
Go bindings for OpenCV1.1 (Dev/Zero Dependencies).

Go语言QQ群: 102319854, 1055927514 凹语言(凹读音“Wa”)(The Wa Programming Language): https://github.com/wa-lang/wa Go bindings for OpenCV1.1 PkgDoc: http://godoc

chai2010 116 Dec 6, 2022
Cgo bindings to PulseAudio's Simple API, for easily playing or capturing raw audio.

pulse-simple Cgo bindings to PulseAudio's Simple API, for easily playing or capturing raw audio. The full Simple API is supported, including channel m

Tommy 24 Dec 17, 2022
Vulkan API bindings for Go programming language

Golang Bindings for Vulkan API Package vulkan provides Go bindings for Vulkan — a low-overhead, cross-platform 3D graphics and compute API. Updated Oc

null 665 Jan 3, 2023
Go cross-platform OpenGL bindings.

gl Package gl is a Go cross-platform binding for OpenGL, with an OpenGL ES 2-like API. It supports: macOS, Linux and Windows via OpenGL 2.1 backend, i

null 162 Nov 21, 2022
Go bindings for GTK3

gotk3 The gotk3 project provides Go bindings for GTK 3 and dependent projects. Each component is given its own subdirectory, which is used as the impo

gotk3 1.9k Jan 6, 2023
GTK3-based dock for sway

nwg-dock Fully configurable (w/ command line arguments and css) dock, written in Go, aimed exclusively at sway Wayland compositor. It features pinned

Piotr Miller 91 Dec 23, 2022
wsmgr-for-i3 is a Go GTK3 program to manage i3 workspaces.

wsmgr-for-i3 wsmgr-for-i3 (workspace manager for i3) is a Go GTK3 program to manage i3 workspaces. It allows you to re-order and re-name workspaces ea

Michael Stapelberg 30 Nov 5, 2022
A rewrite of DrPetter's sfxr in Go and GTK3

gosfxr This is a rewrite of DrPetter's sfxr in Go and GTK3 that only exists because I wanted to get my feet wet with UI development in Go. Please refe

null 0 Dec 27, 2021
libsox bindings for go

gosox "SoX − Sound eXchange, the Swiss Army knife of audio manipulation" Go bindings for the libsox sound library For more information and documentati

Kristoffer Grönlund 124 Nov 22, 2022
Go bindings for the PortAudio audio I/O library

portaudio This package provides an interface to the PortAudio audio I/O library. See the package documentation for details. To build this package you

Gordon Klaus 559 Jan 1, 2023
Go bindings for libportmidi

portmidi Want to output to an MIDI device or listen your MIDI device as an input? This package contains Go bindings for PortMidi. libportmidi (v. 217)

Jaana Dogan 276 Dec 25, 2022