Developer(s) | GNOME Foundation |
---|---|
Stable release | 2.20.1 / May 2, 2010 |
Preview release | 2.90.6 / August 18, 2010 |
Development status | Active |
Written in | C |
Operating system | Cross-platform |
Platform | Cross-platform |
Size | 18 MB |
Available in | Multilingual |
Type | Widget toolkit |
License | GNU Lesser General Public License |
Website | www.gtk.org |
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.
Contents |
GTK+ is an object-oriented widget toolkit written in the C programming language; object-orientation is achieved by using the GLib object system. On the X11 display server, GTK+ uses Xlib to draw widgets. 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.
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 | Support |
---|---|---|
Ada | GtkAda | Partial support up to 2.14 |
C | GTK+ | Native (no binding necessary) |
C++ | gtkmm | Yes |
C# .NET languages | Gtk# | Yes |
Common Lisp | CL-GTK2 | No |
D | gtkD | Partial support up to 2.18 (plus Cairo, Gda, Gl, Gstremer) |
Erlang | gtkNode | Partial support up to 2.16 |
Euphoria | Euphoria / GTK | No |
GOB | languages written for the GObject system. | Yes |
Haskell | gtk2hs | Partial support up to 2.18 |
Java | java-gnome | Yes (not available for Microsoft Windows) |
JavaScript | seed/GJS | Yes |
Lua | LuaGnome | Partial support up to 2.16 |
Ocaml | LablGTK | Partial support up to 2.16 |
Pascal | GTK2 for Pascal | No |
Perl | Gtk2-Perl | Yes |
PHP | PHP-GTK | Yes |
Pike | Pike GTK | No |
Python | PyGTK | Yes |
Ruby | ruby-gtk2 | Yes |
Smalltalk | Smalltalk GTK | GNU Smalltalk, Smalltalk YX, Squeak |
Tcl | Gnocl | No |
Vala | Vala | Yes |
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+. 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 graphics library for rendering 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) |
1.2.10 |
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.4.14 |
2.6 | 16 December 2004 | New widgets (GtkIconView, GtkAboutDialog, GtkCellView). The last to support Windows 98/ME. |
2.6.10 |
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.10.14 |
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.16.6 |
2.18 | 23 September 2009 | New GtkInfoBar. Improvement on file chooser, printing. GDK has been rewritten to use 'client-side windows' |
2.18.9 |
2.20 | 23 March 2010 | New GtkSpinner and GtkToolPalette, GtkOffscreenWindow. Improvement on file chooser, keyboard handling, GDK.Introspection data is now included in GTK+ |
2.20.1 |
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 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 9, 2009.[7]
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; }
Those desktop environments are not required to run GTK+ programs. If the required libraries are installed, a GTK+ program can run on top of other X11-based desktop environments or window managers; this includes Mac OS X if X11.app 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]
The following window managers use GTK+
Some notable applications that use GTK+ as a widget toolkit include:
|
|