GTK (formerly GTK+) is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and proprietary software to use it. It is one of the most popular toolkits for the Wayland and X11 windowing systems.
|Original author(s)||Spencer Kimball, Peter Mattis|
|Developer(s)||The GNOME Project, eXperimental Computing Facility (XCF)|
|Initial release||April 14, 1998|
4.10.1 / March 14, 2023
4.11.1 / April 3, 2023
|Written in||C, CSS|
|Operating system||Linux, Unix-like, macOS, Windows|
The GTK team releases new versions on a regular basis. GTK 4 and GTK 3 are maintained, while GTK 2 is end-of-life. GTK1 is independently maintained by the CinePaint project.
The GTK library contains a set of graphical control elements (widgets); version 3.22.16 contains 186 active and 36 deprecated widgets. GTK is an object-oriented widget toolkit written in the programming language C; it uses GObject, that is the GLib object system, for the object orientation. While GTK is mainly for windowing systems based on X11 and Wayland, it works on other platforms, including Microsoft Windows (interfaced with the Windows API), and macOS (interfaced with Quartz). There is also an HTML5 back-end named Broadway.
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.
Starting with version 2.8, released in 2005, GTK began the transition to using Cairo to render most of its graphical control elements widgets. Since GTK version 3.0, all rendering is done using Cairo.
On 26 January 2018 at DevConf.cz, Matthias Clasen gave an overview of the current state of GTK 4 development, including a high-level explanation of how rendering and input worked in GTK 3, what changes are being made in GTK 4 (>3.90), and why. On 6 February 2019 it was announced that GTK 4 will drop the “+” from the project's name.
GDK acts as a wrapper around the low-level functions provided by the underlying windowing and graphics systems.
GSK is the rendering and scene graph API for GTK. GSK lies between the graphical control elements (widgets) and the rendering. GSK was finally merged into GTK version 3.90 released March 2017.
GtkInspector was introduced with version 3.14. GtkInspector can only be invoked after installing the development package libgtk-3-dev/gtk+-devel.
There are several GUI designers for GTK. The following projects were active as of July 2011:
GtkBuilder allows user interfaces to be designed without writing code. The interface is described in an Extensible Markup Language (XML) file, which is then loaded at runtime and the objects created automatically. The Glade Interface Designer allows creation of the user interface in a what you see is what you get (WYSIWYG) manner. The description of the user interface is independent from the programming language being used.
GtkSharp, not to be confused with Gtk#, supports GTK 3.
|Initial release||March 12, 2004|
2.12.41 / September 22, 2016
2.99.3 (for GTK3) / June 6, 2014
|Written in||C#, XML, Perl, C|
|Operating system||Windows, macOS, Linux|
|License||GNU Lesser General Public License|
Gtk# is a set of .NET Framework bindings for the GTK graphical user interface (GUI) toolkit and assorted GNOME libraries. The library facilitates building graphical GNOME applications using Mono or any other compliant Common Language Runtime (CLR). Gtk# is an event-driven system like any other modern windowing library where every widget allows associating handler methods, which get called when certain events occur.
Applications built using Gtk# will run on many platforms including Linux, Windows and macOS. The Mono packages for Windows include GTK, Gtk# and a native theme to make applications look like native Windows applications. Starting with Mono 1.9, running Gtk# applications on macOS no longer requires running an X11 server.
Glade Interface Designer can be used with the Glade# bindings to easily design GUI applications. A GUI designer named Stetic is integrated with the MonoDevelop integrated development environment (IDE).
In addition to support the standard GTK/GNOME stack of development tools, the gtk-dotnet.dll assembly provides a bridge to consume functionality available on the .NET stack. At this point this includes the functionality to use System.Drawing to draw on a widget.
As of September 2020[update], Gtk# support for Gtk3 remains in the preview phase and forked projects, such as GtkSharp, have been founded to provide full Gtk3 support for C# and other CLI languages. The lack of a released version of Gtk# with support for Gtk3 was cited as a reason to remove the Banshee media player in Ubuntu 12.04.
GTK is mainly developed by The GNOME Project, which also develops the GNOME Development Platform and the GNOME Desktop Environment.
GTK development is loosely managed. Discussion chiefly occurs on several public mailing lists. GNOME developers and users gather at an annual GNOME Users And Developers European Conference GUADEC meeting to discuss GNOME's current state and future direction. GNOME incorporates standards and programs from freedesktop.org to better interoperate with other desktops.
GTK is mainly written in C. Many language bindings are available.
On 1 September 2016 a post on the GTK development blog denoted, among other things, the future numbering scheme of GTK. GTK version 3.22, released in Autumn 2016, was planned to be the last 3.x release, although version 3.24 followed in Fall 2018 with the delay of GTK 4. The development of GTK 4 used version names 3.90, 3.92, etc. until the first GTK 4.0 stable release was launched in December 2020. Despite the first stable GTK 4 release, some applications using GTK still rely on GTK 2. For example, as of January 2022, GIMP is still being ported to GTK 3.
GTK (and GNOME, GLib, etc.) formerly utilized the GNU Build System (named Autotools) as the build automation system of choice.
Since 14 Aug 2017, the master branch of GTK has been built with Meson, and the Autotools build system files have been dropped.
The most common criticism of GTK is the lack of backward-compatibility in major updates, most notably in the application programming interface (API) and theming.
The compatibility breaks between minor releases during the GTK 3.x development cycle was explained by Benjamin Otte as due to strong pressures to innovate, such as providing the features modern users expect and supporting the increasingly influential Wayland display server protocol. With the release of GTK 4, the pressure from the need to innovate will have been released and the balance between stability and innovation will tip toward stability. Similarly, recent changes to theming are specifically intended to improve and stabilise that part of the API, meaning some investment now should be rewarded later.
Some notable applications that use GTK as a widget toolkit include:
Several desktop environments utilize GTK as the widget toolkit.
GTK programs can be run on desktop environments based on X11 and Wayland, or window managers even those not made with GTK, provided the needed libraries are installed; this includes macOS if X11.app is installed. GTK can be also run on Microsoft Windows, where it is used by some popular cross-platform applications like Pidgin and GIMP. wxWidgets, a cross-platform GUI tool-kit, uses GTK on Linux by default. Other ports include DirectFB (used by the Debian installer, for example) and ncurses.
The following window managers use GTK:
For syntax highlighting there is GtkSourceView, "source code editing widget". GtkSourceView is maintained by GNOME separately from GTK as a library: gtksourceview. There are plans to rename to gsv.
GtkSpell is a library separate from GTK. GtkSpell depends on GTK and Enchant. Enchant is a wrapper for ispell, hunspell, etc., the actual spell checker engine/software. GtkSpell uses GTK's GtkTextView widget, to highlight misspelled words and offer replacement.
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 named the GIMP toolkit and had successfully replaced Motif by the 0.60 release of GIMP. 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 was subsequently adopted for maintenance by the GNOME Foundation, which uses it in the GNOME desktop environment.
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, 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.
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.
The '+' was dropped returning to simply 'GTK' in February 2019 during a Hackathon.
With Quartz-backend GTK is available in macOS.
HP stated that their goal was to merge the needed OpenVMS changes into the GTK Version 1.3 development stream, however this never materialised. The latest version of GTK for OpenVMS is version 1.2.10.
One of the cardinal novelties implemented during the GTK 4 development cycle (i.e. GTK 3.92, etc.) has been the removal of customization option for the user side (like individual keyboard shortcuts that could be set in GTK+ 2), the delegation of functionality to ancillary objects instead of encoding it into the base classes provided by GTK.
In 2018-Jan-26 at DevConf.cz Matthias Clasen gave an overview of the then current state of GTK 4 development, including a high-level explanation of how rendering and input worked in GTK 3, what changes were being made to GTK 4, and the reasons for those changes. Examples of things that have become possible with GTK 4 were given as well.
Older version, still maintained
Latest preview version
|Release series||Initial release||Major enhancements||Latest minor version|
|Old version, no longer maintained: 1.0||1998-04-13||First stable version||1.0.6|
|Old version, no longer maintained: 1.2||1999-02-25||New widgets:
|Old version, no longer maintained: 2.0||2002-03-11||GObject
Overall support for UTF-8
|Old version, no longer maintained: 2.2||2002-12-22||Multihead support||2.2.4|
|Old version, no longer maintained: 2.4||2004-03-16||New widgets:
|Old version, no longer maintained: 2.6||2004-12-16||New widgets:
The last to support Windows 98/Me
|Old version, no longer maintained: 2.8||2005-08-13||Most widgets are rendered by Cairo||2.8.20|
|Old version, no longer maintained: 2.10||2006-07-03||New widgets:
Print support: GtkPrintOperation
|Old version, no longer maintained: 2.12||2007-09-14||GtkBuilder||2.12.12|
|Old version, no longer maintained: 2.14||2008-09-04||JPEG 2000 load support||2.14.7|
|Old version, no longer maintained: 2.16||2009-03-13||New widget: GtkOrientable
Caps Lock warning in password entry
Improvements on GtkScale, GtkStatusIcon, GtkFileChooser
|Old version, no longer maintained: 2.18||2009-09-23||New widget: GtkInfoBar
Improvement on file chooser, printing
To remove much of the necessary IPC between the X11 application and the X11 server, GDK is rewritten (mainly by Alexander Larsson) to use "client-side windows", i.e., the GdkWindow, which every widget must have, belongs now to the client
|Old version, no longer maintained: 2.20||2010-03-23||New widgets:
Improvement on file chooser, keyboard handling, GDK
Introspection data is now included in GTK
|Old version, no longer maintained: 2.22||2010-09-23||GdkPixbuf 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
|Old version, no longer maintained: 2.24||2011-01-30||New widget: GtkComboBoxText which had previously been a custom widget shipped with Gtkmm
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
Migrating from GTK+ 2.x to GTK+ 3
|Old version, no longer maintained: 3.0||2011-02-10||Development and design of the GTK 3 release of the toolkit started in February 2009 during the GTK Theming Hackfest held in Dublin
Completed mostly Project Ridley
All the rendering is done using Cairo
GDK became more X11 agnostic
XInput2, theme API is based on Cascading Style Sheets (CSS), worsening the achievable performance for 60 Hz frame rates
|Old version, no longer maintained: 3.2||2011-09-25||New widgets:
New Font Chooser dialog
New experimental backends:
|Old version, no longer maintained: 3.4||2012-03-26||Menu support in GtkApplication
A new color chooser
Added support for touch devices
Added support for smooth scrolling
GtkScrolledWindow will do kinetic scrolling with touch devices
macOS support is improved
This is the first version of GTK 3 that works well on Windows
The Wayland backend is updated to the current Wayland version
Spin buttons have received a new look
Accessibility: the treeview accessible support is rewritten
More complete CSS theming support
|Old version, no longer maintained: 3.6||2012-09-24||New widgets:
Vertical spin buttons
CSS animations, blur shadows
Support for cross-fading and transitions in themes
|Old version, no longer maintained: 3.8||2013-03-25||Wayland 1.0 stable support
Support for the broadwayd server
Better geometry management
Support with the window manager for the frame synchronization protocol
|Old version, no longer maintained: 3.10||2013-09-23||New widgets:
Support for Wayland 1.2
Tear-off menu-items, plus many GTK settings
The modern GTK drawing model
|Old version, no longer maintained: 3.12||2014-03-25||Client-side decorations
Support for Wayland 1.5
New widget: GtkPopover (an alternative to menus and dialogs)
|Old version, no longer maintained: 3.14||2014-09-22||GtkInspector (a copy of gtkparasite) introduced
Improved support for gestures/multi-touch merged
Most widgets converted to use gestures internally
Wayland supports GNOME Shell classic mode
|Old version, no longer maintained: 3.16||2015-03-22||GDK supports rendering windows using OpenGL for X11 and Wayland using libepoxy
Scrolling overhauled (scrollbar hidden by default)
|Old version, no longer maintained: 3.18||2015-09-23||Add CSS node infrastructure
More filechooser design refresh and better filechooser search
Dropped Windows XP support
Model support for list and flow box
Kinetic touchpad scrolling
Touchpad gestures (Wayland)
|Old version, no longer maintained: 3.20||2016-03-21||Further Integration of CSS nodes
Move drag and drop down to GDK
New widget: GtkShortcutsWindow (shows keyboard shortcuts and gestures of an application)
|Old version, no longer maintained: 3.22||2016-09-21||Last 3.x release
Wayland tablet support is merged, support for graphics tablets is considered feature complete
GTK 3.22 shall be as rock-stable (and hence "boring") as GTK 2
|for 3+ years|
|Older version, yet still maintained: 3.24||2018-09-03||3.22 was supposed to be the last version of GTK 3 series
Dependency bumps – require:
New font chooser features:
New Emoji features:
Other new APIs: gdk_window_move_to_rect
Wayland: use anonymous shared memory on FreeBSD
Backported event controllers from GTK 4:
Deprecate a few APIs that are gone in GTK 4:
|Old version, no longer maintained: 3.90||2017-03-31||GTK Scene Graph Kit (GSK) merged
Remove any API marked as deprecated
|Old version, no longer maintained: 3.92||2017-10-18||As GNOME 3.26 was released already on September 13, 2017, it was not based on GTK 3.92.
GNU autotools was replaced with Meson.
|Old version, no longer maintained: 3.94||2018-06-26||3.93
GdkWindow renamed to GdkSurface
New abstraction for drawable content: GdkPaintable
There is support for displaying media with:
|Old version, no longer maintained: 3.96||2019-05-07||The gtk4-builder-tool simplify command has gained a --3to4 option to convert GTK3 ui files to GTK4; though with AMTK menus, toolbars or other objects like GtkShortcutsWindow are created programmatically (not with a *.ui file), but with convenient APIs.
GtkWidget can now use a GtkLayoutManager for size allocation
Focus handling has been rewritten, and focus-change event generation has been unified with crossing events
Events have been simplified and are just used for input:
|Old version, no longer maintained: 3.98||2020-02-10||
|Old version, no longer maintained: 3.99.0||2020-07-31||
|Old version, no longer maintained: 4.0||2020-12-16||4.0.2|
|Old version, no longer maintained: 4.2||2021-03-30|
|Old version, no longer maintained: 4.4||2021-08-23|
|Old version, no longer maintained: 4.6||2021-12-30|
|Old version, no longer maintained: 4.8||2022-09-06|
|Current stable version: 4.10||2023-03-04|
All drawing in GTK 3 is done via Cairo.