From Seo Wiki - Search Engine Optimization and Programming Languages

Jump to: navigation, search
File:New Gtk+.svg
Developer(s) GNOME Foundation
Stable release 2.18.6 / January 12, 2010; 129228073 ago
Preview release 2.19.4 / January 26, 2010; 128018473 ago
Written in C
Operating system Cross-platform
Platform Cross-platform
Size 18M
Available in Multilingual
Development status Active
Type Widget toolkit
License GNU Lesser General Public License

GTK+ (GIMP Toolkit) is a cross-platform widget toolkit for creating graphical user interfaces. It is one of the most popular toolkits for the X Window System, along with Qt.

GTK+ was initially created for the GNU Image Manipulation Program (GIMP), a raster graphics editor, in 1997 by Spencer Kimball and Peter Mattis, members of eXperimental Computing Facility (XCF) at University of California, Berkeley.

GTK+ is licensed under the LGPL free software license and is part of the GNU Project, which aims to create a whole free-software operating system.



GTK+ is an object oriented widget toolkit written in the C programming language; object orientation is achieved by using the Glib object system (GObject). On the X11 display server GTK+ uses xlib to draw widgets, an alternative choice that could have been made is to use Xt; using xlib provides flexibility and allows GTK+ to be used on platforms where the X Window System is unavailable. While GTK+ is primarily targeted at the X Window System, other platforms are supported, including Microsoft Windows, DirectFB, and Quartz on Mac OS X.

GTK+ can be configured to change the look of the widgets drawn, this is done using different display engines. Several display engines exist which try to emulate the look of the native widgets on the platform in use.

Programming language bindings

A library written in one programming language may be used in another programming language if bindings are written: GTK+ has bindings in many languages[1].

See the table below:

Language Name Officially supported
C GTK+ Native (no binding necessary)
C++ gtkmm Yes
Ruby ruby-gtk2 Yes
Python PyGTK Yes
Java java-gnome Yes (not available for Microsoft Windows)
.NET programming languages Gtk# Yes
Perl Gtk2-Perl Yes
Ada GtkAda No
D gtkD No
Common Lisp CL-GTK2 No
Haskell gtk2hs No
Lua No
Ocaml LablGTK No
Pascal No
Pike No
JavaScript seed No
Smalltalk Smalltalk YX No
Tcl Gnocl No
Euphoria No
Vala and GOB languages written for the GObject system.


GTK+ was originally designed and used in the GNU Image Manipulation Program (GIMP) as a replacement of the Motif toolkit; at some point Peter Mattis became disenchanted with Motif and began to write his own GUI toolkit called the GIMP toolkit and had successfully replaced Motif by the 0.60 release of GIMP.[2] Finally GTK was re-written to be object oriented and was renamed GTK+, this was first used in the 0.99 release of GIMP.

GTK+ 2 has succeeded GTK+ 1. Its new features include improved text rendering using Pango, a new theme engine, improved accessibility using the Accessibility Toolkit, complete transition to Unicode using UTF-8 strings and a more flexible API. However, GTK+ 2 lacks compatibility with GTK+ 1, and programmers must port applications to it.

Starting with version 2.8, GTK+ 2 depends on the Cairo library for rendering with vector graphics in GTK+ 2.

Release series Initial release date Major enhancements Latest minor version
1.0 14 April 1998 First stable version 1.0.6
1.2 27 February 1999 New widgets (GtkFontSelector, GtkPacker, GtkItemFactory, GtkCTree,
GtkInvisible, GtkCalendar, GtkLayout, GtkPlug, GtkSocket)
2.0 11 March 2002 GObject, Universal Unicode UTF-8 2.0.9
2.2 22 December 2002 Multihead support 2.2.4
2.4 16 March 2004 New widgets (GtkFileChooser, GtkComboBox, GtkComboBoxEntry,
GtkExpander, GtkFontButton, GtkColorButton)
2.6 16 December 2004 New widgets (GtkIconView, GtkAboutDialog, GtkCellView).
The last to support Windows 98/ME.
2.8 13 August 2005 Cairo integration 2.8.20
2.10 3 July 2006 New widgets (GtkStatusIcon, GtkAssistant, GtkLinkButton,
GtkRecentChooser) and print support (GtkPrintOperation)
2.12 14 September 2007 GtkBuilder 2.12.12
2.14 4 September 2008 Jpeg2000 load support 2.14.7
2.16 13 March 2009 New GtkOrientable, Caps Lock warning in password Entry.
Improvement on GtkScale, GtkStatusIcon, GtkFileChooser.
2.18 23 September 2009 New GtkInfoBar. Improvement on file chooser, printing.
GDK has been rewritten to use 'client-side windows'

Future developments

Project Ridley is an attempt to consolidate several libraries that are currently external to GTK+, including libgnome, libgnomeui, libgnomeprint22, libgnomeprintui22, libglade, libgnomecanvas, libegg, libeel, gtkglext and libsexy.[3]

Developers are also considering new directions for the library, including breaking ABI, removing deprecated API components, and adding an integrated scene graph system, similar to the Clutter graphics library, effectively integrating GTK+ with OpenGL.[4][5]

Development and design of the GTK+ 3 release of the toolkit started in February 2009 during the GTK+ Theming Hackfest held in Dublin [6]. A first draft of the development roadmap has been released on April 9th, 2009 [7].

GTK+ hello world

GTK+ hello world in the C programming language. This program has a window with the title "Hello World" and a label with similar text.

 #include <gtk/gtk.h>
 int main (int argc, char *argv[])
    GtkWidget *window;
    GtkWidget *label;
    gtk_init (&argc, &argv);
    /* create the main, top level, window */
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    /* give it the title */
    gtk_window_set_title (GTK_WINDOW (window), "Hello World");
    /* Connect the destroy signal of the window to gtk_main_quit
     * When the window is about to be destroyed we get a notification and
     * stop the main GTK+ loop
    g_signal_connect (window, "destroy",
                      G_CALLBACK (gtk_main_quit), NULL);
    /* Create the "Hello, World" label  */
    label = gtk_label_new ("Hello, World");
    /* and insert it into the main window  */
    gtk_container_add (GTK_CONTAINER (window), label);
    /* make sure that everything, window and label, are visible */
    gtk_widget_show_all (window);
    /* start the main loop, and let it rest there until the application is closed */
    gtk_main ();
    return 0;


Screenshot of GIMP 2.4. GTK+ is responsible for managing the interface components of the program, including the menus, buttons, input fields, etc.
Environments that use GTK+
  • GNOME is based on GTK+, meaning that GNOME programs use GTK+
  • Xfce is based on GTK+, though its applications typically do not depend on as many libraries (this is the difference between something being branded as a "GNOME program" or as a "GTK+ program")
  • LXDE is based on GTK+, stands for "Lightweight X11 Desktop Environment"
  • ROX Desktop a lightweight desktop, with features from the GUI of RISC OS
  • GPE Palmtop Environment
  • Maemo (Nokia's Internet-tablet framework which up to version 5 are based on GTK+ while the next versions will be based on Qt)
  • Access Linux Platform (successor of the Palm OS PDA platform)
  • Sugar the learning platform uses GTK+ and PyGTK
  • Moblin OS and application stack for Mobile Internet Devices (MIDs), netbooks, and nettops

Those desktop environments are not required to run GTK+ programs. If the libraries the program requires are installed, a GTK+ program can run on top of other X11-based environments such as KDE or an X11-plus-window manager environment; this includes Mac OS X if is installed (which is the default since the Leopard release). GTK+ can also run under Microsoft Windows, where it is used by some popular cross-platform applications like Pidgin and GIMP. wxWidgets, a cross-platform GUI toolkit, uses GTK+ for Unix systems.[8] Other ports include DirectFB (used by the Debian installer, for example) and ncurses[9].

Window managers

The following window managers use GTK+


Some notable applications that use GTK+ as a widget toolkit include:

  • AbiWord - Word processor
  • CinePaint (ex FilmGimp, being ported to FLTK) - 16-bit raster graphics editor
  • Ekiga (ex GnomeMeeting) - VoIP and video conferencing application
  • Evolution - personal information manager
  • GIMP - Raster graphics editor
  • Gnumeric - Spreadsheet software
  • Chromium - Web browser based upon WebKit and developed in large part by Google
  • GRAMPS - Genealogy software
  • Inkscape - SVG Vector graphics editor
  • K-3D - free 3d modeling and animation program
  • Marionnet - An interactive network simulator
  • Midori - lightweight web browser
  • Nero Linux - An optical disc media authoring program
  • Pidgin - Instant messaging
  • VMware Player - virtualization software
  • Wireshark - packet analyzer

See also



External links

Personal tools

Served in 0.827 secs.