| advertise add site services publishers database health videos | ![]() | about toolbar stats live show health store more stuff JOIN/LOGIN |
"GTK" redirects here. For other uses, see GTK (disambiguation). For technical reasons, GTK# redirects here. For the article on GTK# see Gtk Sharp.
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.
[edit] DesignGTK+ 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. [edit] Programming language bindingsA 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:
[edit] HistoryGTK+ 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.
[edit] Future developmentsProject 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]. [edit] GTK+ hello worldGTK+ 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; } [edit] Uses Screenshot of GIMP 2.4. GTK+ is responsible for managing the interface components of the program, including the menus, buttons, input fields, etc.
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 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].
[edit] ApplicationsSome notable applications that use GTK+ as a widget toolkit include:
[edit] See also[edit] References
[edit] Bibliography
[edit] External links
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ↑ top of page ↑ | about thumbshots |