go-gtk3 - GTK3 BINDINGS FOR GO

go-gtk3 - GTK3 BINDINGS FOR GO

THIS IS:

Hopefully GTK3 Bindings using gobject binding for Go.

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

INSTALL:

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

For demo:

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

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

LICENSE:

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

IMPLEMENTATION LIST:

Note:
"Gtk" has been stripped from the names.

GTK3 CORE:

  • AccelGroups
  • Clipboard

BASE OBJECT:

  • Widget
  • Container
  • Bin
  • Range

WINDOWS:

  • Window
  • Dialog
  • MessageDialog
  • Invisible
  • Assistant

DISPLAY WIDGETS:

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

BUTTONS AND TOGGLES:

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

NUMERIC/TEXT DATA ENTRY:

  • Entry
  • EntryBuffer
  • EntryCompletion
  • Scale
  • SpinButton

MULTILINE TEXT EDITOR:

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

TREE, LIST AND ICON GRID WIDGETS:

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

MENUS, COMBOBOX, TOOLBAR:

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

SELECTORS (COLOR,FILE,FONT):

  • ColorButton

ACTION-BASED MENUS AND TOOLBARS

  • Action

LAYOUT CONTAINERS:

  • Grid
  • Box
  • ButtonBox
  • Paned
  • Notebook

ORNAMENTS:

  • Frame
  • Separator

SCROLLING:

  • ScrollBar
  • ScrolledWindow

APP:

  • Application

AUTHOR

  • Matej Knific
Comments
  • 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
    github.com/norisatir/go-gtk3/gobject.init·2()
            go/src/pkg/github.com/norisatir/go-gtk3/gobject/_obj/closure.cgo1.go:37 +0x2d
    github.com/norisatir/go-gtk3/gobject.init()
            go/src/pkg/github.com/norisatir/go-gtk3/gobject/_obj/closure.cgo1.go:1164 +0x5e
    github.com/norisatir/go-gtk3/pango.init()
            go/src/pkg/github.com/norisatir/go-gtk3/pango/_obj/pango.cgo1.go:3 +0x45
    main.init()
           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.

  • License

    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!

  • 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.

    -P.

  • error: 'g_type_init' is deprecated

    error: 'g_type_init' is deprecated

    Hi,

    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’
      g_clear_object(o);
      ^
    ./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

  • 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

  • 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.

Related tags
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

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

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

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

Nov 26, 2022
naive go bindings to GnuPlot
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.

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

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

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

Nov 10, 2022
Go bindings for libVLC and high-level media player interface
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

Dec 31, 2022
Go bindings for OpenCV1.1 (Dev/Zero Dependencies).
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

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

Dec 17, 2022
Vulkan API bindings for Go programming language
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

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

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

Jan 6, 2023
GTK3-based dock for sway
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

Dec 23, 2022
wsmgr-for-i3 is a Go GTK3 program to manage i3 workspaces.
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

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

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

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

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)

Dec 25, 2022