Git Product home page Git Product logo

gobbi's Introduction

This project is no longer actively developed. For a promising set of generated gtk bindings, take a look at https://github.com/diamondburned/gotk4.

gobbi

gobject bindings

Build Status builds.sr.ht status

gobbi is a set of generated Go bindings for gobject based libraries. There are bindings, with varying degrees of completeness, for gtk, gdk, gdkpixbuf, gio, gobject, and glib.

The intention is to provide the bindings required for writing gtk applications. So the focus is on supporting functions in the higher level libraries such as gtk, gdk, gdkpixbuf and gio. Much of the functionality provided by the lower level libraries, such as glib and gobject, is adequately supported in Go core packages.

example use

package main

import (
	"github.com/pekim/gobbi/lib/gtk"
	"os"
	"runtime"
)

func init() {
	runtime.LockOSThread()
}

func main() {
	gtk.Init(os.Args)

	window := gtk.WindowNew(gtk.GTK_WINDOW_TOPLEVEL)
	window.SetTitle("A window title")
	window.SetDefaultSize(300, 300)

	window.Widget().ConnectDestroy(func(_ *gtk.Widget) {
		gtk.MainQuit()
	})
	window.Widget().ShowAll()

	gtk.Main()
}
go get github.com/pekim/gobbi
go run -tags "glib_2.48 gdk_3.4 gdkpixbuf_2.32 gio_2.32 gtk_3.18" gobbi-simple.go

documentation

https://pekim.github.io/gobbi/

At a minimum it's probably a good idea to read at least the Getting started and Application lifecycle pages.

code generation

The code that implements most of the APIs is generated from the GObject Introspection (gir) XML files in the internal/gir-files directory. The generation code is in the internal/generate package.

All of the generated API code, and a very small number of manually maintained files, is in the subdirectories of the lib directory.

status

The library should be perfectly servicable and complete enough to build most applications.

Some simple example applications have been created, and may be found in the example directory. It is possible that for more complex applications some necessary apis may be missing.

The API is reasonably stable, although some changes are certainly possible.

The generation code is rather messy in some areas, and needs tidying up. The generated code is simple, and fairly readable.

gotk3

gotk3 is a more mature library than gobbi. It might be a safer choice than gobbi for those who are cautious. However gobbi should work just as well in most cases.

gobbi supports a larger number of apis than gotk3. However gotk3 supports some apis that gobbi does not, and vice versa.

gobbi is more type safe in some areas, notably the callbacks connected to signals.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.