Professional Documents
Culture Documents
GTK redirects here. For other uses, see GTK (disam- works on other platforms, including Microsoft Windows
biguation).
(interfaced with the Windows API), and Mac OS X (interfaced with Quartz). There is also an HTML5 back-end
GTK+ (formerly GIMP Toolkit) is a cross-platform called Broadway.
widget toolkit for creating graphical user interfaces.[2] 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, along with Qt.[3]
GTK+ can be congured to change the look of the widgets drawn; this is done using dierent 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 the majority of its
graphical control elements.[4] Since GTK+ version 3.0,
all the rendering is done using Cairo.
Software architecture
GTK+
Pango
GDK ATK
Cairo
GIO
GLib
GDK
SceneGraphs
up to GTK+ 3.90:
clutter-gtk:
((Clutter 1.22.4, GTK+ 3.6)
Clutter's SceneGraph
There was a presentation at the 2014 Developer Experience Hackfest regarding a new scene graph for GTK+
aimed at being merged into GTK+ 3.16.[7] Then GSK
was planned to be ready and fully integrated into GTK+
version 3.20, to be released in March 2016. This was
postponed to 3.22.[8] And then again it was postponed to
3.90.
GSK
(GTK+ SceneGraph Kit)
X11
Wayland
Rendering
Cairo
Broadway
Quartz
GDI
(HTTP)
(OS X)
(Win32)
GLib
DEVELOPMENT
cilitates a slightly better control of the graphics pipeline; a WYSIWYG manner. The description of the user inOpenGL is well suited for compositing textured data but terface is independent from the programming language
totally unsuited for drawing.[9]
being used.
Before the adoption of GSK, application developers could
optionally use Clutter. The way widgets were drawn in
GTK+, was, that a draw function drew everything. There 1.5 Language bindings
was no way to know, what has just been drawn. To know
where the mouse pointer was currently hovering over, the Main article: List of language bindings for GTK+
current position had to be computed.
With GSK, it should be fairly easy to write complex A library written in one programming language may be
GTK+
graphical control elements (widgets) and still track eas- used in another language if bindings are written;
[15]
has
a
range
of
bindings
for
various
languages.
ily the whereabout of the mouse pointer. Getting more
conformation with CSS should also arrive.
The latest information about the status of GSK is from 1.5.1 Gtk#
GUADEC 2016.[10]
Gtk# is a set of .NET bindings for the GTK+ GUI toolkit
and assorted GNOME libraries. The library facilitates
1.2 GTK+ input system
building graphical GNOME applications using Mono or
any other compliant CLR. Gtk# is an event-driven sysThe GTK+ input system is basically the X input sys- tem like any other modern windowing library where every
tem. To handle anything more complicated than a simple widget allows you to associate handler methods, which get
mouse button press, e.g. a double click or a long button called when particular events happen.
press, the developer is required to track time and add a
Applications built using Gtk# will run on many plattime out somewhere.
forms including Linux, Windows and OS X. The Mono
packages for Windows include GTK+, Gtk# and a native
theme to make applications look like native Windows ap1.3 GtkInspector
plications. Starting with Mono 1.9, running Gtk# appliGtkInspector has been introduced with version cations on Mac OS X no longer requires the user to run
[18]
3.14.[11][12] GtkInspector can only be invoked after the X11 server.
installing the development package libgtk-3-dev/gtk+- Glade can be used with the Glade# bindings to easily dedevel.
sign GUI applications. A GUI designer called Stetic is
integrated with the MonoDevelop IDE.
1.4
GUI designers
2 Development
Applications
2.1
Criticisms
Media Application
3D Application
Cairo (Xr)
EFL
SDL
libwayland-client
libwayland-client
libwayland-client
evdev
Linux kernel,
? kdbus ?
unetwork
NetworkManager
packagekitd
libxserver
X-Server
window
manager
X.Org
Xfree86
X-Win32
X11.app
metacity
mutter
KWin
Compiz
kmod-fs-ext4
netlter
udisks
systemd
GObject
Glib
GModule
GThread
GIO
PulseAudio-d
libinput
glibc
Clibc
(contains udev)
libwayland-server
GLib
Android
libwayland-client
libX/libXCB
System daemons:
Wayland Compositor
GNUstep
wxWidgets
FLTK
...
libwayland / COGL
System libraries:
Widgets for
Unity and Plasma
Ubuntu
Qt
avahi-daemon
Display server:
GTK+
Pango
ATK
Clutter
D-Bus-Daemon
Enlight. DR19
Cairo-Dock
Plasma 2
2D Application
possibly adaptations to Wayland/Mir
Unity
Desktop widgets
Desktop Shells:
Cinnamon
GNOME Shell
3.1
Hardware
ath9k
UMTS/CDMA/LTE
GPS-receiver
G-sensor
libmir-serv
mir
mir
SF
window
manager
SurfaceFlinger
Compiz
SELinux
TOMOYO
Smack
AppArmor
Ethernet
802.11-(abc)
Bluetooth
libhybris
window
manager
AWM
libbionic
Linux kernel
(Android-forked)
3
3.1
Uses
Applications
Chromium Web browser (Until version 34, replaced by Aura in version 35+)
Ekiga (formerly GnomeMeeting) VoIP and video
conferencing application
EXAMPLE
3.2
Desktop environments
Consortium
Marco
Metacity
IceWM
Mun
Mutter
Sawsh
Xfwm
Wmg
4 Example
5
world!"); /* Plot the label onto the main window */
gtk_container_add(GTK_CONTAINER(window),
label); /* Make sure that everything, window and label,
are visible */ gtk_widget_show_all(window); /* **
Start the main loop, and do nothing (block) until ** the
application is closed */ gtk_main(); return 0; }
Needs installing the libraries rst in debian or derivatives:
$ sudo apt-get install libgtk-3-dev
Using pkg-cong in a Unix shell, this code can be compiled with the following command (assume above source
has le name helloworld.c):
$ cc -Wall helloworld.c -o helloworld $(pkg-cong -cags --libs gtk+3.0)
Invoke the program
$ ./helloworld
History
Ultimate++
Visual Component Library (VCL)
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 called 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 rst 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 UTF8 strings, and a more exible 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.
7 References
[1] The GTK+ Open Source Project on Ohloh. Ohloh.net.
Retrieved 2014-02-17.
[2] The GTK+ Team.
September 2014.
GTK+ Features.
Retrieved 8
5.1
Releases
See also
[10] {{url=https://www.youtube.com/watch?v=
QzJHEpKdefA |title=GTK: are we in the future,
yet? |last=Bassi |First=Emmanuele |date=2016-08-16}}
EXTERNAL LINKS
[14] nothing-personal - A development site for Crow Designer, GuiLoader and Rally - Google Project Hosting.
Retrieved 2014-02-17.
[15] GTK+ Language Bindings
The GNOME
[52] Gtk 5.0 will not be stable until Gtk 5.6. 2016-06-14.
[25]
8 Bibliography
[28] Hong Jen Yee (2013-03-26). PCManFM Qt 0.1.0 released. Retrieved 2014-09-10.
Logan, Syd (September 6, 2001), Gtk+ Programming in C (1st ed.), Prentice Hall, ISBN 978-0-13014264-1
9 External links
Ocial website
[34] LinuxWorld - Where did Spencer Kimball and Peter Mattis go? at the Wayback Machine (archived April 17, 1999)
10
10.1
10.2
Images
10
10.3
Content license