词条 | GTK | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
释义 |
| name = GTK | title = | logo = GTK logo.svg | screenshot = Gtk3-widget-factory-3.16.0.png | caption = The [https://developer.gnome.org/gtk3/stable/gtk3-widget-factory.html gtk3-widget-factory] is a collection of examples demonstrating many of the GUI widgets in GTK version 3 | author = Spencer Kimball, Peter Mattis | developer = The GNOME Project, eXperimental Computing Facility (XCF) | released = {{Start date and age|1998|04|14}} | programming language = C, CSS[1] | operating system = Linux, Unix-like, macOS, Windows | platform = | genre = Widget toolkit | license = LGPL version 2.1+ | website = {{URL|https://gtk.org}} }}GTK (formerly GTK+[2], GIMP Toolkit) is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs).[3] It is licensed under the terms of the GNU Lesser General Public License, allowing both free and proprietary software to use it. Along with Qt, it is one of the most popular toolkits for the Wayland and X11 windowing systems.[4] Software architectureThe GTK library contains a set of graphical control elements (widgets), version 3.22.16 contains 186 active and 36 deprecated widgets.[5] 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[6][7]. 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.[8] Since GTK version 3.0, all the rendering is done using Cairo.{{citation needed|date=March 2015}} On 2018-Jan-26 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.[9] In February it was announced that GTK 4 will drop the “+” from the project's name.[2] {{Anchor|GDK}} GIMP Drawing Kit (GDK){{Main|GDK}}GDK acts as a wrapper around the low-level functions provided by the underlying windowing and graphics systems. GDK is found in the {{Anchor|GSK}} 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. GSK is found in the GtkInspectorGtkInspector was introduced with version 3.14.[10][11] GtkInspector can only be invoked after installing the development package [https://packages.debian.org/search?arch=amd64&keywords=libgtk-3-dev libgtk-3-dev]/[https://apps.fedoraproject.org/packages/gtk+-devel gtk+-devel]. GUI designersThere are several GUI designers for GTK. The following projects are active as of July 2011:
GtkBuilderGtkBuilder 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{{Main article|List of language bindings for GTK+}}A library written in one programming language may be used in another language if bindings are written; GTK has a range of bindings for various languages.[14] Gtk#{{Infobox software| name = Gtk# | logo = Gtk Sharp Logo.png | developer = Xamarin | released = {{Start date and age|2004|03|12}} | latest release version = 2.12.41[15] | latest release date = {{Start date and age|2016|09|22}} | latest preview version = 2.99.3[16] | latest preview date = {{Start date and age|2014|06|06}} | programming language = C#, XML, Perl, C | operating system = Windows, macOS, Linux | genre = Widget toolkit | license = GNU Lesser General Public License | website = {{URL|mono-project.com/GtkSharp}} }} 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.[17] 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. GtkSourceView{{Main|GtkSourceView}}For syntax highlighting there is GtkSourceView, "source code editing widget". GtkSourceView is maintained separately from GTK as a library: [https://git.gnome.org/browse/gtksourceview/tree/ gtksourceview]. There are plans to rename to gsv. GtkSpellGtkSpell is a distinct library separate to 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.
DevelopmentGTK is mainly developed by The GNOME Project, which also develops the GNOME Development Platform and the GNOME Desktop Environment.[18] GTK development is loosely managed. Discussion chiefly occurs on several public mailing lists.[19] 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.[20] GNOME incorporates standards and programs from freedesktop.org to better interoperate with other desktops. GTK is mainly written in C.[21] 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.[22] GTK version 3.22 from autumn 2016 shall be the last 3.x release. After that all resources will move to the GTK 4 development series with the version names 3.90, 3.92, etc. Even as the 4.x series enters development, notable applications still use GTK 2.x and have not been ported to 3.22. Regarding the future of legacy software using GTK+, there is no collective project to port GTK 2.x software to 3.22. Build automationIn former times GTK (and GNOME, GLib, etc.) utilized the GNU Build System (named Autotools) as the build automation system of choice. Since 14 Aug 2017, the master branch of GTK builds with Meson, and the Autotools build system files have been dropped.[23] CriticismsThe most common criticism of GTK is a lack of backward-compatibility in major updates, most notably in the application programming interface (API)[24] and theming.[25] 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.[27] 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.
UseApplications{{Main article|List of GTK+ applications|:Category:Software that uses GTK}}Some notable applications that use or once used GTK as a widget toolkit include:
Desktop environments{{Main article|:Category:Desktop environments based on GTK|l1=Desktop environments based on GTK}}Several desktop environments utilize GTK as the widget toolkit. Current
Inactive
MiscellaneousGTK 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.[32] Other ports include DirectFB (used by the Debian installer, for example) and ncurses.[33] Window managersThe following window managers use GTK: {{Div col|colwidth=30em}}
ExampleDocumentation is available here:
The 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. Needs installing the libraries first in debian or derivatives:
Using pkg-config in a Unix shell, this code can be compiled with the following command:
Invoke the program
HistoryLinux/UnixGTK 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.[34] Finally GTK was re-written to be object-oriented and was renamed GTK+.[35] 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[36] macOSWith Quartz-Backend[37] GTK is available in macOS.[38] Windows
OpenVMSHP stated that their goal was to merge the needed OpenVMS changes into the GTK Version 1.3 development stream[43], however this never materialised. The latest version of GTK for OpenVMS is version 1.2.10.[44]Releases
The GNOME team releases new versions on a regular basis.[64] See also{{Portal|Free and open-source software}}
References1. ^[https://www.openhub.net/p/gtk/analyses/latest/languages_summary The GTK+ Open Source Project on Open Hub: Languages Page] 2. ^1 {{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|archive-url=|archive-date=|dead-url=|access-date=2019-02-07}} 3. ^{{cite web |url=https://www.gtk.org/features.php |title=GTK+ Features |author=The GTK+ Team |access-date=8 September 2014}} 4. ^{{cite web |url=http://www.x.org/wiki/Documentation |title=Developing X applications}} 5. ^{{cite web |title=GTK+ 3 Reference Manual |url=https://developer.gnome.org/gtk3/stable/ |access-date=2017-07-15}} 6. ^{{cite web |url=https://developer.gnome.org/gtk3/stable/gtk-broadway.html |title=Using GTK+ with Broadway |website=GNOME Developer|publisher=GNOME |access-date=6 March 2018}} 7. ^{{cite web|title=Broadway - GitHub symbiose/symbiose Wiki|url=https://github.com/symbiose/symbiose/wiki/Broadway|website=GitHub|access-date=6 March 2018}} 8. ^{{cite web |url=http://developers.slashdot.org/article.pl?sid=05/02/04/2021236 |title=GTK+ to Use Cairo Vector Engine |access-date=2009-12-27}} 9. ^{{cite web |url=https://mclasen.fedorapeople.org/gtk4-devconf2018.pdf |title=Matthias Clasen DevConf.cz 2018 talk about GTK+ 4 |date=2018-01-26}} 10. ^{{cite web |url=http://blogs.gnome.org/mclasen/2014/05/15/introducing-gtkinspector/ |title=Introducing GtkInspector |date=2014-05-15}} 11. ^{{cite web |url=http://blogs.gnome.org/mclasen/2014/07/11/another-gtkinspector-update/ |title=Another GtkInspector update |date=2014-07-11}} 12. ^{{cite web |url=https://packages.debian.org/gazpacho |title=Gazpacho in Debian}} 13. ^{{cite web |url=http://nothing-personal.googlecode.com/ |title=Nothing-personal - A development site for Crow Designer, GuiLoader and Rally - Google Project Hosting |access-date=2014-02-17}} 14. ^{{cite web |url=https://www.gtk.org/language-bindings.php |title=GTK+ Language Bindings |author=The GTK+ Team |website=www.gtk.org |access-date=3 June 2017}} 15. ^{{cite web |url=https://github.com/mono/gtk-sharp/releases/tag/2.12.41 |title=Release 2.12.41}} 16. ^{{cite web |url=https://github.com/mono/gtk-sharp/releases/tag/2.99.3 |title=Release 2.99.3}} 17. ^{{cite web |url=http://download.xamarin.com/GTKforWindows/Windows/gtk-sharp-2.12.22.msi |title=Download Gtk# |publisher=The GTK+ Project}} 18. ^{{cite web |url=https://wiki.gnome.org/Engagement/SWOT |title=GNOME Quick SWOT Analysis |website=The GNOME Project |access-date=March 18, 2014}} 19. ^{{cite web |url=http://mail.gnome.org |title=GTK+ and GNOME Mailing Lists |publisher=The GNOME Project |access-date=December 4, 2011}} 20. ^{{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 |dead-url=yes |archive-url=https://web.archive.org/web/20111004061840/http://guadec.expectnation.com/public/content/about |archive-date=October 4, 2011 |df=}} 21. ^{{cite web |url=http://www.ohloh.net/p/gnome/analyses/latest/languages_summary |title=GNOME Languages |website=Ohloh |publisher=Black Duck Software |access-date=May 22, 2014}} 22. ^1 {{cite web |url=https://blog.gtk.org/2016/09/01/versioning-and-long-term-stability-promise-in-gtk/ |title=Versioning and long term stability promise in GTK |date=2016-09-01 |publisher=GTK development blog}} 23. ^{{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}} 24. ^{{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 |access-date=3 June 2017}} 25. ^{{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}} 26. ^{{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}} 27. ^{{cite web |title=“The future of Razor and LXDE-Qt” |url=https://blog.lxde.org/2013/07/22/the-future-of-razor-and-lxde-qt/ |website=LXDE Blog |date=22 July 2013}} 28. ^{{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}} 29. ^{{cite web |url=http://www.webupd8.org/2014/06/audacious-going-back-to-gtk2-starting.html |title=Audacious Going Back To GTK2 Starting With Version 3.6 |author=Web Upd8 |date=2014-06-23 |access-date=2014-10-21}} 30. ^{{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}} 31. ^{{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}} 32. ^{{cite web |url=http://www.wxwidgets.org/wiki/index.php/WxWidgets_Compared_To_Other_Toolkits#GTK.2B |work=WxWidgets Compared To Other Toolkits |title=GTK+}} 33. ^{{cite web|url=http://slashdot.org/article.pl?sid=03/08/26/2042206 |title=GTK+ TTY Port |publisher=Slashdot |date= |access-date=2010-08-31}} 34. ^{{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 |dead-url=bot: unknown |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 |df=}} 35. ^{{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}} 36. ^https://gitlab.gnome.org/GNOME/gtk/commit/d080be3e5091c98d5171063a95d55c01170881f3 37. ^https://wiki.gnome.org/Projects/GTK+/OSX 38. ^https://www.gtk.org/download/macos.php 39. ^https://www.gtk.org/download/windows.php 40. ^https://sourceforge.net/projects/gtk-win/ 41. ^http://www.tarnyko.net/dl/gtk.htm 42. ^https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer 43. ^http://h41379.www4.hpe.com/openvms/products/ips/gtk.html 44. ^http://h41379.www4.hpe.com/openvms/products/ips/gtk_down.html 45. ^{{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=3 June 2017}} 46. ^{{cite web|url=http://testbit.eu/~timj/blogstuff/GtkRoadmap3Draft2.html|title=Gtk+ 3 roadmap draft|publisher=|access-date=3 June 2017}} 47. ^{{cite web |url=https://wiki.gnome.org/Attic/ProjectRidley |title=Project Ridley}} 48. ^{{cite web |url=https://developer.gnome.org/gdk3/stable/GdkFrameClock.html |title=GdkFrameClock}} 49. ^{{cite web |url=https://blogs.gnome.org/mclasen/2013/12/05/client-side-decorations-in-themes/ |title=GTK 3.12 introduced client-side decorations}} 50. ^{{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}} 51. ^{{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}} 52. ^{{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}} 53. ^{{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}} 54. ^{{cite web |url=https://mail.gnome.org/archives/ftp-release-list/2014-May/msg00119.html |title=gtk+ 3.13.2 |date=2014-05-27}} 55. ^{{cite web |url=https://mail.gnome.org/archives/ftp-release-list/2014-June/msg00075.html |title=gtk+ 3.13.3 |date=2014-06-24}} 56. ^{{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|access-date=3 June 2017}} 57. ^{{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=3 June 2017}} 58. ^{{cite web |url=https://wiki.gnome.org/Projects/GTK%2B/StyleClasses |title=GTK+ 3.20 – Style Classes and Element Names |date=2015-11-20}} 59. ^{{cite web |url=https://blogs.gnome.org/carlosg/2016/04/06/gtk-wayland-tablet-support-is-merged/ |title=GTK+ Wayland tablet support merged}} 60. ^{{cite web |url=https://www.x.org/wiki/Events/XDC2016/Program/hutterer_input/ |title=libinput as of September 2016}} 61. ^1 {{cite web |url=http://videos.guadec.org/2013/GTK%20to%20infinity%20and%20beyond/ |title=GUADEC2013: Benjamin Otte talks about GTK+ |publisher=GUADEC}} 62. ^1 {{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}} 63. ^1 {{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}} 64. ^1 {{cite web |url=https://wiki.gnome.org/Projects/GTK+/Roadmap |title=GNOME Wiki: roadmap for GTK+}} 65. ^{{cite web |url=https://git.gnome.org/browse/gtk+/log/gsk/gskvulkanrenderer.c |title=gskvulkanrenderer.c}} 66. ^{{cite web |url=https://www.gnome.org/news/2017/09/gnome-3-26-released/ |title=GNOME 3.26 Released |date=2017-09-13}} 67. ^{{cite web |url=https://mail.gnome.org/archives/ftp-release-list/2018-June/msg00073.html |title=gtk+ 3.94.0 released |date=2018-06-26}} 68. ^{{cite web |url=https://blog.gtk.org/2018/07/12/a-report-from-the-guadec-gtk-bof/ |title=A report from the Guadec GTK+ BoF |last=Clasen |first=Matthias |date=12 July 2018 |website=GTK+ Development Blog |access-date=21 Feb 2019}} Bibliography{{Refbegin}}
| last = Krause | first = Andrew | title = Foundations of GTK+ Development | date = April 23, 2007 | url = http://www.apress.com/9781590597934 | edition = 1st | publisher = Apress | isbn = 978-1-59059-793-4 }}
| last = Wright | first = Peter | title = Beginning GTK+ and GNOME | date = May 15, 2000 | edition = 1st | publisher = Peer Information | isbn = 978-1-86100-381-2 }}
| 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 }}{{Refend}} External links{{Commons category|GTK}}{{Wikibooks|X Window Programming|GTK+}}
13 : GTK|Application programming interfaces|Articles with example C code|C libraries|Cross-platform software|Free computer libraries|Free software programmed in C|GNOME|Software that uses Cairo|Software using the LGPL license|Widget toolkits|X-based libraries|Software that uses Meson |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。