GTK

GTK

GTK

Free and open-source cross-platform widget toolkit for creating graphical user interfaces


GTK (formerly GIMP ToolKit[2] and GTK+[3]) is a free software cross-platform widget toolkit for creating graphical user interfaces (GUIs).[4] 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.[5]

Quick Facts Original author(s), Developer(s) ...

The GTK team releases new versions on a regular basis.[6] GTK 4 and GTK 3 are maintained, while GTK 2 is end-of-life.[7] GTK1 is independently maintained by the CinePaint project.[8]

Software architecture

The GTK toolkit
Simplified software architecture of GTK. Pango, GDK, ATK, GIO, Cairo and GLib
GDK 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.

The GTK library contains a set of graphical control elements (widgets); version 3.22.16 contains 186 active and 36 deprecated widgets.[9] 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.[10][11]

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.[12] Since GTK version 3.0, all rendering is done using Cairo.[13]

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.[14] On 6 February 2019 it was announced that GTK 4 will drop the “+” from the project's name.[3]

GTK Drawing Kit (GDK)

GDK acts as a wrapper around the low-level functions provided by the underlying windowing and graphics systems.

GTK Scene Graph Kit (GSK)

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

GtkInspector was introduced with version 3.14.[15][16] GtkInspector can only be invoked after installing the development package libgtk-3-dev/gtk+-devel.

GUI designers

There are several GUI designers for GTK. The following projects were 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[17]
  • Crow Designer, relies on its own GuiXml format and GuiLoader library.[18]
  • Stetic, part of MonoDevelop, oriented toward Gtk#.
  • Gambas since version 2.0 atop BASIC
  • Xojo on Linux
  • Lazarus on Linux defaults to interfacing with GTK 2

GtkBuilder

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.

Language bindings

Language bindings are available for using GTK from languages other than C, including C++, Genie, JavaScript, Perl, Python, Vala, and others.[19]

GtkSharp, not to be confused with Gtk#, supports GTK 3.

Gtk#

Quick Facts Developer(s), Initial release ...

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.[citation needed]

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.[21]

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.[citation needed]

As of September 2020, 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.[22]

Development

GTK is mainly developed by The GNOME Project, which also develops the GNOME Development Platform and the GNOME Desktop Environment.[23]

GTK development is loosely managed. Discussion chiefly occurs on several public mailing lists.[24] 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.[25] GNOME incorporates standards and programs from freedesktop.org to better interoperate with other desktops.[citation needed]

GTK is mainly written in C.[26] Many language bindings are available.

On September 1, 2016, a post on the GTK development blog denoted, among other things, the future numbering scheme of GTK.[27] 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.[28] 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.[29] 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.[30]

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 master branch of GTK has been built with Meson, and the Autotools build system files have been dropped.[31]

Criticism

The most common criticism of GTK is the lack of backward-compatibility in major updates, most notably in the application programming interface (API)[32] and theming.[33]

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.[34] 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.

  • 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.[35]
  • 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.[36]
  • The Audacious music player moved to Qt in version 3.6.[37] 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."[38]
  • Wireshark has switched to Qt due to not having a good experience with GTK's cross-platform support.[39]

Use

The GTK support for Wayland, co-requisites applications to be adapted to Wayland also
Screenshot of GIMP 2.8 - GTK is responsible for managing the interface components of the program, including the menus, buttons, and input fields.

Applications

Some notable applications that use GTK as a widget toolkit include:

Desktop environments

Several desktop environments utilize GTK as the widget toolkit.

Current

Inactive

Miscellaneous

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.[40] Other ports include DirectFB (used by the Debian installer, for example) and ncurses.[41]

Window managers

The following window managers use GTK:

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]

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

Linux

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.[42] Finally GTK was re-written to be object-oriented and was renamed GTK+.[43] 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.[44]

macOS

With Quartz-backend[45] GTK is available in macOS.[46]

Windows

  • After GTK 2.24.10 and 3.6.4 Development of Windows with Installer was closed by Gnome. Installation of MSYS2 on Windows is a good way to use actual GTK.[47]
  • GTK 2.24.10 and 3.6.4 is available in Internet, but very buggy and limited against actual versions.[48][49]
  • A version for Windows 64-bit is prepared by Tom Schoonjans with 2.24.33 (actual like Linux) and 3.24.24 (actual like Linux) from January 2021 available.[50]
  • Windows 10's Fall Creators Update includes Windows Subsystem for Linux (WSL). With Linux distributions like Ubuntu or Debian available from the Microsoft Store and an X server like Xming or VcXsvr, thousands of programs like GTK 2 or 3 can run with X or terminal support.

OpenVMS

HP stated that their goal was to merge the needed OpenVMS changes into the GTK Version 1.3 development stream, however this never materialised.[51] The latest version of GTK for OpenVMS is version 1.2.10.[52]

GTK 4

One of the cardinal novelties implemented during the GTK 4 development cycle (i.e. GTK 3.92, etc.) has been the removal of customization options for the user side (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.

  • the event handling from signal handlers described by GtkWidget is delegated to event controllers
  • the rendering is delegated to GtkSnapshot objects
  • the layout mechanism from GtkWidget is delegated to GtkLayoutManager

In January 2018 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.[53]

Releases

More information Release series, Initial release ...


See also


References

  1. "The GTK Open Source Project on Open Hub: Languages Page". www.openhub.net.
  2. Bassi, Emmanuele (6 February 2019). "Project rename to "GTK"". mail.gnome.org. GNOME mailinglist. Retrieved 7 February 2019.
  3. The GTK+ Team. "GTK+ Features". Archived from the original on 25 May 2019. Retrieved 8 September 2014.
  4. "Documentation". www.x.org.
  5. "GTK 4.0 – GTK Development Blog". 16 December 2020. Retrieved 18 October 2021.
  6. "GTK+ 3 Reference Manual". Retrieved 15 July 2017.
  7. "Using GTK+ with Broadway". GNOME Developer. GNOME. Retrieved 6 March 2018.
  8. "Broadway - GitHub symbiose/symbiose Wiki". GitHub. Retrieved 6 March 2018.
  9. "GTK+ to Use Cairo Vector Engine". 5 February 2005. Retrieved 27 December 2009.
  10. "Gtk: Migrating from GTK 2.x to GTK 3". docs.gtk.org. Retrieved 16 June 2022. All drawing in GTK 3 is done via Cairo.
  11. The GTK+ Team. "GTK+ Language Bindings". www.gtk.org. Archived from the original on 25 May 2019. Retrieved 3 June 2017.
  12. "Download Gtk#". The GTK+ Project. Archived from the original on 14 December 2013. Retrieved 23 December 2014.
  13. "'Bansheegeddon' may see Banshee, Mono dropped from Ubuntu default". ITWorld. Archived from the original on 10 July 2015. Retrieved 31 August 2015.
  14. "GNOME Quick SWOT Analysis". The GNOME Project. Retrieved 18 March 2014.
  15. "GTK+ and GNOME Mailing Lists". The GNOME Project. Retrieved 4 December 2011.
  16. "About". GNOME Users And Developers European Conference (GUADEC). Archived from the original on 4 October 2011. Retrieved 3 December 2011.
  17. "GNOME Languages". Ohloh. Black Duck Software. Retrieved 22 May 2014.
  18. "Versioning and long term stability promise in GTK". GTK development blog. 1 September 2016.
  19. "GTK 4.0". GTK development blog. 16 December 2020.
  20. "How Does One Create A Gtk+ Application? – Morten Welinder". blogs.gnome.org. 23 June 2014. Retrieved 3 June 2017.
  21. mclasen (20 November 2015). "A GTK+ update". Goings on.
  22. Larabel, Michael (12 January 2014). "The Biggest Problem With GTK & What Qt Does Good". Phoronix. Retrieved 10 September 2014.
  23. Hong Jen Yee (26 March 2013). "PCManFM Qt 0.1.0 released". Retrieved 10 September 2014.
  24. "Audacious - An Advanced Audio Player". audacious-media-player.org.
  25. Lindgren, John (6 May 2014). "Ugly window decorations and how to fix them (GTK 3.12)". Retrieved 21 October 2014.
  26. Gerald Combs (15 October 2013). "We're switching to Qt". Retrieved 19 August 2015.
  27. "GTK+". WxWidgets Compared To Other Toolkits.
  28. "GTK+ TTY Port". Slashdot. 26 August 2003. Retrieved 31 August 2010.
  29. "LinuxWorld - Where did Spencer Kimball and Peter Mattis go?". Archived from the original on 17 April 1999. Retrieved 19 August 2013.
  30. "What is the + in GTK+?". 2011. Archived from the original on 26 March 2012. Retrieved 18 March 2014.
  31. "GTK+ for Windows Runtime Environment". SourceForge. 15 September 2017.
  32. "GTK+". www.tarnyko.net.
  33. Amundson, Shawn T. (13 April 1998). "ANNOUNCE: GTK+ 1.0.0 Released!". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  34. Amundson, Shawn T. (25 February 1999). "ANNOUNCE: GTK+ and GLib 1.2.0 Released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  35. Taylor, Owen (11 March 2002). "GTK+-2.0.0 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  36. Taylor, Owen (22 December 2002). "GTK+-2.2.0 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  37. Taylor, Owen (16 March 2004). "GTK+-2.4.0 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  38. Clasen, Matthias (16 December 2004). "GTK+-2.6.0 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  39. Clasen, Matthias (13 August 2005). "GTK+ 2.8.0 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  40. Clasen, Matthias (3 July 2006). "GTK+ 2.10 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  41. Clasen, Matthias (14 September 2007). "GTK+ 2.12 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  42. Clasen, Matthias (4 September 2008). "GTK+ 2.14.0 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  43. Clasen, Matthias (13 March 2009). "GTK+ 2.16.0 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  44. Clasen, Matthias (23 September 2009). "GTK+ 2.18.0 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  45. Clasen, Matthias (23 March 2010). "GTK+ 2.20.0 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  46. Clasen, Matthias (23 September 2010). "GTK+ 2.22.0 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  47. Clasen, Matthias (20 January 2011). "GTK+ 2.24.0". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  48. "Tags · GNOME / gtk · GitLab". GitLab. 21 December 2020. Retrieved 18 October 2023.
  49. Clasen, Matthias (10 February 2011). "GTK+ 3.0.0 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  50. "Gtk+ 3.0 Theming API Hackfest". Silicon Island. Retrieved 3 June 2017.
  51. "Gtk+ 3 roadmap draft". Retrieved 3 June 2017.
  52. Clasen, Matthias (25 September 2011). "GTK+ 3.2.0". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  53. Clasen, Matthias (26 March 2012). "GTK+ 3.4.0 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  54. Clasen, Matthias (24 September 2012). "GTK+ 3.6.0 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  55. Clasen, Matthias (25 March 2013). "GTK+ 3.8.0 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  56. Clasen, Matthias (23 September 2013). "GTK+ 3.10.0 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  57. Clasen, Matthias (25 March 2014). "GTK+ 3.12 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  58. Clasen, Matthias (22 September 2014). "GTK+ 3.14.0 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  59. Matthias Clasen (15 May 2014). "GtkInspector Author's blog entry". Retrieved 17 May 2014.
  60. "GtkInspector in GNOME wiki". 15 May 2014. Retrieved 17 May 2014.
  61. "Merging gestures into 3.14". 23 May 2014. Retrieved 23 May 2014.
  62. "RFC: gestures". 4 March 2014. Retrieved 23 May 2014.
  63. "gtk+ 3.13.2". 27 May 2014.
  64. "gtk+ 3.13.3". 24 June 2014.
  65. Clasen, Matthias (22 March 2015). "GTK+ 3.16.0 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  66. online, heise (25 March 2015). "Linux-Desktop: Neues Gnome zeigt Nachrichten oben". heise online. Retrieved 3 June 2017.
  67. "GTK+ 3.16.0 released". mail.gnome.org. Retrieved 3 June 2017.
  68. Nestor, Marius (24 September 2015). "GTK+ 3.18.0 Officially Released as Part of the GNOME 3.18 Desktop Environment". Softpedia. Retrieved 25 May 2019.
  69. Clasen, Matthias (21 March 2016). "GTK+ 3.20". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  70. Clasen, Matthias (21 September 2016). "GTK+ 3.22 released". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  71. Clasen, Matthias (3 September 2018). "gtk+ 3.24.0". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  72. Clasen, Matthias (31 March 2017). "gtk+ 3.90.0". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  73. Clasen, Matthias (18 October 2017). "gtk+ 3.92.1". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  74. Clasen, Matthias (23 October 2017). "GTK+ 3.92". GTK Development Blog. Retrieved 25 May 2019.
  75. "GNOME 3.26 Released". 13 September 2017.
  76. Clasen, Matthias (26 June 2018). "gtk+ 3.94.0". GNOME Mail Services (Mailing list). Retrieved 20 May 2019.
  77. Clasen, Matthias (7 May 2019). "gtk 3.96". GNOME Mail Services (Mailing list). Retrieved 28 May 2019.
  78. Clasen, Matthias (13 February 2020). "GTK 3.98". GTK+ Development Blog. Retrieved 18 February 2020.
  79. Clasen, Matthias (9 June 2021). "gtk 4.3.1". FTP Releases (Mailing list). Retrieved 10 July 2021.
  80. Clasen, Matthias (16 December 2020). "gtk 4.0.0". GNOME Mail Services (Mailing list). Retrieved 16 December 2020.
  81. Clasen, Matthias (30 March 2021). "gtk 4.2.0". GNOME Mail Services (Mailing list). Retrieved 30 March 2021.
  82. Clasen, Matthias (23 August 2021). "gtk 4.4.0". GNOME Mail Services (Mailing list). Retrieved 23 January 2022.
  83. Clasen, Matthias (30 December 2021). "gtk 4.6.0". FTP Releases (Mailing list). Retrieved 23 January 2022.
  84. Clasen, Matthias (6 September 2022), gtk 4.8.0, retrieved 11 January 2023
  85. "NEWS · 4.10.1 · GNOME / gtk · GitLab". GitLab. 13 March 2023. Retrieved 19 April 2023.

Bibliography


Share this article:

This article uses material from the Wikipedia article GTK, and is written by contributors. Text is available under a CC BY-SA 4.0 International License; additional terms may apply. Images, videos and audio are available under their respective licenses.