GTK
{{Short description|Free and open-source cross-platform widget toolkit for creating graphical user interfaces}}
{{Other uses}}
{{Use mdy dates|date=March 2023}}
{{Use American English|date=March 2023}}
{{Infobox software
| name = GTK
| title =
| logo = GTK logo.svg
| screenshot = Gtk4-widget-factory demos.png
| caption = GTK version 4 ([https://web.archive.org/web/20210710003750/https://developer.gnome.org/gtk4/stable/gtk4-widget-factory.html gtk4-widget-factory], a collection of examples that demonstrate many of the GUI widgets)
| author = Spencer Kimball, Peter Mattis
| developer = The GNOME Project, eXperimental Computing Facility (XCF)
| released = {{Start date and age|1998|04|14}}
| ver layout = simple
| latest release version = 4.16.12
| latest release date = {{Start date and age|2025|01|03}}
| latest preview version = 4.17.4
| latest preview date = {{Start date and age|2025|02|01}}
| programming language = C, CSS{{cite web | url = https://www.openhub.net/p/gtk/analyses/latest/languages_summary | title = The GTK Open Source Project on Open Hub: Languages Page | website = www.openhub.net |access-date=March 28, 2019 |archive-date=March 28, 2019 | archive-url = https://web.archive.org/web/20190328192113/https://www.openhub.net/p/gtk/analyses/latest/languages_summary | url-status = live}}
| operating system = Linux, Unix-like, macOS, Windows
| platform =
| genre = Widget toolkit
| license = LGPLv2.1+
| website = {{URL|https://gtk.org}}
}}
GTK (formerly GIMP ToolKit{{Cite web|url=https://www.gtk.org/about/|title=A brief description on how GTK was born.|website=www.gtk.org|access-date=July 5, 2023|archive-date=June 9, 2023|archive-url=https://web.archive.org/web/20230609101108/https://www.gtk.org/about/|url-status=live}} and GTK+{{Cite web|url=https://mail.gnome.org/archives/gtk-devel-list/2019-February/msg00000.html|title=Project rename to "GTK"|last=Bassi|first=Emmanuele|date=2019-02-06|website=mail.gnome.org|publisher=GNOME mailinglist|access-date=2019-02-07|archive-date=November 7, 2020|archive-url=https://web.archive.org/web/20201107233352/https://mail.gnome.org/archives/gtk-devel-list/2019-February/msg00000.html|url-status=live}}) is a free software cross-platform widget toolkit for creating graphical user interfaces (GUIs).{{cite web |url=https://www.gtk.org/features.php |title=GTK+ Features |author=The GTK+ Team |access-date=September 8, 2014 |archive-date=May 25, 2019 |archive-url=https://web.archive.org/web/20190525124304/https://www.gtk.org/features.php |url-status=dead}} 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.{{Cite web|url=https://www.x.org/wiki/Documentation/|title=Documentation|website=www.x.org|access-date=November 22, 2019|archive-date=December 21, 2019|archive-url=https://web.archive.org/web/20191221235118/https://www.x.org/wiki/Documentation/|url-status=live}}
The GTK team releases new versions on a regular basis. GTK 4 and GTK 3 are maintained, while GTK 2 is end-of-life.{{Cite web|title=GTK 4.0 – GTK Development Blog|date=December 16, 2020|url=https://blog.gtk.org/2020/12/16/gtk-4-0/|access-date=2021-10-18|language=en-US|archive-date=May 28, 2023|archive-url=https://web.archive.org/web/20230528122452/https://blog.gtk.org/2020/12/16/gtk-4-0/|url-status=live}} GTK1 is independently maintained by the CinePaint project.{{Cite web|url=https://gitlab.com/robinrowe/gtk1|title=Robin Rowe / GTK1 · GitLab|website=GitLab|access-date=February 22, 2023|archive-date=March 9, 2023|archive-url=https://web.archive.org/web/20230309201628/https://gitlab.com/robinrowe/gtk1|url-status=live}}
Software architecture
File:GTK+ software architecture.svg, GDK, ATK, GIO, Cairo and GLib ]]
File:GDK software architecture.svg contains back-ends to X11, Wayland, Broadway (HTTP), Quartz, and GDI and relies on Cairo for the rendering. Its new SceneGraph is work-in-progress.]]
{{update section|date=May 2024|GTK4's release and features}}
The GTK library contains a set of graphical control elements (widgets); version 3.22.16 contains 186 active and 36 deprecated widgets.{{cite web |title=GTK+ 3 Reference Manual |url=https://developer.gnome.org/gtk3/stable/ |access-date=2017-07-15 |archive-date=June 23, 2021 |archive-url=https://web.archive.org/web/20210623002412/https://developer.gnome.org/gtk3/stable/ |url-status=live}} GTK is an object-oriented widget toolkit written in the programming language C; it uses GObject (that is, the GLib object system) for object orientation. While GTK is mainly used with 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.{{cite web |url=https://developer.gnome.org/gtk3/stable/gtk-broadway.html |title=Using GTK+ with Broadway |website=GNOME Developer |publisher=GNOME |access-date=March 6, 2018 |archive-date=June 14, 2021 |archive-url=https://web.archive.org/web/20210614021102/https://developer.gnome.org/gtk3/stable/gtk-broadway.html |url-status=live}}{{cite web|title=Broadway - GitHub symbiose/symbiose Wiki|url=https://github.com/symbiose/symbiose/wiki/Broadway|website=GitHub|access-date=March 6, 2018|archive-date=June 28, 2023|archive-url=https://web.archive.org/web/20230628094731/https://github.com/symbiose/symbiose/wiki/Broadway|url-status=live}}
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.{{cite web |url=http://developers.slashdot.org/article.pl?sid=05/02/04/2021236 |title=GTK+ to Use Cairo Vector Engine |date=February 5, 2005 |access-date=2009-12-27}} Since GTK version 3.0, all rendering is done using Cairo.{{Cite web |title=Gtk: Migrating from GTK 2.x to GTK 3 |url=https://docs.gtk.org/gtk3/migrating-2to3.html |access-date=2022-06-16 |website=docs.gtk.org |language=en |quote=All drawing in GTK 3 is done via Cairo. |archive-date=May 26, 2023 |archive-url=https://web.archive.org/web/20230526073106/https://docs.gtk.org/gtk3/migrating-2to3.html |url-status=live}}
On January 26, 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.{{cite web |url=https://mclasen.fedorapeople.org/gtk4-devconf2018.pdf |title=Matthias Clasen DevConf.cz 2018 talk about GTK+ 4 |date=2018-01-26 |access-date=March 9, 2018 |archive-date=2024-04-22 |archive-url=https://web.archive.org/web/20240422184711/https://mclasen.fedorapeople.org/gtk4-devconf2018.pdf |url-status=live}} On February 6, 2019 it was announced that GTK 4 will drop the “+” from the project's name.
=GTK Drawing Kit (GDK)=
{{Main|GDK}}
GDK acts as a wrapper around the low-level functions provided by the underlying windowing and graphics systems.
=GTK Scene Graph Kit (GSK)=
{{Main|GTK Scene Graph Kit}}
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.
= GtkBuilder =
GtkBuilder allows user interfaces to be designed without writing code. The interface is described in an Extensible Markup Language (XML) file which is written by hand or generated by a GUI designer, which is then loaded at runtime and the objects created automatically. The description of the user interface is independent from the programming language being used.
=Language bindings=
{{Main article|List of language bindings for GTK}}
Language bindings are available for using GTK from languages other than C, including C++, Genie, JavaScript, Perl, Python, Vala, and others.{{cite web |author=The GTK+ Team |title=GTK+ Language Bindings |url=https://www.gtk.org/language-bindings.php |url-status=dead |archive-url=https://web.archive.org/web/20190525124310/https://www.gtk.org/language-bindings.php |archive-date=May 25, 2019 |access-date=June 3, 2017 |website=www.gtk.org}}
= Backends =
GTK supports various backends, which provides different ways to display GTK applications depending on the system and environment. Examples of GTK backends are:
- Wayland – Used with the Wayland display server on Linux systems, it is a modern replacement for X11.
- X11 – The default on Linux systems using the X.Org display server.
- Win32 – For running GTK applications on Windows.
- Quartz – For macOS support.
- Broadway – Allows GTK applications to run in web browsers using HTML5 and WebSocket.
Development tools
=GUI designers=
File:Camabalache's interface.png]]
There are several GUI designers for GTK. Here is a selection of GTK GUI designers:
- Cambalache - a successor to Glade, supports GTK 4.{{Cite web |last=GUADEC |title=Cambalache: road to version 1.0 |url=https://events.gnome.org/event/209/contributions/763/}}{{Cite web |title=glade - man pages section 1: User Commands |url=https://docs.oracle.com/cd/E88353_01/html/E37839/glade-1.html |access-date=2024-09-11 |website=docs.oracle.com}}
- Glade - supports GtkBuilder, which is a GTK built-in GUI description format. (not actively maintained)
- Gazpacho - GUI builder for the GTK toolkit written in Python{{Cite web|url=https://packages.debian.org/search?keywords=gazpacho|title=Debian -- Package Search Results -- gazpacho|website=packages.debian.org|access-date=November 22, 2019|archive-date=June 28, 2023|archive-url=https://web.archive.org/web/20230628022158/https://packages.debian.org/search?keywords=gazpacho|url-status=live}}
- Crow Designer - relies on its own GuiXml format and GuiLoader library.{{cite web |url=http://nothing-personal.googlecode.com/ |archive-url=https://archive.today/20130124182138/http://nothing-personal.googlecode.com/ |url-status=dead |archive-date=2013-01-24 |title=Nothing-personal - A development site for Crow Designer, GuiLoader and Rally - Google Project Hosting |access-date=2014-02-17}}
- Stetic - part of MonoDevelop, oriented toward Gtk#.
- Gambas (since version 2.0 atop BASIC)
- Xojo
- Lazarus (on Linux defaults to interfacing with GTK 2)
=GTK Inspector=
The GTK Inspector is a built-in interactive debugging tool in GTK, allowing developers to inspect and modify UI elements, test CSS changes, and analyze widget structure in real time. It can be enabled using the Control + Shift + I
or Control + Shift + D
shortcuts, or by setting the GTK_DEBUG=interactive
environment variable.{{Cite web |title=GTK Inspector |url=https://developer.gnome.org/documentation/tools/inspector.html |access-date=2024-09-14 |website=GNOME Developer Documentation |language=en}} It was introduced with GTK version 3.14.{{cite web |date=2014-05-15 |title=Introducing GtkInspector |url=http://blogs.gnome.org/mclasen/2014/05/15/introducing-gtkinspector/ |url-status=live |archive-url=https://web.archive.org/web/20140517185349/http://blogs.gnome.org/mclasen/2014/05/15/introducing-gtkinspector/ |archive-date=May 17, 2014 |access-date=May 17, 2014}}{{cite web |date=2014-07-11 |title=Another GtkInspector update |url=http://blogs.gnome.org/mclasen/2014/07/11/another-gtkinspector-update/ |url-status=live |archive-url=https://web.archive.org/web/20140714164943/http://blogs.gnome.org/mclasen/2014/07/11/another-gtkinspector-update/ |archive-date=July 14, 2014 |access-date=July 13, 2014}}
== Features ==
- Interactive debugging
- Real-time CSS testing and modifications
- Widget magnification for detailed inspection
- UI structure analysis and object property examination
- Customizable display settings via environment variables
- Detailed object inspection (type, state, properties, CSS, actions, etc.)
- Global application information display
- CSS rule debugging
- Rendering pipeline recording and inspection
Development
GTK is mainly developed by The GNOME Project, which also develops the GNOME Development Platform and the GNOME Desktop Environment.{{cite web |url=https://wiki.gnome.org/Engagement/SWOT |title=GNOME Quick SWOT Analysis |website=The GNOME Project |access-date=March 18, 2014 |archive-date=March 18, 2014 |archive-url=https://web.archive.org/web/20140318194439/https://wiki.gnome.org/Engagement/SWOT |url-status=live}} GTK is mainly written in C.{{cite web |title=GNOME Languages |url=http://www.ohloh.net/p/gnome/analyses/latest/languages_summary |url-status=dead |archive-url=https://web.archive.org/web/20140522160337/http://www.ohloh.net/p/gnome/analyses/latest/languages_summary |archive-date=May 22, 2014 |access-date=May 22, 2014 |website=Ohloh |publisher=Black Duck Software}} Many language bindings are available. GTK development is loosely managed.
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.{{cite web |url=http://guadec.expectnation.com/public/content/about |title=About |publisher=GNOME Users And Developers European Conference (GUADEC) |access-date=December 3, 2011 |url-status=dead |archive-url=https://web.archive.org/web/20111004061840/http://guadec.expectnation.com/public/content/about |archive-date=October 4, 2011}} GNOME incorporates standards and programs from freedesktop.org to better interoperate with other desktops.{{Citation needed|date=February 2023}}
Many GNOME applications have been ported to GTK 4, which was released in December 2020, {{cite web |url=https://blog.gtk.org/2020/12/16/gtk-4-0/ |title=GTK 4.0 |publisher=GTK development blog |date=2020-12-16 |access-date=October 18, 2021 |archive-date=May 28, 2023 |archive-url=https://web.archive.org/web/20230528122452/https://blog.gtk.org/2020/12/16/gtk-4-0/ |url-status=live}} however some still use GTK+ 3 (GIMP being a major one).
=Build automation=
The master branch of GTK utilizes Meson for its build automation. GTK (and GNOME, GLib, etc.) formerly utilized the GNU Build System (named Autotools) as the build automation system of choice. Since August 14, 2017, the Autotools build system files have been dropped.{{cite web |url=https://mail.gnome.org/archives/gtk-devel-list/2017-August/msg00028.html |title=Build system change GTK's master branch |website=mail.gnome.org |access-date=October 29, 2018 |archive-date=August 15, 2017 |archive-url=https://web.archive.org/web/20170815142255/https://mail.gnome.org/archives/gtk-devel-list/2017-August/msg00028.html |url-status=live}}
Criticism
The most common criticism of GTK is the lack of backward-compatibility in major updates, most notably in the application programming interface (API){{cite web |url=http://blogs.gnome.org/mortenw/2014/06/23/how-does-one-create-a-gtk-application/ |title=How Does One Create A Gtk+ Application? – Morten Welinder |website=blogs.gnome.org |date=June 23, 2014 |access-date=June 3, 2017 |archive-date=July 1, 2014 |archive-url=https://web.archive.org/web/20140701054734/http://blogs.gnome.org/mortenw/2014/06/23/how-does-one-create-a-gtk-application/ |url-status=live}} and theming.{{cite web |url=https://blogs.gnome.org/mclasen/2015/11/20/a-gtk-update/ |title=A GTK+ update |author=mclasen |date=November 20, 2015 |website=Goings on |access-date=June 3, 2016 |archive-date=May 2, 2016 |archive-url=https://web.archive.org/web/20160502021009/https://blogs.gnome.org/mclasen/2015/11/20/a-gtk-update/ |url-status=live}} The result is that application developers or theme developers have to rewrite parts of their code to make it work with a newer version of GTK.
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.
- Aurélien Gâteau started Gwenview as GTK application but switched to qt early in development.{{cite web |quote=Yes, you read this right! Gwenview started its life as a GTK+ application! |url=https://agateau.com/2021/the-story-behind-gwenview-name/ |title=The story behind Gwenview name |author=Aurélien Gâteau |website=agateau.com |date=2021-10-03 |accessdate=2024-12-15 |archive-url=https://web.archive.org/web/20240422132531/https://agateau.com/2021/the-story-behind-gwenview-name/ |archive-date=2024-04-22}}
- Dirk Hohndel, codeveloper of Subsurface and member of Intel's Open-Source Technology Center, criticized the GTK developers for being abrasive and ignoring most community requests.{{cite web |url=https://www.phoronix.com/scan.php?page=news_item&px=MTU2ODM |title=The Biggest Problem With GTK & What Qt Does Good |last=Larabel |first=Michael |publisher=Phoronix |date=2014-01-12 |access-date=2014-09-10 |archive-date=July 1, 2016 |archive-url=https://web.archive.org/web/20160701024533/http://www.phoronix.com/scan.php?page=news_item&px=MTU2ODM |url-status=live}}
- Hong Jen Yee, developer of LXDE (the GTK version of which was dropped and all efforts focused on the Qt port), expressed disdain for version 3 of the GTK toolkit's radical API changes and increased memory usage, and ported PCMan File Manager (PCManFM) to Qt. PCManFM is being developed with a GTK and with a Qt backend at the same time.{{cite web |url=http://blog.lxde.org/?p=990 |title=PCManFM Qt 0.1.0 released |author=Hong Jen Yee |date=2013-03-26 |access-date=2014-09-10 |archive-date=June 7, 2013 |archive-url=https://web.archive.org/web/20130607022757/http://blog.lxde.org/?p=990 |url-status=live}}
- The Audacious music player moved to Qt in version 3.6.{{Cite web|url=https://audacious-media-player.org/news/32-audacious-3-6-released|title=Audacious - An Advanced Audio Player|website=audacious-media-player.org|access-date=November 22, 2019|archive-date=July 28, 2019|archive-url=https://web.archive.org/web/20190728162703/https://audacious-media-player.org/news/32-audacious-3-6-released|url-status=live}} The reasons stated by the developers for this include a transition to client-side window decorations, which they claim cause the application to look "GNOME-y and out of place."{{cite web |url=http://redmine.audacious-media-player.org/boards/1/topics/1135 |title=Ugly window decorations and how to fix them (GTK 3.12) |last=Lindgren |first=John |date=2014-05-06 |access-date=2014-10-21 |archive-date=October 13, 2014 |archive-url=https://web.archive.org/web/20141013110025/http://redmine.audacious-media-player.org/boards/1/topics/1135 |url-status=live}}
- Wireshark has switched to Qt due to not having a good experience with GTK's cross-platform support.{{cite web |url=https://blog.wireshark.org/2013/10/switching-to-qt/ |title=We're switching to Qt |author=Gerald Combs |date=2013-10-15 |access-date=2015-08-19 |archive-date=October 19, 2013 |archive-url=https://web.archive.org/web/20131019164809/https://blog.wireshark.org/2013/10/switching-to-qt/ |url-status=live}}
Use
File:Free and open-source-software display servers and UI toolkits.svg requires applications to be adapted to Wayland as well.]]
File:GIMP 2.8 in Single Window Mode running on Ubuntu.png 2.8 - GTK is responsible for managing the interface components of the program, including the menus, buttons, and input fields.]]
=Applications=
{{Main|List of GTK applications|:Category:Software that uses GTK}}
Some notable applications that use GTK as a widget toolkit include:
- Ardour, a digital audio workstation (DAW)
- Deluge, a BitTorrent client
- Foliate, an ebook reader
- GIMP, a raster graphics editor
- GNOME Core Applications, a collection of applications as a standard bundle of the GNOME desktop environment
- GNOME Circle, a collection of applications created to work within the GNOME ecosystem
- GNOME Evolution, a personal information manager
- HandBrake, digital video transcoder
- Inkscape, a vector graphics editor
- LibreOffice, an office suite
- Lutris, a game manager
- Mozilla Firefox, a web browser
- Mozilla Thunderbird, a personal information manager
- Pitivi, a video editor
- PCSX-Reloaded, a video game console emulator
- REAPER, a digital audio workstation (DAW)
- Remmina, a remote desktop client
- Transmission, a Bit Torrent client
GTK programs can be run on desktop environments based on X11 and Wayland, or others including ones 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. It is used by some popular cross-platform applications like Pidgin and GIMP. wxWidgets, a cross-platform GUI toolkit, uses GTK on Linux by default.{{cite web |title=GTK+ |url=http://www.wxwidgets.org/wiki/index.php/WxWidgets_Compared_To_Other_Toolkits#GTK.2B |url-status=live |archive-url=https://web.archive.org/web/20071005160312/http://www.wxwidgets.org/wiki/index.php/WxWidgets_Compared_To_Other_Toolkits#GTK.2B |archive-date=October 5, 2007 |access-date=August 28, 2007 |work=WxWidgets Compared To Other Toolkits}} Other ports include DirectFB (for example used by the Debian installer).
=Desktop environments=
{{Main|:Category:Desktop environments based on GTK|l1=Desktop environments based on GTK}}
Several desktop environments utilize GTK as the widget toolkit.
==Current==
- GNOME, based on GTK, meaning that programs native to GNOME use GTK
- Budgie, built from scratch for the SolusOS successor, Solus Operating System
- Cinnamon, a fork of GNOME 3 which uses GTK version 3
- MATE, a fork of GNOME 2 which uses GTK 3 since version 1.18
- Xfce, based on GTK 3 since version 4.14
- Pantheon uses GTK 3 & 4, being developed by elementary OS
- Sugar, a desktop environment for youth primary education, which uses GTK, especially PyGTK
- Phosh, a mobile UI designed for PureOS
- LXDE (Lightweight X11 Desktop Environment) is based on GTK 2
- Unity, the former default desktop environment of Ubuntu
==Inactive==
- Access Linux Platform (successor of the Palm OS PDA platform)
- Consort, the GNOME 3.4 Fallback Mode – fork from Solus
- GPE, the GPE Palmtop Environment
- ROX Desktop, a lightweight desktop, with features from the GUI of RISC OS
=Window managers=
=GtkSourceView=
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.{{Citation needed|date=December 2023}}
=GtkSpell=
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.
History
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.{{cite web |url=http://www.linuxworld.com/linuxworld/lw-1999-01/lw-01-gimp.html |title=LinuxWorld - Where did Spencer Kimball and Peter Mattis go? |access-date=2013-08-19 |url-status=dead |archive-url=https://web.archive.org/web/19990417052141/http://www.linuxworld.com/linuxworld/lw-1999-01/lw-01-gimp.html |archive-date=April 17, 1999}} Finally GTK was re-written to be object-oriented and was renamed GTK+.{{cite web |url=http://developer.gnome.org/gtk-faq/stable/x90.html |archive-url= https://web.archive.org/web/20120326131857/http://developer.gnome.org/gtk-faq/stable/x90.html |title=What is the + in GTK+? |year=2011 |access-date=2014-03-18 |archive-date=2012-03-26}} 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.
= GTK 2 =
The GTK 2.0.0 release (2002https://mail.gnome.org/archives/gtk-devel-list/2002-March/msg00161.html) 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 3 =
GTK version 3.0.0 (2011https://mail.gnome.org/archives/gtk-devel-list/2011-February/msg00020.html) 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.{{Cite web|url=https://gitlab.gnome.org/GNOME/gtk/commit/d080be3e5091c98d5171063a95d55c01170881f3|title=Rename some references to GTK+ (d080be3e) · Commits · GNOME / gtk|website=gitlab.gnome.org|date=February 4, 2019|access-date=February 5, 2019|archive-date=February 25, 2021|archive-url=https://web.archive.org/web/20210225124433/https://gitlab.gnome.org/GNOME/gtk/commit/d080be3e5091c98d5171063a95d55c01170881f3|url-status=live}}
= GTK 4 <span class="anchor" id="GTK4"></span><span class="anchor" id="GTK 4"></span> =
Release of the first GTK 4 version was in December 2020. At the 2018 edition of 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.{{cite web |last1=Clasen |first1=Matthias |title=GTK+ 4 Status Update |url=https://mclasen.fedorapeople.org/gtk4-devconf2018.pdf |website=Fedora People |access-date=April 22, 2024|archive-date=April 22, 2024 |archive-url=https://web.archive.org/web/20240422184711/https://mclasen.fedorapeople.org/gtk4-devconf2018.pdf |url-status=live}}
One of the main changes made during the GTK 4 development cycle (i.e. GTK 3.92, etc.) was the removal of user customization options (like individual keyboard shortcuts that could be set in GTK+ 2), and the delegation of functionality to ancillary objects instead of encoding it into the base classes provided by GTK. Other changes include:
- Event handling from signal handlers described by GtkWidget is delegated to event controllers.
- Rendering is delegated to GtkSnapshot objects.
- The layout mechanism is delegated from GtkWidget to GtkLayoutManager.
=Releases=
class="wikitable mw-collapsible mw-collapsed" style="width:100%;" |
Release series
! Initial release ! Major enhancements ! Latest minor version |
---|
{{Version|o|1.0}}
| First stable version | 1.0. |
{{Version|o|1.2}}
| New widgets:
| 1.2.10 |
{{Version|o|2.0}}
| GObject Overall support for UTF-8 | 2.0.9 |
{{Version|o|2.2}}
| Multihead support | 2.2.4 |
{{Version|o|2.4}}
| New widgets:
| 2.4.14 |
{{Version|o|2.6}}
| New widgets:
The last to support Windows 98/Me | 2.6.10 |
{{Version|o|2.8}}
| Most widgets are rendered by Cairo | 2.8.20 |
{{Version|o|2.10}}
| New widgets:
Print support: GtkPrintOperation | 2.10.14 |
{{Version|o|2.12}}
| GtkBuilder | style="white-space: nowrap;" | 2.12.12 |
{{Version|o|2.14}}
| JPEG 2000 load support | style="white-space: nowrap;" | 2.14.7 |
{{Version|o|2.16}}
| New widget: GtkOrientable Caps Lock warning in password entry Improvements on GtkScale, GtkStatusIcon, GtkFileChooser | style="white-space: nowrap;" | 2.16.6 |
{{Version|o|2.18}}
| 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 | style="white-space: nowrap;" | 2.18.9 |
{{Version|o|2.20}}
| New widgets:
Improvement on file chooser, keyboard handling, GDK Introspection data is now included in GTK | style="white-space: nowrap;" | 2.20.1 |
{{Version|o|2.22}}
| 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 | style="white-space: nowrap;" | 2.22.1 |
{{Version|o|2.24}}
| 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 | style="white-space: nowrap;" | 2.24.33 |
{{Version|o|3.0}}
| Development and design of the GTK 3 release of the toolkit started in February 2009 during the GTK Theming Hackfest held in Dublin{{cite web|url=http://aruiz.typepad.com/siliconisland/2009/02/gtk-30-theming.html|title=Gtk+ 3.0 Theming API Hackfest|website=Silicon Island|access-date=June 3, 2017|archive-date=July 17, 2011|archive-url=https://web.archive.org/web/20110717121424/http://aruiz.typepad.com/siliconisland/2009/02/gtk-30-theming.html|url-status=live}}
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 | style="white-space: nowrap;" | 3.0.12 |
{{Version|o|3.2}}
| New widgets:
New Font Chooser dialog New experimental backends: | style="white-space: nowrap;" | 3.2.4 |
{{Version|o|3.4}}
| 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 | style="white-space: nowrap;" | 3.4.4 |
{{Version|o|3.6}}
| New widgets:
Vertical spin buttons CSS animations, blur shadows Support for cross-fading and transitions in themes | style="white-space: nowrap;" | 3.6.5 |
{{Version|o|3.8}}
| Wayland 1.0 stable support Support for the broadwayd server Improved theming Better geometry management Touch improvements Support with the window manager for the frame synchronization protocol GdkFrameClock added{{Cite web|url=https://developer.gnome.org/gdk3/stable/GdkFrameClock.html|title=Frame clock: GDK 3 Reference Manual|website=developer.gnome.org|access-date=April 13, 2017|archive-date=April 14, 2017|archive-url=https://web.archive.org/web/20170414162353/https://developer.gnome.org/gdk3/stable/GdkFrameClock.html|url-status=live}} | style="white-space: nowrap;" | 3.8.9 |
{{Version|o|3.10}}
| New widgets:
Support for Wayland 1.2
Added:
Removed:
Tear-off menu-items, plus many GTK settings The modern GTK drawing model | style="white-space: nowrap;" | 3.10.9 |
{{Version|o|3.12}}
Support for Wayland 1.5 New widget: GtkPopover (an alternative to menus and dialogs) | style="white-space: nowrap;" | 3.12.2 |
{{Version|o|3.14}}
| GtkInspector (a copy of gtkparasite) introduced{{cite web |url=http://blogs.gnome.org/mclasen/2014/05/15/introducing-gtkinspector/ |title=GtkInspector Author's blog entry |author=Matthias Clasen |date=2014-05-15 |access-date=2014-05-17 |archive-date=May 17, 2014 |archive-url=https://web.archive.org/web/20140517185349/http://blogs.gnome.org/mclasen/2014/05/15/introducing-gtkinspector/ |url-status=live}}{{cite web |url=https://wiki.gnome.org/Projects/GTK%2B/Inspector |title=GtkInspector in GNOME wiki |date=2014-05-15 |access-date=2014-05-17 |archive-date=May 24, 2014 |archive-url=https://web.archive.org/web/20140524030546/https://wiki.gnome.org/Projects/GTK%2B/Inspector |url-status=live}} Improved support for gestures/multi-touch merged{{cite web |url=https://www.phoronix.com/scan.php?page=news_item&px=MTY5ODc |title=Merging gestures into 3.14 |date=2014-05-23 |access-date=2014-05-23 |archive-date=September 14, 2016 |archive-url=https://web.archive.org/web/20160914120128/http://www.phoronix.com/scan.php?page=news_item&px=MTY5ODc |url-status=live}}{{cite web |url=https://mail.gnome.org/archives/gtk-devel-list/2014-March/msg00018.html |title=RFC: gestures |date=2014-03-04 |access-date=2014-05-23 |archive-date=May 24, 2014 |archive-url=https://web.archive.org/web/20140524023059/https://mail.gnome.org/archives/gtk-devel-list/2014-March/msg00018.html |url-status=live}}
Most widgets converted to use gestures internally Wayland supports GNOME Shell classic mode{{cite web |url=https://mail.gnome.org/archives/ftp-release-list/2014-June/msg00075.html |title=gtk+ 3.13.3 |date=2014-06-24 |access-date=June 25, 2014 |archive-date=December 15, 2014 |archive-url=https://web.archive.org/web/20141215042625/https://mail.gnome.org/archives/ftp-release-list/2014-June/msg00075.html |url-status=live}} | style="white-space: nowrap;" | 3.14.15 |
{{Version|o|3.16}}
| GDK supports rendering windows using OpenGL for X11 and Wayland using libepoxy New widgets:
Scrolling overhauled (scrollbar hidden by default{{cite web|url=http://www.heise.de/open/meldung/Linux-Desktop-Neues-Gnome-zeigt-Nachrichten-oben-2584020.html|title=Linux-Desktop: Neues Gnome zeigt Nachrichten oben|first=heise|last=online|website=heise online|date=March 25, 2015|access-date=June 3, 2017|archive-date=June 25, 2016|archive-url=https://web.archive.org/web/20160625193825/http://www.heise.de/open/meldung/Linux-Desktop-Neues-Gnome-zeigt-Nachrichten-oben-2584020.html|url-status=live}}) Experimental Mir backend{{cite web|url=https://mail.gnome.org/archives/gnome-announce-list/2015-March/msg00029.html|title=GTK+ 3.16.0 released|website=mail.gnome.org|access-date=June 3, 2017|archive-date=April 7, 2016|archive-url=https://web.archive.org/web/20160407050958/https://mail.gnome.org/archives/gnome-announce-list/2015-March/msg00029.html|url-status=live}} | style="white-space: nowrap;" | 3.16.7 |
{{Version|o|3.18}}
| 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) gtk-builder-tool utility Output-only windows | style="white-space: nowrap;" | 3.18.9 |
{{Version|o|3.20}}
Move drag and drop down to GDK New widget: GtkShortcutsWindow (shows keyboard shortcuts and gestures of an application) | style="white-space: nowrap;" | 3.20.10 |
{{Version|o|{{Anchor|3.22}}3.22}}
Wayland tablet support is merged,{{Cite web|url=https://blogs.gnome.org/carlosg/2016/04/06/gtk-wayland-tablet-support-is-merged/|title=GTK+ Wayland tablet support is merged – Carlos Garnacho|date=April 6, 2016 |access-date=April 8, 2016|archive-date=April 16, 2016|archive-url=https://web.archive.org/web/20160416185814/https://blogs.gnome.org/carlosg/2016/04/06/gtk-wayland-tablet-support-is-merged/|url-status=live}} support for graphics tablets is considered feature complete{{Cite web|url=https://www.x.org/wiki/Events/XDC2016/Program/hutterer_input/|title=hutterer input|website=www.x.org|access-date=September 23, 2016|archive-date=September 23, 2016|archive-url=https://web.archive.org/web/20160923183522/https://www.x.org/wiki/Events/XDC2016/Program/hutterer_input/|url-status=live}} GTK 3.22 shall be as rock-stable (and hence "boring") as GTK 2{{cite web |url=http://videos.guadec.org/2013/GTK%20to%20infinity%20and%20beyond/ |title=GUADEC2013: Benjamin Otte talks about GTK+ |publisher=GUADEC |access-date=March 5, 2014 |archive-date=March 6, 2014 |archive-url=https://web.archive.org/web/20140306004816/http://videos.guadec.org/2013/GTK%20to%20infinity%20and%20beyond/ |url-status=live}}{{cite web |url=https://blogs.gnome.org/desrt/2016/06/13/gtk-4-0-is-not-gtk-4/ |title=Gtk 4.0 will not be stable until Gtk 4.6 |date=2016-06-13 |access-date=June 15, 2016 |archive-date=June 23, 2016 |archive-url=https://web.archive.org/web/20160623201838/https://blogs.gnome.org/desrt/2016/06/13/gtk-4-0-is-not-gtk-4/ |url-status=dead}}{{cite web |url=https://blogs.gnome.org/desrt/2016/06/14/gtk-5-0-is-not-gtk-5/ |title=Gtk 5.0 will not be stable until Gtk 5.6 |date=2016-06-14 |access-date=June 15, 2016 |archive-date=June 23, 2016 |archive-url=https://web.archive.org/web/20160623202157/https://blogs.gnome.org/desrt/2016/06/14/gtk-5-0-is-not-gtk-5/ |url-status=live}} | style="white-space: nowrap;" | for 3+ years |
{{Version|co|{{Anchor|3.24}} 3.24}}
| 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:
| style="white-space: nowrap;" | 3.23.0 3.24.29 |
{{Version|o|3.90}}
| GTK Scene Graph Kit (GSK) merged{{Cite web|url=https://wiki.gnome.org/action/show/Projects/GTK/Roadmap?action=show&redirect=Projects%2FGTK%2B%2FRoadmap|title=Projects/GTK/Roadmap - GNOME Wiki!|website=wiki.gnome.org|access-date=November 22, 2019|archive-date=May 22, 2019|archive-url=https://web.archive.org/web/20190522064325/https://wiki.gnome.org/action/show/Projects/GTK/Roadmap?action=show&redirect=Projects%2FGTK%2B%2FRoadmap|url-status=live}} Remove any API marked as deprecated Heavy development A new Vulkan-renderer augments the old Cairo-renderer{{Cite web|url=https://gitlab.gnome.org/GNOME/gtk/commits/master|title=Commits · master · GNOME / gtk|website=GitLab|access-date=November 22, 2019|archive-date=June 22, 2020|archive-url=https://web.archive.org/web/20200622233109/https://gitlab.gnome.org/GNOME/gtk/commits/master|url-status=dead}} | style="white-space: nowrap;" | 3.89.1 3.89.2 3.89.4 3.89.5 3.90 |
{{Version|o|3.92}}
| style="white-space: nowrap;" | 2017-10-18{{cite mailing list |url=https://mail.gnome.org/archives/ftp-release-list/2017-October/msg00117.html |title=gtk+ 3.92.1 |date=October 18, 2017 |access-date=May 20, 2019 |last=Clasen |first=Matthias |mailing-list=GNOME Mail Services |archive-date=December 29, 2017 |archive-url=https://web.archive.org/web/20171229231726/https://mail.gnome.org/archives/ftp-release-list/2017-October/msg00117.html |url-status=live}}{{Cite web|url=https://blog.gtk.org/2017/10/23/gtk-3-92/|title=GTK+ 3.92|last=Clasen|first=Matthias|date=October 23, 2017|website=GTK Development Blog|access-date=May 25, 2019|archive-date=May 25, 2019|archive-url=https://web.archive.org/web/20190525193411/https://blog.gtk.org/2017/10/23/gtk-3-92/|url-status=live}} | As GNOME 3.26 was released already on September 13, 2017,{{cite web |url=https://www.gnome.org/news/2017/09/gnome-3-26-released/ |title=GNOME 3.26 Released |date=2017-09-13 |access-date=October 19, 2017 |archive-date=March 16, 2021 |archive-url=https://web.archive.org/web/20210316003713/https://www.gnome.org/news/2017/09/gnome-3-26-released/ |url-status=live}} it was not based on GTK 3.92. GNU autotools was replaced with Meson. | style="white-space: nowrap;" | 3.91.0 3.91.1 3.91.2 3.92.1 |
{{Version|o|3.94}}
| 3.93
GdkWindow renamed to GdkSurface New abstraction for drawable content: GdkPaintable There is support for displaying media with:
| style="white-space: nowrap;" | 3.93 |
{{Version|o|3.96}}
| The {{mono|gtk4-builder-tool}} {{kbd|simplify}} command has gained a {{kbd |
-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.{{Cite web|url=https://developer.gnome.org/amtk/unstable/amtk-intro.html|title=Introducing amtk|access-date=May 4, 2020|archive-date=June 22, 2020|archive-url=https://web.archive.org/web/20200622105055/https://developer.gnome.org/amtk/unstable/amtk-intro.html|url-status=dead}}
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:
| 3.93 |
{{version|o|3.98}}
| style="white-space: nowrap;" | 2020-02-10 |
|3.96.0 |
{{version|o|3.99.0}}
|
|3.99.4 |
{{Version|o|{{Anchor|4.0}} 4.0}}
| | 4.0.3 |
{{Version|o|{{Anchor|4.2}} 4.2}}
| |4.2.1 |
{{Version|o|{{Anchor|4.4}} 4.4}}
| |4.4.1 |
{{Version|o|{{Anchor|4.6}} 4.6}}
| |4.6.9 |
{{Version|o|{{Anchor|4.8}} 4.8}}
| |4.8.3 |
{{Version|o|{{Anchor|4.10}} 4.10}}
| GtkFileChooser deprecated (use GtkFileDialog){{Cite web |url=https://blog.gtk.org/2022/10/30/on-deprecations/ |title=On deprecations – GTK Development Blog |date=October 30, 2022 |access-date=April 21, 2024 |archive-date=February 28, 2024 |archive-url=https://web.archive.org/web/20240228135914/https://blog.gtk.org/2022/10/30/on-deprecations/ |url-status=live}} |4.10.5 |
{{Version|o|{{Anchor|4.12}} 4.12}}
| |4.12.5 |
{{Version|o|{{Anchor|4.14}} 4.14}}
| |4.14.6 |
{{Version|c|{{Anchor|4.16}} 4.16}}
| |4.16.12 |
colspan="4" | {{Version|l|show=111111}} |
See also
{{Portal|Free and open-source software}}
- Client-side decoration
- List of widget toolkits
- gtkmm – C++ bindings for GTK
- Enlightenment Foundation Libraries (EFL) – widget toolkit written for the Enlightenment window manager
- FLTK – a light, cross-platform, non-native widget toolkit
- Fox toolkit – a fast, open source, cross-platform widget toolkit
- IUP – a multi-platform toolkit for building native graphical user interfaces
- Ultimate++
- Visual Component Library (VCL)
References
{{reflist|1=30em}}
Bibliography
{{Refbegin}}
- {{citation
|last = Krause
|first = Andrew
|title = Foundations of GTK+ Development
|date = April 23, 2007
|url = https://archive.org/details/foundationsofgtk00krau
|edition = 1st
|publisher = Apress
|isbn = 978-1-59059-793-4
}}
- {{citation
|last = Wright
|first = Peter
|title = Beginning GTK+ and GNOME
|date = May 15, 2000
|edition = 1st
|publisher = Peer Information
|isbn = 978-1-86100-381-2
|url = https://archive.org/details/beginninggtkgnom00wrig
}}
- {{citation
|title = Gtk+ Programming in C
|date = September 6, 2001
|url = http://www.informit.com/store/product.aspx?isbn=0130142646
|last1 = Logan
|first1 = Syd
|edition = 1st
|publisher = Prentice Hall
|isbn = 978-0-13-014264-1
|access-date = August 15, 2009
|archive-date = September 30, 2012
|archive-url = https://web.archive.org/web/20120930103543/http://www.informit.com/store/product.aspx?isbn=0130142646
|url-status = live
}}
{{Refend}}
External links
{{Commons category|GTK}}
{{Wikibooks|X Window Programming|GTK+}}
- {{Official website}}
{{GTK}}
{{GNU}}
{{Widget toolkits}}
{{GUI builders}}
{{Authority control}}
{{DEFAULTSORT:Gtk+}}
Category:Application programming interfaces
Category:Articles with example C code
Category:C (programming language) libraries
Category:Cross-platform software
Category:Free computer libraries
Category:Free software programmed in C
Category:Software that uses Cairo (graphics)
Category:Software that uses Meson
Category:Software using the GNU Lesser General Public License