| GTK+GTK+ (GIMP Toolkit) is a cross-platform widget toolkit for creating graphical user interfaces. It is licensed under the terms of the GNU LGPL, allowing both free and proprietary software to use it. It is one of the most popular toolkits for the X Window System, along with Qt.[1] The name GTK+ originates from GTK; the plus was added to distinguish an enhanced version.[2] It was originally created for the GNU Image Manipulation Program (GIMP), a free software raster graphics editor, in 1997 by Spencer Kimball and Peter Mattis, members of eXperimental Computing Facility (XCF) at the University of California, Berkeley. It is now maintained by members of the GNOME Foundation. DesignGTK+ is an object-oriented widget toolkit written in the C programming language; it uses the GLib object system for the object orientation. 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, it works on other platforms, including Microsoft Windows (interfaced with the Windows API), and Mac OS X (interfaced with Quartz). HTML5 and Wayland backends are in development. 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 bindingsA library written in one programming language may be used in another language if bindings are written; GTK+ has bindings in many languages.[3] See the table below: GUI designersThere are several GUI designers for GTK+. The following projects are active as of July 2011: - Glade, supports GtkBuilder, which is a GTK+ built-in GUI description format.
- Gazpacho, GUI builder for the GTK+ toolkit written in Python
- Crow Designer, relies on its own GuiXml format and GuiLoader library.
- Stetic, part of MonoDevelop, oriented towards Gtk#.
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.[5] Finally GTK was re-written to be object-oriented and was renamed GTK+. This was first used in the 0.99 release of GIMP. The GTK+ 2.0.0 release series introduced new features which 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. Starting with version 2.8, GTK+ 2 depends on the Cairo graphics library for rendering vector graphics in GTK+ 2. GTK+ version 3.0.0 included revised input device handling, support for themes written with CSS-like syntax, and the ability to receive information about other opened GTK+ applications. 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 |
---|
2.22 | 23 September 2010 | gdk-pixbuf moved to separate module, most GDK drawing are based on Cairo, many internal data are now private and can be sealed in preparation to GTK+3 | 2.22.1 |
---|
2.24 | 30 January 2011 | New simple combo box widget (GtkComboBoxText) added, the cups print backend can send print jobs as PDF, GtkBuilder has gained support for text tags and menu toolbuttons and many introspection annotation fixes were added | 2.24.17 |
---|
3.0 | 10 February 2011 | Cairo, more X11 agnostic, XInput2, CSS-based theme API | 3.0.12 |
---|
3.2 | 25 September 2011 | New experimental Wayland and HTML5 backends, New Font Chooser dialog, New widgets: GtkLockButton and GtkOverlay | 3.2.4 |
---|
3.4 | 26 March 2012 | Menu support in GtkApplication, A new color chooser, Add support for touch devices, Add support for smooth scrolling, GtkScrolledWindow will do kinetic scrolling with touch devices, OS X support has been improved, This is the first version of GTK+ 3 that works well on Windows, The Wayland backend has been updated to the current Wayland API, and the backend is much more complete now, Spin buttons have received a new look, Accessibility: the treeview accessible support has been rewritten and works much better now, More complete CSS Theming support. | 3.4.4 |
---|
3.6 | 24 September 2012 | GtkSearchEntry, GtkMenuButton, GtkLevelBar. Vertical spin buttons. CSS animations, blur shadows. Support for cross-fading and transitions in themes. | 3.6.3 |
---|
3.8 | 25 March 2013 | Wayland 1.0 stable support, support for the broadwayd server, improved themeing, better geometry management, touch improvements, support with the window manager for the frame synchronization protocol | 3.8.0 |
---|
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.[6] 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.[7][8] Development and design of the GTK+ 3 release of the toolkit started in February 2009 during the GTK+ Theming Hackfest held in Dublin.[9] The first draft of the development roadmap was released on 9 April 2009.[10] GTK+ hello worldThe following code presents a graphical GTK+ hello-world program 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!"); /* ** Map 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 by returning 0 */ g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL); /* ** Assign the variable "label" to a new GTK label, ** with the text "Hello, world!" */ label = gtk_label_new("Hello, world!"); /* Plot the label onto 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 do nothing (block) until ** the application is closed */ gtk_main(); return 0;} Using GCC and pkg-config in a Unix shell, this code can be compiled with the following command (assume above source has file name "helloworld.c"): $ gcc -Wall helloworld.c -o helloworld $(pkg-config --cflags --libs gtk+-3.0)
Example using Vala instead of CThe following is a "Hello World" program in Vala: using Gtk; int main (string[] args) { Gtk.init (ref args); /* Create the main, top level window */ var window = new Window(); /* Give it the title, border, position, and size */ window.title = "Hello, World!"; window.border_width = 10; window.window_position = WindowPosition.CENTER; window.set_default_size(350, 70); /* ** Map 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 by returning 0 */ window.destroy.connect(Gtk.main_quit); /* ** Assign the variable "label" to a new GTK label, ** with the text "Hello, world!" */ var label = new Label("Hello, World!"); /* Add the label onto the main window */ window.add(label); /* Make sure that everything, window and label, are visible */ window.show_all(); /* ** Start the main loop, and do nothing (block) until ** the application is closed */ Gtk.main(); return 0;} which would be compiled with: $ valac --pkg gtk+-3.0 HelloWorldGtk.vala UsesScreenshot of GIMP 2.4. GTK+ is responsible for managing the interface components of the program, including the menus, buttons, and input fields. - Environments that use GTK+
- GNOME is based on GTK+, meaning that programs native to GNOME use GTK+
- Consort, the GNOME 3.4 Fallback Mode - Fork, from SolusOS
- MATE (desktop environment), a fork of GNOME 2 Desktop Environment
- Xfce is based on GTK+
- LXDE (Lightweight X11 Desktop Environment) is based on GTK+
- ROX Desktop is a lightweight desktop, with features from the GUI of RISC OS
- GPE Palmtop Environment
- Access Linux Platform (successor of the Palm OS PDA platform)
- Sugar is a desktop environment oriented towards children's education, which uses GTK+ and PyGTK
- KDE, though based on Qt, has integration with GTK+-based programs and themes (since version 4.2).
GTK+ programs do not require a desktop environment made with GTK+. 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 Linux operating systems.[11] Other ports include DirectFB (used by the Debian installer, for example) and ncurses.[12] - Window managers
The following window managers use GTK+ ApplicationsSome notable applications that use GTK+ as a widget toolkit include: See also References Bibliography- Krause, Andrew (April 23, 2007), Foundations of GTK+ Development (1st ed.), Apress, ISBN 978-1-59059-793-4, http://www.apress.com/9781590597934
- Wright, Peter (May 15, 2000), Beginning GTK+ and GNOME (1st ed.), Peer Information, ISBN 978-1-86100-381-2
- Logan, Syd (September 6, 2001), Gtk+ Programming in C (1st ed.), Prentice Hall, ISBN 978-0-13-014264-1, http://www.informit.com/store/product .aspx?isbn=0130142646
External links |
---|
| History | | |
---|
| Licenses | |
---|
| Software | |
---|
| Public speakers | |
---|
| Other topics | |
---|
|
|
---|
| Community | | |
---|
| People | |
---|
| Components | |
---|
| Technologies | |
---|
| Other topics | |
---|
|
|
| |