GTK+ FAQ: Development of GTK+

Next Previous Contents

## 3. Development of GTK+

## 3.1 Whats this CVS thing that everyone keeps talking about, and how do I access it?

CVS is the Concurent Version System and is a very popular means of version control for software projects. It is designed to allow multiple authors to be able to simultanously operate on the same source tree. This source tree is centrally maintained, but each developer has a local mirror of this repository that they make there changes to.

The GTK+ developers use a CVS repository to store the master copy of the current development version of GTK+. As such, people wishing to contribute patches to GTK+ should generate them against the CVS version. Normal people should use the packaged releases.

The CVS toolset is available as RPM packages from the usual RedHat sites. The latest version is available at http://download.cyclic.com/pub/

Anyone can download the latest CVS version of GTK+ by using anonymous access using the following steps:

- In a bourne shell descendant (e.g. bash) type:

      CVSROOT=':pserver:anonymous@anoncvs.gnome.org:/cvs/gnome'
      export CVSROOT

- Next, the first time the source tree is checked out, a cvs login is needed.

      cvs login

  This will ask you for a password. There is no password for cvs.gimp.org, so just enter a carriage return.
- To get the tree and place it in a subdir of your current working directory, issue the command:

      cvs -z3 get gtk+

  Note that with the GTK+ 1.1 tree, glib has been moved to a separate CVS module, so if you don't have glib installed you will need to get that as well:

      cvs -z3 get glib

## 3.2 How can I contribute to GTK+?

It's simple. If something doesn't work like you think it should in a program, check the documentation to make sure you're not missing something. If it is a true bug or missing feature, track it down in the GTK+ source, change it, and then generate a patch in the form of a 'context diff'. This can be done using a command such as `diff -ru <oldfile> <newfile>`. Then upload the patchfile to:

    ftp://ftp.gtk.org/incoming

along with a README file. Make sure you follow the naming conventions or your patch will just be deleted! The filenames should be of this form:

    gtk-<username>-<date yymmdd-n>.patch.gz
    gtk-<username>-<date yymmdd-n>.patch.README

The "n" in the date indicates a unique number (starting from 0) of patches you uploaded that day. It should be 0, unless you upload more than one patch in the same day.

Example:

    gtk-gale-982701-0.patch.gz
    gtk-gale-982701-0.patch.README

Once you upload anything, send the README to ftp-admin@gtk.org

## 3.3 How do I know if my patch got applied, and if not, why not?

Uploaded patches will be moved to `ftp://ftp.gtk.org/pub/gtk/patches` where one of the GTK+ development team will pick them up. If applied, they will be moved to `/pub/gtk/patches/old`.

Patches that aren't applied, for whatever reason, are moved to `/pub/gtk/patches/unapplied` or `/pub/gtk/patches/outdated`. At this point you can ask on the `gtk-list` mailing list why your patch wasn't applied. There are many possible reasons why patches may not be applied, ranging from it doesn't apply cleanly, to it isn't right. Don't be put off if your patch didn't make it first time round.

## 3.4 What is the policy on incorporating new widgets into the library?

This is up to the authors, so you will have to ask them once you are done with your widget. As a general guideline, widgets that are generally useful, work, and are not a disgrace to the widget set will gladly be included.

## 3.5 Is anyone working on bindings for languages other than C?

The GTK+ home page ( http://www.gtk.org/) presents a list of GTK+ bindings.

- There are several C++ wrappers for GTK+.
  - the gtk-- package, which is a very small wrapper for GTK+. You can find the home page at: http://www.cs.tut.fi/~p150650/gtk/gtk--.html. The FTP site is ftp://ftp.gtk.org/pub/gtk/gtk--.
  - the VDK package, which was built as the base package of a GTK+ application Borland-like builder. The home page can be found at www.guest.net/homepages/mmotta/VDKHome.
  - The wxWindows/Gtk package, a free C++ library for cross-platform GUI development. The home page of this package is http://www.freiburg.linux.de/~wxxt/.

- There are three known Objective-c bindings currently in development:
  - The GNOME project's package of choice is objgtk. Objgtk is based on the Object class and is maintained by Elliot Lee. Apparently, objgtk is being accepted as the `standard' Objective-C binding for GTK+.
  - If you are more inclined towards the GNUstep project, you may want to check out GTKKit by Helge Heß. The intention is to setup a GTK+ binding using the FoundationKit. GTKKit includes nicities like writing a XML-type template file to construct a GTK+ interface.
  - The GToolKit package, which can be found at ftp://ftp.gtk.org/pub/gtk/objc-gtoolkit/.

- Perl bindings ftp://ftp.gtk.org/pub/gtk/perl

- Guile bindings. The home page is at http://www.ping.de/sites/zagadka/guile-gtk. By the way, Guile is the GNU Project's implemention of R4RS Scheme (the standard). If you like Scheme, you may want to take a look at this.

- David Monniaux reports:

  > I've started a gtk-O'Caml binding system. The basics of the system, including callbacks, work fine. The current development is in http://www.ens-lyon.fr/~dmonniau/arcs

- Several python bindings have been done:

  - pygtk is at http://www.daa.com.au/~james/pygtk and ftp://ftp.gtk.org/pub/gtk/python
  - python-gtk is at http://www.ucalgary.ca/~nascheme/python-gtk

- There's are a couple of OpenGL/Mesa widgets available for GTK+. I suggest you start at http://www.student.oulu.fi/~jlof/gtkglarea/index.html

- Last, there are a lot of other language bindings for languages such as Eiffel, TOM, Pascal, Pike, etc.

Next Previous Contents