Pure GTK+ Bindings

Version 0.8, December 04, 2010

Albert Graef <Dr.Graef@t-online.de>

pure-gtk is a collection of bindings to use the GTK+ GUI toolkit version 2.x with Pure, see http://www.gtk.org. The bindings include the gtk (+gdk), glib, atk, cairo and pango libraries, each in their own Pure module.

At present these are just straight 1-1 wrappers of the C libraries, created with pure-gen. So they still lack some convenience, but they are perfectly usable already, and a higher-level API for accessing all the functionality will hopefully become available in time. In fact you can help make that happen. :) So please let me know if you’d like to give a helping hand in improving pure-gtk.

Copying

Copyright (c) 2008, 2009 by Albert Graef.

pure-gtk is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

pure-gtk is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Installation

Get the latest source from http://pure-lang.googlecode.com/files/pure-gtk-0.8.tar.gz.

To install, do the usual make && sudo make install (see the Makefile for further options). This needs Pure and the GTK header files and libraries.

This release was prepared with GTK+ 2.14.4 on SUSE 11.1. If you’re seeing a lot of warnings or even compilation errors when running make, your GTK headers are probably much different from these. In that case you should run make generate to regenerate the bindings; for this you also need to have pure-gen installed. (If you already have pure-gen then it’s a good idea to do this anyway.)

Usage

See examples/hello.pure for a basic example. The files uiexample.pure and uiexample.glade show how to run a GUI created with the Glade-3 interface builder. This needs a recent version of the GtkBuilder API to work. (If you’re still running Glade-2 and an older GTK+ version, you might want to use the older libglade interface instead. Support for that is in the Makefile, but it’s not enabled by default.) NOTE: The examples start up much faster when they are compiled to native executables. To do this, just run make examples after make. (Be patient, this takes a while.)

pure-gtk can be discussed on the Pure mailing list at: http://groups.google.com/group/pure-lang

Table Of Contents

Previous topic

Pure OpenGL Bindings

Next topic

pure-tk

This Page