gotk3

GTK3 的 Go 绑定。(Go bindings for GTK3)

  • 所有者: Conformal Systems, LLC. point_right 該所有者的項目 (0)
  • 平台: Linux, Mac, Windows
  • 許可證: ISC License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

gotk3

[Build Status]
(https://travis-ci.org/conformal/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 import path for the package. Partial binding support for the
following libraries is currently implemented:

  • GTK+3 (3.6 and later)
  • GDK 3 (3.6 and later)
  • GLib 2 (2.36 and later)
  • Cairo (1.10 and later)

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.

Sample Use

The following example can be found in gtk/examples/simple/simple.go.
Usage of additional features is also demonstrated in the
gtk/examples/ directory.

package main

import (
	"github.com/conformal/gotk3/gtk"
	"log"
)

func main() {
	// Initialize GTK without parsing any command line arguments.
	gtk.Init(nil)

	// Create a new toplevel window, set its title, and connect it to the
	// "destroy" signal to exit the GTK main loop when it is destroyed.
	win, err := gtk.WindowNew(gtk.WINDOW_TOPLEVEL)
	if err != nil {
		log.Fatal("Unable to create window:", err)
	}
	win.SetTitle("Simple Example")
	win.Connect("destroy", func() {
		gtk.MainQuit()
	})

	// Create a new label widget to show in the window.
	l, err := gtk.LabelNew("Hello, gotk3!")
	if err != nil {
		log.Fatal("Unable to create label:", err)
	}

	// Add the label to the window.
	win.Add(l)

	// Set the default window size.
	win.SetDefaultSize(800, 600)

	// Recursively show all widgets contained in this window.
	win.ShowAll()

	// Begin executing the GTK main loop.  This blocks until
	// gtk.MainQuit() is run. 
	gtk.Main()
}

Documentation

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/conformal/gotk3

Installation

gotk3 currently requires GTK 3.6-3.12, GLib 2.36-2.40, and
Cairo 1.10 or 1.12. A recent Go (1.2 or newer) is also required.

The gtk package requires the cairo, glib, and gdk packages as
dependencies, so only one go get is necessary for complete
installation.

The build process uses the tagging scheme gtk_MAJOR_MINOR to specify a
build targeting any particular GTK version (for example, gtk_3_10).
Building with no tags defaults to targeting the latest supported GTK
release (3.12).

To install gotk3 targeting the latest GTK version:

$ go get github.com/conformal/gotk3/gtk

On MacOS (using homebrew) you would likely specify PKG_CONFIG_PATH as such:

$ PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:`brew --prefix gtk+3`/lib/pkgconfig go get -u -v github.com/conformal/gotk3/gdk

To install gotk3 targeting the older GTK 3.10 release:

$ go get -tags gtk_3_10 github.com/conformal/gotk3/gtk

Ubuntu 14.04 uses the GTK 3.10 release. Also, some required packages may be
missing. You may need to install the first or all of these packages in Ubuntu
before gotk3:

$ sudo apt-get install libgtk-3-dev
$ sudo apt-get install libcairo2-dev
$ sudo apt-get install libglib2.0-dev

TODO

  • Add bindings for all of GTK+
  • Add tests for each implemented binding
  • Add examples for intent

GPG Verification Key

All official release tags are signed by Conformal so users can ensure the code
has not been tampered with and is coming from Conformal. To verify the
signature perform the following:

  • Download the public key from the Conformal website at
    https://opensource.conformal.com/GIT-GPG-KEY-conformal.txt

  • Import the public key into your GPG keyring:

    gpg --import GIT-GPG-KEY-conformal.txt
    
  • Verify the release tag with the following command where TAG_NAME is a
    placeholder for the specific tag:

    git tag -v TAG_NAME
    

License

Package gotk3 is licensed under the liberal ISC License.

主要指標

概覽
名稱與所有者conformal/gotk3
主編程語言Go
編程語言Go (語言數: 2)
平台Linux, Mac, Windows
許可證ISC License
所有者活动
創建於2013-06-28 04:57:17
推送於2016-11-27 02:46:07
最后一次提交2014-09-09 05:07:57
發布數5
最新版本名稱GOTK3_0_2_0 (發布於 2014-02-11 01:38:39)
第一版名稱GOTK3_0_0_1 (發布於 2013-07-17 01:58:35)
用户参与
星數465
關注者數38
派生數81
提交數156
已啟用問題?
問題數71
打開的問題數26
拉請求數2
打開的拉請求數18
關閉的拉請求數30
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?