Previous Next Contents

1. Introduction

GTK (GIMP Toolkit) was originally developed as a toolkit for the GIMP (General Image Manipulation Program). GTK is built on top of GDK (GIMP Drawing Kit) which is basically wrapper around the Xlib functions. It's called the GIMP toolkit because it was original written for developing the GIMP, but has now been used in several free software projects. The authors are

GTK is essentially an object oriented application programmers interface (API). Although written completely in C, it is implemented using the idea of classes and callback functions (pointers to functions).

There is also a third component called glib which contains a few replacements for some standard calls, as well as some additional functions for handling linked lists etc. The replacement functions are used to increase GTK's portability, as some of the functions implemented here are not available or are nonstandard on other unicies such as g_strerror(). Some also contain enhancements to the libc versions such as g_malloc has enhanced debugging utilities.

This tutorial is an attempt to document as much as possible of GTK, it is by no means complete. This tutorial assumes a good understanding of C, and how to create C programs. It would be a great benefit for the reader to have previous X programming experience, but it shouldn't be necessary. If you are learning GTK as your first widget set, please comment on how you found this tutorial, and what you had troubles with. Note that there is also a C++ API for GTK (GTK--) in the works, so if you prefer to use C++, you should look into this instead. There's also an Objective C wrapper, and guile bindings available, but I don't follow these.

I would very much like to hear any problems you have learning GTK from this document, and would appreciate input as to how it may be improved.


Previous Next Contents