forked from AuroraMiddleware/gtk
docs: Drop the '+' from GTK
We need to adapt to both the change in the name of the project, and to the name change in the pkg-config file.
This commit is contained in:
parent
1aeeefdccb
commit
0f24fddaf7
@ -1,8 +1,8 @@
|
||||
GTK+ Coding Style
|
||||
GTK Coding Style
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
This document is intended to be a short description of the preferred
|
||||
coding style to be used for the GTK+ source code. It was strongly
|
||||
coding style to be used for the GTK source code. It was strongly
|
||||
inspired by Clutter's CODING_STYLE.
|
||||
|
||||
Coding style is a matter of consistency, readability and maintainance;
|
||||
@ -12,7 +12,7 @@ and consistent answers to common questions regarding the coding style,
|
||||
and will also try to identify the allowed exceptions.
|
||||
|
||||
The examples will show the preferred coding style; the negative examples
|
||||
will be clearly identified. Please, don't submit code to GTK+ that
|
||||
will be clearly identified. Please, don't submit code to GTK that
|
||||
looks like any of these.
|
||||
|
||||
Part of the rationales for these coding style rules are available either
|
||||
@ -38,10 +38,10 @@ using tab characters alone, or using a combination of spaces and tabs.
|
||||
|
||||
Do not change the editor's configuration to change the meaning of a
|
||||
tab character (see below); code using tabs to indent will not be accepted
|
||||
into GTK+.
|
||||
into GTK.
|
||||
|
||||
Even if two spaces for each indentation level allows deeper nesting than
|
||||
8 spaces, GTK+ favours self-documenting function names that can take
|
||||
8 spaces, GTK favours self-documenting function names that can take
|
||||
quite some space. For this reason you should avoid deeply nested code.
|
||||
|
||||
+ Tab characters
|
||||
@ -399,7 +399,7 @@ patch or commit. Never use empty lines at the beginning or at the end of
|
||||
a file.
|
||||
|
||||
Do enable the default git pre-commit hook that detect trailing
|
||||
whitespace for you and help you to avoid corrupting GTK+'s tree with
|
||||
whitespace for you and help you to avoid corrupting GTK's tree with
|
||||
it. Do that as follows:
|
||||
|
||||
chmod a+x .git/hooks/pre-commit
|
||||
@ -410,7 +410,7 @@ duplicate blank lines.
|
||||
|
||||
+ Headers
|
||||
|
||||
Headers are special, for GTK+, in that they don't have to obey the
|
||||
Headers are special, for GTK, in that they don't have to obey the
|
||||
80 characters limit. The only major rule for headers is that the function
|
||||
definitions should be vertically aligned in three columns:
|
||||
|
||||
@ -479,7 +479,7 @@ Additionally, public headers should use C++ guards around their declarations:
|
||||
|
||||
+ Includes
|
||||
|
||||
GTK+ source files must never include the global gtk.h header; instead, it
|
||||
GTK source files must never include the global gtk.h header; instead, it
|
||||
should include the individual headers that are needed.
|
||||
|
||||
Every source file must include config.h first, followed by the header matching
|
||||
@ -658,7 +658,7 @@ after the license header:
|
||||
* @Short_Description: Height-for-width geometry management
|
||||
* @Title: GtkSizeRequest
|
||||
*
|
||||
* The GtkSizeRequest interface is GTK+'s height-for-width (and
|
||||
* The GtkSizeRequest interface is GTK's height-for-width (and
|
||||
* width-for-height) geometry management system.
|
||||
* ...
|
||||
*/
|
||||
@ -672,8 +672,8 @@ get_type function needs to listed in gtk3.types.
|
||||
|
||||
+ Old code
|
||||
|
||||
New code that is being added to GTK+ should adhere to the style
|
||||
explained above. Existing GTK+ code does largely follow these
|
||||
New code that is being added to GTK should adhere to the style
|
||||
explained above. Existing GTK code does largely follow these
|
||||
conventions, but there are some differences, e.g. occurrences
|
||||
of tabs, etc.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
How to do a GTK+ release?
|
||||
=========================
|
||||
How to do a GTK release?
|
||||
========================
|
||||
|
||||
## Before we begin
|
||||
|
||||
@ -91,7 +91,7 @@ $ ninja -C _build gtk40-properties-pot
|
||||
12. Tag the release. The git command for doing that looks like:
|
||||
|
||||
```sh
|
||||
$ git tag -m "GTK+ 4.2.0" 4.2.0
|
||||
$ git tag -m "GTK 4.2.0" 4.2.0
|
||||
```
|
||||
|
||||
13. Bump the version number in `meson.build` and commit the change.
|
||||
@ -110,8 +110,8 @@ $ git push origin 4.2.0
|
||||
this looks like:
|
||||
|
||||
```sh
|
||||
$ scp gtk+-4.2.0.tar.xz matthiasc@master.gnome.org:
|
||||
$ ssh matthiasc@master.gnome.org ftpadmin install gtk+-4.2.0.tar.xz
|
||||
$ scp gtk-4.2.0.tar.xz matthiasc@master.gnome.org:
|
||||
$ ssh matthiasc@master.gnome.org ftpadmin install gtk-4.2.0.tar.xz
|
||||
```
|
||||
|
||||
16. Go to the gnome-announce list archives, find the last announce message,
|
||||
|
@ -1,5 +1,5 @@
|
||||
Things to care about when using/programing for GTK+
|
||||
===================================================
|
||||
Things to care about when using/programing for GTK
|
||||
==================================================
|
||||
|
||||
This file is meant to collect some frequently triggered failures when
|
||||
programming for/with Gtk, having the spirit of a developers FAQ.
|
||||
|
@ -57,7 +57,7 @@ The GDK API
|
||||
===========
|
||||
|
||||
It is expect that the GDK DND API will never be
|
||||
used by anything other than the DND code in GTK+.
|
||||
used by anything other than the DND code in GTK.
|
||||
|
||||
/* Drag and Drop */
|
||||
|
||||
@ -159,7 +159,7 @@ the taskbar.
|
||||
Internally, when the outer drag enters a proxy dest site, a
|
||||
new source drag is created, with SourceInfo and
|
||||
GdkDragContext. From the GDK side, it looks much like a
|
||||
normal source drag; on the GTK+ side, most of the code is
|
||||
normal source drag; on the GTK side, most of the code is
|
||||
disjoint. The need to pass in a specific target window
|
||||
is the reason why the GDK DND API splits
|
||||
gdk_drag_find_window() and gdk_drag_motion().
|
||||
|
@ -1,4 +1,4 @@
|
||||
Information about the icon theme cache format used by GTK+
|
||||
Information about the icon theme cache format used by GTK
|
||||
for more information, see the mailing list threads at
|
||||
|
||||
http://mail.gnome.org/archives/gtk-devel-list/2004-April/msg00065.html
|
||||
@ -30,7 +30,7 @@ We would like to propose the cache file format as an appendix to the
|
||||
icon theme specification. One thing which still needs to be investigated
|
||||
is caching of the actual image data; the file format is has an
|
||||
IMAGE_DATA_OFFSET member to allow adding that compatibly. An
|
||||
implementation of the caching scheme for GTK+ can be found at [2]. The
|
||||
implementation of the caching scheme for GTK can be found at [2]. The
|
||||
cache generator which is included in the patch depends only on glib, and
|
||||
it may be a good idea to move it to freedesktop.org as well.
|
||||
|
||||
|
@ -4,23 +4,23 @@
|
||||
]>
|
||||
<refentry id="gtk-broadway">
|
||||
<refmeta>
|
||||
<refentrytitle>Using GTK+ with Broadway</refentrytitle>
|
||||
<refentrytitle>Using GTK with Broadway</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>Using GTK+ with Broadway</refname>
|
||||
<refname>Using GTK with Broadway</refname>
|
||||
<refpurpose>
|
||||
HTML-specific aspects of using GTK+
|
||||
HTML-specific aspects of using GTK
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1>
|
||||
<title>Using GTK+ with Broadway</title>
|
||||
<title>Using GTK with Broadway</title>
|
||||
|
||||
<para>
|
||||
The GDK Broadway backend provides support for displaying GTK+
|
||||
The GDK Broadway backend provides support for displaying GTK
|
||||
applications in a web browser, using HTML5 and web sockets. To run
|
||||
your application in this way, select the Broadway backend by setting
|
||||
<literal>GDK_BACKEND=broadway</literal>. Then you can make
|
||||
@ -36,9 +36,9 @@ port that you want to use.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
It is also possible to use multiple GTK+ applications in the same
|
||||
It is also possible to use multiple GTK applications in the same
|
||||
web browser window, by using the Broadway server,
|
||||
<command>broadwayd</command>, that ships with GTK+.
|
||||
<command>broadwayd</command>, that ships with GTK.
|
||||
To use broadwayd, start it like this:
|
||||
<programlisting>
|
||||
broadwayd :5
|
||||
|
@ -4,31 +4,31 @@
|
||||
]>
|
||||
<refentry id="gtk-building">
|
||||
<refmeta>
|
||||
<refentrytitle>Compiling the GTK+ libraries</refentrytitle>
|
||||
<refentrytitle>Compiling the GTK libraries</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>Compiling the GTK+ Libraries</refname>
|
||||
<refname>Compiling the GTK Libraries</refname>
|
||||
<refpurpose>
|
||||
How to compile GTK+ itself
|
||||
How to compile GTK itself
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 id="overview">
|
||||
<title>Building GTK+</title>
|
||||
<title>Building GTK</title>
|
||||
<para>
|
||||
Before we get into the details of how to compile GTK+, we should
|
||||
mention that in many cases, binary packages of GTK+ prebuilt for
|
||||
Before we get into the details of how to compile GTK, we should
|
||||
mention that in many cases, binary packages of GTK prebuilt for
|
||||
your operating system will be available, either from your
|
||||
operating system vendor or from independent sources. If such a
|
||||
set of packages is available, installing it will get you
|
||||
programming with GTK+ much faster than building it yourself. In
|
||||
fact, you may well already have GTK+ installed on your system
|
||||
programming with GTK much faster than building it yourself. In
|
||||
fact, you may well already have GTK installed on your system
|
||||
already.
|
||||
</para>
|
||||
<para>
|
||||
In order to build GTK+, you will need <application>meson</application>
|
||||
In order to build GTK, you will need <application>meson</application>
|
||||
installed on your system. On Linux, and other UNIX-like operating
|
||||
systems, you will also need <application>ninja</application>. This
|
||||
guide does not cover how to install these two requirements, but you
|
||||
@ -38,11 +38,11 @@ How to compile GTK+ itself
|
||||
refer to it in the examples.
|
||||
</para>
|
||||
<para>
|
||||
If you are building GTK+ from a source distribution or from a Git
|
||||
If you are building GTK from a source distribution or from a Git
|
||||
clone, you will need to use <application>meson</application> to
|
||||
configure the project. The most commonly useful argument is the
|
||||
<systemitem>--prefix</systemitem> one, which determines where the
|
||||
files will go once installed. To install GTK+ under a prefix
|
||||
files will go once installed. To install GTK under a prefix
|
||||
like <filename>/opt/gtk</filename> you would run Meson as:
|
||||
</para>
|
||||
<informalexample>
|
||||
@ -83,7 +83,7 @@ How to compile GTK+ itself
|
||||
<envar>PKG_CONFIG_PATH</envar> environment variable contains
|
||||
a search path that <command>pkg-config</command> (see below)
|
||||
uses when looking for files describing how to compile
|
||||
programs using different libraries. If you were installing GTK+
|
||||
programs using different libraries. If you were installing GTK
|
||||
and it's dependencies into <filename>/opt/gtk</filename>, you
|
||||
might want to set these variables as:
|
||||
</para>
|
||||
@ -109,26 +109,26 @@ How to compile GTK+ itself
|
||||
<refsect1 id="dependencies">
|
||||
<title>Dependencies</title>
|
||||
<para>
|
||||
Before you can compile the GTK+ widget toolkit, you need to have
|
||||
Before you can compile the GTK widget toolkit, you need to have
|
||||
various other tools and libraries installed on your
|
||||
system. Dependencies of GTK+ have their own build systems, so
|
||||
system. Dependencies of GTK have their own build systems, so
|
||||
you will need to refer to their own installation instructions.
|
||||
</para>
|
||||
<para>
|
||||
A particular important tool used by GTK+ to find its dependencies
|
||||
A particular important tool used by GTK to find its dependencies
|
||||
is <application>pkg-config</application>.
|
||||
</para>
|
||||
<para>
|
||||
<ulink url="https://www.freedesktop.org/wiki/Software/pkg-config/">pkg-config</ulink>
|
||||
is a tool for tracking the compilation flags needed for
|
||||
libraries that are used by the GTK+ libraries. (For each
|
||||
libraries that are used by the GTK libraries. (For each
|
||||
library, a small <literal>.pc</literal> text file is installed
|
||||
in a standard location that contains the compilation flags
|
||||
needed for that library along with version number information.)
|
||||
</para>
|
||||
<para>
|
||||
Some of the libraries that GTK+ depends on are maintained by
|
||||
by the GTK+ team: GLib, GdkPixbuf, Pango, ATK and GObject Introspection.
|
||||
Some of the libraries that GTK depends on are maintained by
|
||||
by the GTK team: GLib, GdkPixbuf, Pango, ATK and GObject Introspection.
|
||||
Other libraries are maintained separately.
|
||||
</para>
|
||||
<itemizedlist>
|
||||
@ -196,7 +196,7 @@ How to compile GTK+ itself
|
||||
<listitem>
|
||||
<para>
|
||||
The libraries from the X window system are needed to build
|
||||
Pango and GTK+. You should already have these installed on
|
||||
Pango and GTK. You should already have these installed on
|
||||
your system, but it's possible that you'll need to install
|
||||
the development environment for these libraries that your
|
||||
operating system vendor provides.
|
||||
@ -213,14 +213,14 @@ How to compile GTK+ itself
|
||||
<para>
|
||||
<ulink url="https://www.cairographics.org">Cairo</ulink>
|
||||
is a graphics library that supports vector graphics and image
|
||||
compositing. Both Pango and GTK+ use Cairo for drawing.
|
||||
compositing. Both Pango and GTK use Cairo for drawing.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<ulink url="https://github.com/anholt/libepoxy">libepoxy</ulink>
|
||||
is a library that abstracts the differences between different
|
||||
OpenGL libraries. GTK+ uses it for cross-platform GL support
|
||||
OpenGL libraries. GTK uses it for cross-platform GL support
|
||||
and for its own drawing.
|
||||
</para>
|
||||
</listitem>
|
||||
@ -228,20 +228,20 @@ How to compile GTK+ itself
|
||||
<para>
|
||||
<ulink url="https://github.com/anholt/libepoxy">Graphene</ulink>
|
||||
is a library that provides vector and matrix types for 2D and
|
||||
3D transformations. GTK+ uses it internally for drawing.
|
||||
3D transformations. GTK uses it internally for drawing.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <ulink url="https://wayland.freedesktop.org">Wayland</ulink> libraries
|
||||
are needed to build GTK+ with the Wayland backend.
|
||||
are needed to build GTK with the Wayland backend.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <ulink url="https://www.freedesktop.org/wiki/Software/shared-mime-info">shared-mime-info</ulink>
|
||||
package is not a hard dependency of GTK+, but it contains definitions
|
||||
for mime types that are used by GIO and, indirectly, by GTK+.
|
||||
package is not a hard dependency of GTK, but it contains definitions
|
||||
for mime types that are used by GIO and, indirectly, by GTK.
|
||||
gdk-pixbuf will use GIO for mime type detection if possible. For this
|
||||
to work, shared-mime-info needs to be installed and
|
||||
<envar>XDG_DATA_DIRS</envar> set accordingly at configure time.
|
||||
@ -251,7 +251,7 @@ How to compile GTK+ itself
|
||||
</itemizedlist>
|
||||
</refsect1>
|
||||
<refsect1 id="building">
|
||||
<title>Building and testing GTK+</title>
|
||||
<title>Building and testing GTK</title>
|
||||
<para>
|
||||
First make sure that you have the necessary external
|
||||
dependencies installed: <command>pkg-config</command>, Meson, Ninja,
|
||||
@ -263,16 +263,16 @@ How to compile GTK+ itself
|
||||
accessible through your operating system package repositories.
|
||||
</para>
|
||||
<para>
|
||||
Then build and install the GTK+ libraries in the order:
|
||||
GLib, Cairo, Pango, ATK, then GTK+. For each library, follow the
|
||||
Then build and install the GTK libraries in the order:
|
||||
GLib, Cairo, Pango, ATK, then GTK. For each library, follow the
|
||||
instructions they provide, and make sure to share common settings
|
||||
between them and the GTK+ build; if you are using a separate prefix
|
||||
for GTK+, for instance, you will need to use the same prefix for all
|
||||
between them and the GTK build; if you are using a separate prefix
|
||||
for GTK, for instance, you will need to use the same prefix for all
|
||||
its dependencies you build. If you're lucky, this will all go smoothly,
|
||||
and you'll be ready to <link linkend="gtk-compiling">start compiling
|
||||
your own GTK+ applications</link>. You can test your GTK+ installation
|
||||
your own GTK applications</link>. You can test your GTK installation
|
||||
by running the <command>gtk4-demo</command> program that
|
||||
GTK+ installs.
|
||||
GTK installs.
|
||||
</para>
|
||||
<para>
|
||||
If one of the projects you're configuring or building fails, look
|
||||
@ -287,7 +287,7 @@ How to compile GTK+ itself
|
||||
<title>Extra Configuration Options</title>
|
||||
|
||||
<para>
|
||||
In addition to the normal options provided by Meson, GTK+ defines
|
||||
In addition to the normal options provided by Meson, GTK defines
|
||||
various arguments that modify what should be built.
|
||||
|
||||
<cmdsynopsis>
|
||||
@ -375,7 +375,7 @@ How to compile GTK+ itself
|
||||
<title><systemitem>xinerama</systemitem></title>
|
||||
|
||||
<para>
|
||||
By default GTK+ will try to link against the Xinerama libraries
|
||||
By default GTK will try to link against the Xinerama libraries
|
||||
if they are found. This options can be used to explicitly control
|
||||
whether Xinerama should be used.
|
||||
</para>
|
||||
@ -388,16 +388,16 @@ How to compile GTK+ itself
|
||||
<para>
|
||||
The <application>gtk-doc</application> package is
|
||||
used to generate the reference documentation included
|
||||
with GTK+. By default support for <application>gtk-doc</application>
|
||||
with GTK. By default support for <application>gtk-doc</application>
|
||||
is disabled because it requires various extra dependencies
|
||||
to be installed. If you have
|
||||
<application>gtk-doc</application> installed and
|
||||
are modifying GTK+, you may want to enable
|
||||
are modifying GTK, you may want to enable
|
||||
<application>gtk-doc</application> support by passing
|
||||
in <systemitem>documentation</systemitem>.
|
||||
</para>
|
||||
<para>
|
||||
Additionally, some tools provided by GTK+ have their own
|
||||
Additionally, some tools provided by GTK have their own
|
||||
manual pages generated using a similar set of dependencies;
|
||||
if you have <application>xsltproc</application> then you
|
||||
can generate manual pages by passing <systemitem>man-pages</systemitem>
|
||||
@ -409,7 +409,7 @@ How to compile GTK+ itself
|
||||
<title><systemitem>print-backends</systemitem></title>
|
||||
|
||||
<para>
|
||||
By default, GTK+ will try to build various print backends if
|
||||
By default, GTK will try to build various print backends if
|
||||
their dependencies are found. This option can be used to
|
||||
explicitly control which print backends should be built.
|
||||
</para>
|
||||
@ -439,7 +439,7 @@ How to compile GTK+ itself
|
||||
<para>
|
||||
Allows to disable building introspection support. This is option
|
||||
is mainly useful for shortening turnaround times on developer
|
||||
systems. Installed builds of GTK+ should always have introspection
|
||||
systems. Installed builds of GTK should always have introspection
|
||||
support.
|
||||
</para>
|
||||
</formalpara>
|
||||
@ -450,9 +450,9 @@ How to compile GTK+ itself
|
||||
<systemitem>demos</systemitem></title>
|
||||
|
||||
<para>
|
||||
By default, GTK+ will build quite a few tests and demos.
|
||||
By default, GTK will build quite a few tests and demos.
|
||||
While these are useful on a developer system, they are not
|
||||
needed when GTK+ is built e.g. for a flatpak runtime. These
|
||||
needed when GTK is built e.g. for a flatpak runtime. These
|
||||
options allow to disable building tests and demos.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
@ -4,24 +4,24 @@
|
||||
]>
|
||||
<refentry id="gtk-compiling">
|
||||
<refmeta>
|
||||
<refentrytitle>Compiling GTK+ Applications</refentrytitle>
|
||||
<refentrytitle>Compiling GTK Applications</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>Compiling GTK+ Applications</refname>
|
||||
<refname>Compiling GTK Applications</refname>
|
||||
<refpurpose>
|
||||
How to compile your GTK+ application
|
||||
How to compile your GTK application
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1>
|
||||
<title>Compiling GTK+ Applications on UNIX</title>
|
||||
<title>Compiling GTK Applications on UNIX</title>
|
||||
|
||||
<para>
|
||||
To compile a GTK+ application, you need to tell the compiler where to
|
||||
find the GTK+ header files and libraries. This is done with the
|
||||
To compile a GTK application, you need to tell the compiler where to
|
||||
find the GTK header files and libraries. This is done with the
|
||||
<literal>pkg-config</literal> utility.
|
||||
</para>
|
||||
<para>
|
||||
@ -29,9 +29,9 @@ The following interactive shell session demonstrates how
|
||||
<literal>pkg-config</literal> is used (the actual output on
|
||||
your system may be different):
|
||||
<programlisting>
|
||||
$ pkg-config --cflags gtk+-4.0
|
||||
$ pkg-config --cflags gtk4
|
||||
-pthread -I/usr/include/gtk-4.0 -I/usr/lib64/gtk-4.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
|
||||
$ pkg-config --libs gtk+-4.0
|
||||
$ pkg-config --libs gtk4
|
||||
-pthread -lgtk-4 -lgdk-4 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
|
||||
</programlisting>
|
||||
</para>
|
||||
@ -40,14 +40,14 @@ The simplest way to compile a program is to use the "backticks"
|
||||
feature of the shell. If you enclose a command in backticks
|
||||
(<emphasis>not single quotes</emphasis>), then its output will be
|
||||
substituted into the command line before execution. So to compile
|
||||
a GTK+ Hello, World, you would type the following:
|
||||
a GTK Hello, World, you would type the following:
|
||||
<programlisting>
|
||||
$ cc `pkg-config --cflags gtk+-4.0` hello.c -o hello `pkg-config --libs gtk+-4.0`
|
||||
$ cc `pkg-config --cflags gtk4` hello.c -o hello `pkg-config --libs gtk4`
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Deprecated GTK+ functions are annotated to make the compiler
|
||||
Deprecated GTK functions are annotated to make the compiler
|
||||
emit warnings when they are used (e.g. with gcc, you need to use
|
||||
the -Wdeprecated-declarations option). If these warnings are
|
||||
problematic, they can be turned off by defining the preprocessor
|
||||
@ -56,26 +56,26 @@ option <literal>-DGDK_DISABLE_DEPRECATION_WARNINGS</literal>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
GTK+ deprecation annotations are versioned; by defining the
|
||||
GTK deprecation annotations are versioned; by defining the
|
||||
macros %GDK_VERSION_MIN_REQUIRED and %GDK_VERSION_MAX_ALLOWED,
|
||||
you can specify the range of GTK+ versions whose API you want
|
||||
you can specify the range of GTK versions whose API you want
|
||||
to use. APIs that were deprecated before or introduced after
|
||||
this range will trigger compiler warnings.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Here is how you would compile hello.c if you want to allow it
|
||||
to use symbols that were not deprecated in 3.2:
|
||||
to use symbols that were not deprecated in 4.2:
|
||||
<programlisting>
|
||||
$ cc `pkg-config --cflags gtk+-4.0` -DGDK_VERSION_MIN_REQIRED=GDK_VERSION_3_2 hello.c -o hello `pkg-config --libs gtk+-4.0`
|
||||
$ cc `pkg-config --cflags gtk4` -DGDK_VERSION_MIN_REQIRED=GDK_VERSION_4_2 hello.c -o hello `pkg-config --libs gtk4`
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
And here is how you would compile hello.c if you don't want
|
||||
it to use any symbols that were introduced after 3.4:
|
||||
it to use any symbols that were introduced after 4.2:
|
||||
<programlisting>
|
||||
$ cc `pkg-config --cflags gtk+-4.0` -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4 hello.c -o hello `pkg-config --libs gtk+-4.0`
|
||||
$ cc `pkg-config --cflags gtk4` -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_4_2 hello.c -o hello `pkg-config --libs gtk4`
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
|
@ -4,15 +4,15 @@
|
||||
]>
|
||||
<refentry id="chap-css-overview">
|
||||
<refmeta>
|
||||
<refentrytitle>GTK+ CSS Overview</refentrytitle>
|
||||
<refentrytitle>GTK CSS Overview</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>GTK+ CSS Overview</refname>
|
||||
<refname>GTK CSS Overview</refname>
|
||||
<refpurpose>
|
||||
Overview of CSS in GTK+
|
||||
Overview of CSS in GTK
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
@ -31,10 +31,10 @@ We use <literallayout> for syntax productions, and each line is put in a <code>
|
||||
-->
|
||||
|
||||
<refsect1 id="css-overview">
|
||||
<title>Overview of CSS in GTK+</title>
|
||||
<title>Overview of CSS in GTK</title>
|
||||
|
||||
<para>
|
||||
This chapter describes in detail how GTK+ uses CSS for styling
|
||||
This chapter describes in detail how GTK uses CSS for styling
|
||||
and layout.
|
||||
</para>
|
||||
|
||||
@ -61,7 +61,7 @@ We use <literallayout> for syntax productions, and each line is put in a <code>
|
||||
<title>CSS nodes</title>
|
||||
|
||||
<para>
|
||||
GTK+ applies the style information found in style sheets by matching
|
||||
GTK applies the style information found in style sheets by matching
|
||||
the selectors against a tree of nodes. Each node in the tree has a
|
||||
name, a state and possibly style classes. The children of each node
|
||||
are linearly ordered.
|
||||
@ -99,7 +99,7 @@ scale[.fine-tune]
|
||||
<title>Style sheets</title>
|
||||
|
||||
<para>
|
||||
The basic structure of the style sheets understood by GTK+ is
|
||||
The basic structure of the style sheets understood by GTK is
|
||||
a series of statements, which are either rule sets or “@-rules”,
|
||||
separated by whitespace.
|
||||
</para>
|
||||
@ -128,7 +128,7 @@ button, entry {
|
||||
<title>Importing style sheets</title>
|
||||
|
||||
<para>
|
||||
GTK+ supports the CSS @import rule, in order to load another
|
||||
GTK supports the CSS @import rule, in order to load another
|
||||
style sheet in addition to the currently parsed one.
|
||||
</para>
|
||||
|
||||
@ -339,8 +339,8 @@ checkbutton:indeterminate {
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The full syntax for selectors understood by GTK+ can be found in the
|
||||
table below. The main difference to CSS is that GTK+ does not currently
|
||||
The full syntax for selectors understood by GTK can be found in the
|
||||
table below. The main difference to CSS is that GTK does not currently
|
||||
support attribute selectors.
|
||||
</para>
|
||||
|
||||
@ -373,7 +373,7 @@ checkbutton:indeterminate {
|
||||
<entry><phrase role="nowrap">E#id</phrase></entry>
|
||||
<entry>any E node with the given ID</entry>
|
||||
<entry><ulink url="https://www.w3.org/TR/css3-selectors/#id-selectors">CSS</ulink></entry>
|
||||
<entry>GTK+ uses the widget name as ID</entry>
|
||||
<entry>GTK uses the widget name as ID</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><phrase role="nowrap">E:nth-child(〈nth-child〉)</phrase></entry>
|
||||
@ -543,7 +543,7 @@ checkbutton:indeterminate {
|
||||
</example>
|
||||
|
||||
<para>
|
||||
GTK+ adds several additional ways to specify colors.
|
||||
GTK adds several additional ways to specify colors.
|
||||
</para>
|
||||
|
||||
<literallayout><code>〈gtk color〉 = 〈symbolic color〉 | 〈color expression〉 | 〈win32 color〉</code>
|
||||
@ -576,7 +576,7 @@ checkbutton:indeterminate {
|
||||
</example>
|
||||
|
||||
<para>
|
||||
GTK+ also supports color expressions, which allow colors to be transformed
|
||||
GTK also supports color expressions, which allow colors to be transformed
|
||||
to new ones and can be nested, providing a rich language to define colors.
|
||||
Color expressions resemble functions, taking 1 or more colors and in some
|
||||
cases a number as arguments.
|
||||
@ -595,7 +595,7 @@ checkbutton:indeterminate {
|
||||
</literallayout>
|
||||
|
||||
<para>
|
||||
On Windows, GTK+ allows to refer to system colors, as follows:
|
||||
On Windows, GTK allows to refer to system colors, as follows:
|
||||
</para>
|
||||
|
||||
<literallayout><code>〈win32 color〉 = -gtk-win32-color( 〈name〉, 〈integer〉 )</code>
|
||||
@ -632,7 +632,7 @@ checkbutton:indeterminate {
|
||||
<para>
|
||||
The simplest way to specify an image in CSS is to load an image
|
||||
file from a URL. CSS does not specify anything about supported file
|
||||
formats; within GTK+, you can expect at least PNG, JPEG and SVG to
|
||||
formats; within GTK, you can expect at least PNG, JPEG and SVG to
|
||||
work. The full list of supported image formats is determined by the
|
||||
available gdk-pixbuf image loaders and may vary between systems.
|
||||
</para>
|
||||
@ -734,14 +734,14 @@ label {
|
||||
</para>
|
||||
|
||||
<para>
|
||||
GTK+ extends the CSS syntax for images and also uses it for specifying icons.
|
||||
GTK extends the CSS syntax for images and also uses it for specifying icons.
|
||||
</para>
|
||||
|
||||
<literallayout><code>〈gtk image〉 = 〈themed icon〉 | 〈scaled image〉 | 〈recolored image〉 | 〈win32 theme part〉</code>
|
||||
</literallayout>
|
||||
|
||||
<para>
|
||||
GTK+ has extensive support for loading icons from icon themes. It is
|
||||
GTK has extensive support for loading icons from icon themes. It is
|
||||
accessible from CSS with the -gtk-icontheme syntax.
|
||||
</para>
|
||||
|
||||
@ -770,7 +770,7 @@ arrow.fancy {
|
||||
</example>
|
||||
|
||||
<para>
|
||||
GTK+ supports scaled rendering on hi-resolution displays. This works
|
||||
GTK supports scaled rendering on hi-resolution displays. This works
|
||||
best if images can specify normal and hi-resolution variants. From
|
||||
CSS, this can be done with the -gtk-scaled syntax.
|
||||
</para>
|
||||
@ -816,7 +816,7 @@ arrow {
|
||||
]]></programlisting>
|
||||
</example>
|
||||
<para>
|
||||
On Windows, GTK+ allows to refer to system theme parts as images, as follows:
|
||||
On Windows, GTK allows to refer to system theme parts as images, as follows:
|
||||
</para>
|
||||
|
||||
<literallayout><code>〈win32 theme part〉 = -gtk-win32-theme-part( 〈name〉, 〈integer〉 〈integer〉</code>
|
||||
@ -830,7 +830,7 @@ arrow {
|
||||
|
||||
<para>
|
||||
CSS defines a mechanism by which changes in CSS property values can
|
||||
be made to take effect gradually, instead of all at once. GTK+ supports
|
||||
be made to take effect gradually, instead of all at once. GTK supports
|
||||
these transitions as well.
|
||||
</para>
|
||||
|
||||
@ -911,7 +911,7 @@ spinner {
|
||||
|
||||
<para>
|
||||
In order to extend key bindings affecting different widgets,
|
||||
GTK+ supports the @binding-set rule to parse a set of bind/unbind
|
||||
GTK supports the @binding-set rule to parse a set of bind/unbind
|
||||
directives. Note that in order to take effect, the binding sets
|
||||
defined in this way must be associated with rule sets by setting
|
||||
the -gtk-key-bindings property.
|
||||
|
@ -4,15 +4,15 @@
|
||||
]>
|
||||
<refentry id="chap-css-properties">
|
||||
<refmeta>
|
||||
<refentrytitle>GTK+ CSS Properties</refentrytitle>
|
||||
<refentrytitle>GTK CSS Properties</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>GTK+ CSS Properties</refname>
|
||||
<refname>GTK CSS Properties</refname>
|
||||
<refpurpose>
|
||||
CSS Properties in GTK+
|
||||
CSS Properties in GTK
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
@ -34,9 +34,9 @@ We use <literallayout> for syntax productions, and each line is put in a <code>
|
||||
<title>Supported CSS Properties</title>
|
||||
|
||||
<para>
|
||||
GTK+ supports CSS properties and shorthands as far as they can be applied
|
||||
GTK supports CSS properties and shorthands as far as they can be applied
|
||||
in the context of widgets, and adds its own properties only when needed.
|
||||
All GTK+-specific properties have a -gtk prefix.
|
||||
All GTK-specific properties have a -gtk prefix.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@ -66,7 +66,7 @@ We use <literallayout> for syntax productions, and each line is put in a <code>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Whereever a number is allowed, GTK+ also accepts a Windows-specific
|
||||
Whereever a number is allowed, GTK also accepts a Windows-specific
|
||||
theme size:
|
||||
</para>
|
||||
|
||||
@ -1159,7 +1159,7 @@ We use <literallayout> for syntax productions, and each line is put in a <code>
|
||||
</table>
|
||||
|
||||
<para>
|
||||
GTK+ uses the CSS outline properties to render the 'focus rectangle'.
|
||||
GTK uses the CSS outline properties to render the 'focus rectangle'.
|
||||
</para>
|
||||
|
||||
<table pgwide="1">
|
||||
|
@ -4,15 +4,15 @@
|
||||
]>
|
||||
<refentry id="chap-drawing-model">
|
||||
<refmeta>
|
||||
<refentrytitle>The GTK+ Drawing Model</refentrytitle>
|
||||
<refentrytitle>The GTK Drawing Model</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>The GTK+ Drawing Model</refname>
|
||||
<refname>The GTK Drawing Model</refname>
|
||||
<refpurpose>
|
||||
The GTK+ drawing model in detail
|
||||
The GTK drawing model in detail
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
@ -21,12 +21,12 @@
|
||||
<title>Overview of the drawing model</title>
|
||||
|
||||
<para>
|
||||
This chapter describes the GTK+ drawing model in detail. If you
|
||||
are interested in the procedure which GTK+ follows to draw its
|
||||
This chapter describes the GTK drawing model in detail. If you
|
||||
are interested in the procedure which GTK follows to draw its
|
||||
widgets and windows, you should read this chapter; this will be
|
||||
useful to know if you decide to implement your own widgets. This
|
||||
chapter will also clarify the reasons behind the ways certain
|
||||
things are done in GTK+; for example, why you cannot change the
|
||||
things are done in GTK; for example, why you cannot change the
|
||||
background color of all widgets with the same method.
|
||||
</para>
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
clipping", instead of "toplevel application windows". Most
|
||||
windowing systems support nested windows, where the contents of
|
||||
child windows get clipped by the boundaries of their parents.
|
||||
Although GTK+ and GDK in particular may run on a windowing
|
||||
Although GTK and GDK in particular may run on a windowing
|
||||
system with no such notion of nested windows, GDK presents the
|
||||
illusion of being under such a system. A toplevel window may
|
||||
contain many subwindows and sub-subwindows, for example, one for
|
||||
@ -63,16 +63,16 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
In practice, most windows in modern GTK+ application are client-side
|
||||
In practice, most windows in modern GTK application are client-side
|
||||
constructs. Only few windows (in particular toplevel windows) are
|
||||
<emphasis>native</emphasis>, which means that they represent a
|
||||
window from the underlying windowing system on which GTK+ is running.
|
||||
window from the underlying windowing system on which GTK is running.
|
||||
For example, on X11 it corresponds to a <type>Window</type>; on Win32,
|
||||
it corresponds to a <type>HANDLE</type>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Generally, the drawing cycle begins when GTK+ receives an
|
||||
Generally, the drawing cycle begins when GTK receives an
|
||||
exposure event from the underlying windowing system: if the
|
||||
user drags a window over another one, the windowing system will
|
||||
tell the underlying window that it needs to repaint itself. The
|
||||
@ -80,7 +80,7 @@
|
||||
that it needs to update its display. For example, when the user
|
||||
types a character in a <link
|
||||
linkend="GtkEntry"><classname>GtkEntry</classname></link>
|
||||
widget, the entry asks GTK+ to queue a redraw operation for
|
||||
widget, the entry asks GTK to queue a redraw operation for
|
||||
itself.
|
||||
</para>
|
||||
|
||||
@ -95,7 +95,7 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The following sections describe how GTK+ decides which widgets
|
||||
The following sections describe how GTK decides which widgets
|
||||
need to be repainted in response to such events, and how widgets
|
||||
work internally in terms of the resources they use from the
|
||||
windowing system.
|
||||
@ -106,10 +106,10 @@
|
||||
<title>The frame clock</title>
|
||||
|
||||
<para>
|
||||
All GTK+ applications are mainloop-driven, which means that most
|
||||
All GTK applications are mainloop-driven, which means that most
|
||||
of the time the app is idle inside a loop that just waits for
|
||||
something to happen and then calls out to the right place when
|
||||
it does. On top of this GTK+ has a frame clock that gives a
|
||||
it does. On top of this GTK has a frame clock that gives a
|
||||
“pulse” to the application. This clock beats at a steady rate,
|
||||
which is tied to the framerate of the output (this is synced to
|
||||
the monitor via the window manager/compositor). The clock has
|
||||
@ -215,7 +215,7 @@
|
||||
<para>
|
||||
Most widgets, including those that create their own GdkSurfaces have
|
||||
a transparent background, so they draw on top of whatever widgets
|
||||
are below them. This was not the case in GTK+ 2 where the theme set
|
||||
are below them. This was not the case in GTK 2 where the theme set
|
||||
the background of most widgets to the default background color. (In
|
||||
fact, transparent GdkSurfaces used to be impossible.)
|
||||
</para>
|
||||
@ -233,7 +233,7 @@
|
||||
<title>Scrolling</title>
|
||||
|
||||
<para>
|
||||
Traditionally, GTK+ has used self-copy operations to implement
|
||||
Traditionally, GTK has used self-copy operations to implement
|
||||
scrolling with native windows. With transparent backgrounds, this
|
||||
no longer works. Instead, we just mark the entire affected area for
|
||||
repainting when these operations are used. This allows (partially)
|
||||
@ -253,7 +253,7 @@
|
||||
<literal>draw</literal> handler were sent directly to the
|
||||
windowing system, flicker could result. This is because areas may get
|
||||
redrawn repeatedly: the background, then decorative frames, then text
|
||||
labels, etc. To avoid flicker, GTK+ employs a <firstterm>double
|
||||
labels, etc. To avoid flicker, GTK employs a <firstterm>double
|
||||
buffering</firstterm> system at the GDK level. Widgets normally don't
|
||||
know that they are drawing to an off-screen buffer; they just issue their
|
||||
normal drawing commands, and the buffer gets sent to the windowing system
|
||||
@ -284,7 +284,7 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To make this easier, GTK+ normally calls
|
||||
To make this easier, GTK normally calls
|
||||
<function>gdk_surface_begin_paint_region()</function>
|
||||
before emitting the #GtkWidget::draw signal, and
|
||||
then it calls <function>gdk_surface_end_paint()</function>
|
||||
|
@ -3,11 +3,11 @@
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="gtk-getting-started" xmlns:xi="http://www.w3.org/2003/XInclude">
|
||||
<title>Getting Started with GTK+</title>
|
||||
<title>Getting Started with GTK</title>
|
||||
|
||||
<para>GTK+ is a <ulink url="http://en.wikipedia.org/wiki/Widget_toolkit">
|
||||
<para>GTK is a <ulink url="http://en.wikipedia.org/wiki/Widget_toolkit">
|
||||
widget toolkit</ulink>. Each user interface created by
|
||||
GTK+ consists of widgets. This is implemented in C using
|
||||
GTK consists of widgets. This is implemented in C using
|
||||
<link linkend="gobject">GObject</link>, an object-oriented framework for C.
|
||||
Widgets are organized in a hierachy. The window widget is the main container.
|
||||
The user interface is then built by adding buttons, drop-down menus, input
|
||||
@ -17,14 +17,14 @@
|
||||
assembling the interface manually. You can also use a visual user interface
|
||||
editor, like <ulink url="https://glade.gnome.org/">Glade</ulink>.</para>
|
||||
|
||||
<para>GTK+ is event-driven. The toolkit listens for events such as
|
||||
<para>GTK is event-driven. The toolkit listens for events such as
|
||||
a click on a button, and passes the event to your application.</para>
|
||||
|
||||
<para>This chapter contains some tutorial information to get you
|
||||
started with GTK+ programming. It assumes that you have GTK+, its
|
||||
started with GTK programming. It assumes that you have GTK, its
|
||||
dependencies and a C compiler installed and ready to use. If you
|
||||
need to build GTK+ itself first, refer to the
|
||||
<link linkend="gtk-compiling">Compiling the GTK+ libraries</link>
|
||||
need to build GTK itself first, refer to the
|
||||
<link linkend="gtk-compiling">Compiling the GTK libraries</link>
|
||||
section in this reference.</para>
|
||||
|
||||
<section>
|
||||
@ -50,24 +50,24 @@
|
||||
<para>
|
||||
You can compile the program above with GCC using:
|
||||
<literallayout>
|
||||
<literal>gcc `pkg-config --cflags gtk+-4.0` -o example-0 example-0.c `pkg-config --libs gtk+-4.0`</literal>
|
||||
<literal>gcc `pkg-config --cflags gtk4` -o example-0 example-0.c `pkg-config --libs gtk4`</literal>
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<note><para>For more information on how to compile a GTK+ application, please
|
||||
refer to the <link linkend="gtk-compiling">Compiling GTK+ Applications</link>
|
||||
<note><para>For more information on how to compile a GTK application, please
|
||||
refer to the <link linkend="gtk-compiling">Compiling GTK Applications</link>
|
||||
section in this reference.</para></note>
|
||||
|
||||
<para>All GTK+ applications will, of course, include
|
||||
<para>All GTK applications will, of course, include
|
||||
<filename>gtk/gtk.h</filename>, which declares functions, types and
|
||||
macros required by GTK+ applications.</para>
|
||||
macros required by GTK applications.</para>
|
||||
|
||||
<warning><para>Even if GTK+ installs multiple header files, only the
|
||||
<warning><para>Even if GTK installs multiple header files, only the
|
||||
top-level <filename>gtk/gtk.h</filename> header can be directly included
|
||||
by third party code. The compiler will abort with an error if any other
|
||||
header is directly included.</para></warning>
|
||||
|
||||
<para>In a GTK+ application, the purpose of the main() function is to
|
||||
<para>In a GTK application, the purpose of the main() function is to
|
||||
create a #GtkApplication object and run it. In this example a
|
||||
#GtkApplication pointer named <varname>app</varname> is called and then
|
||||
initialized using gtk_application_new().</para>
|
||||
@ -89,8 +89,8 @@
|
||||
when your application is launched with
|
||||
g_application_run() on the line below.
|
||||
The gtk_application_run() also takes as arguments the pointers to the command line arguments
|
||||
counter and string array; this allows GTK+ to parse specific command line
|
||||
arguments that control the behavior of GTK+ itself. The parsed arguments
|
||||
counter and string array; this allows GTK to parse specific command line
|
||||
arguments that control the behavior of GTK itself. The parsed arguments
|
||||
will be removed from the array, leaving the unrecognized ones for your
|
||||
application to parse.
|
||||
</para>
|
||||
@ -128,16 +128,16 @@
|
||||
#GtkApplication object is freed from memory with g_object_unref().
|
||||
Finally the status integer is returned and the GTK application exits.</para>
|
||||
|
||||
<para>While the program is running, GTK+ is receiving
|
||||
<para>While the program is running, GTK is receiving
|
||||
<firstterm>events</firstterm>. These are typically input events caused by
|
||||
the user interacting with your program, but also things like messages from
|
||||
the window manager or other applications. GTK+ processes these and as a
|
||||
the window manager or other applications. GTK processes these and as a
|
||||
result, <firstterm>signals</firstterm> may be emitted on your widgets.
|
||||
Connecting handlers for these signals is how you normally make your
|
||||
program do something in response to user input.</para>
|
||||
|
||||
<para>The following example is slightly more complex, and tries to
|
||||
showcase some of the capabilities of GTK+.</para>
|
||||
showcase some of the capabilities of GTK.</para>
|
||||
|
||||
<para>In the long tradition of programming languages and libraries,
|
||||
it is called <emphasis>Hello, World</emphasis>.</para>
|
||||
@ -151,7 +151,7 @@
|
||||
</informalfigure>
|
||||
|
||||
<example id="gtk-getting-started-hello-world">
|
||||
<title>Hello World in GTK+</title>
|
||||
<title>Hello World in GTK</title>
|
||||
<para>Create a new file with the following content named example-1.c.</para>
|
||||
<programlisting><xi:include href="@SRC_DIR@/examples/hello-world.c" parse="text">
|
||||
<xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
|
||||
@ -160,7 +160,7 @@
|
||||
<para>
|
||||
You can compile the program above with GCC using:
|
||||
<literallayout>
|
||||
<literal>gcc `pkg-config --cflags gtk+-4.0` -o example-1 example-1.c `pkg-config --libs gtk+-4.0`</literal>
|
||||
<literal>gcc `pkg-config --cflags gtk4` -o example-1 example-1.c `pkg-config --libs gtk4`</literal>
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
@ -169,7 +169,7 @@
|
||||
button to our window, with the label "Hello World". Two new GtkWidget pointers
|
||||
are declared to accomplish this, <varname>button</varname> and
|
||||
<varname>button_box</varname>. The button_box variable is created to store a
|
||||
#GtkButtonBox which is GTK+'s way of controlling the size and layout of buttons.
|
||||
#GtkButtonBox which is GTK's way of controlling the size and layout of buttons.
|
||||
The #GtkButtonBox is created and assigned to gtk_button_box_new() which takes a
|
||||
#GtkOrientation enum as parameter. The buttons which this box will contain can
|
||||
either be stored horizontally or vertically but this does not matter in this
|
||||
@ -215,7 +215,7 @@
|
||||
it becomes important to control how each widget is positioned and sized.
|
||||
This is where packing comes in.</para>
|
||||
|
||||
<para>GTK+ comes with a large variety of <firstterm>layout containers</firstterm>
|
||||
<para>GTK comes with a large variety of <firstterm>layout containers</firstterm>
|
||||
whose purpose it is to control the layout of the child widgets that are
|
||||
added to them. See <xref linkend="LayoutContainers"/> for an overview.</para>
|
||||
|
||||
@ -238,7 +238,7 @@
|
||||
<para>
|
||||
You can compile the program above with GCC using:
|
||||
<literallayout>
|
||||
<literal>gcc `pkg-config --cflags gtk+-4.0` -o example-2 example-2.c `pkg-config --libs gtk+-4.0`</literal>
|
||||
<literal>gcc `pkg-config --cflags gtk4` -o example-2 example-2.c `pkg-config --libs gtk4`</literal>
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
@ -250,7 +250,7 @@
|
||||
or hundreds of widgets, doing all the setup work in C code is
|
||||
cumbersome, and making changes becomes next to impossible.</para>
|
||||
|
||||
<para>Thankfully, GTK+ supports the separation of user interface
|
||||
<para>Thankfully, GTK supports the separation of user interface
|
||||
layout from your business logic, by using UI descriptions in an
|
||||
XML format that can be parsed by the #GtkBuilder class.</para>
|
||||
|
||||
@ -264,7 +264,7 @@
|
||||
<para>
|
||||
You can compile the program above with GCC using:
|
||||
<literallayout>
|
||||
<literal>gcc `pkg-config --cflags gtk+-4.0` -o example-3 example-3.c `pkg-config --libs gtk+-4.0`</literal>
|
||||
<literal>gcc `pkg-config --cflags gtk4` -o example-3 example-3.c `pkg-config --libs gtk4`</literal>
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
@ -324,7 +324,7 @@
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<para>GTK+ includes application support that is built on top of
|
||||
<para>GTK includes application support that is built on top of
|
||||
#GApplication. In this tutorial we'll build a simple application by
|
||||
starting from scratch, adding more and more pieces over time. Along
|
||||
the way, we'll learn about #GtkApplication, templates, resources,
|
||||
@ -332,8 +332,8 @@
|
||||
#GtkListBox, and more.</para>
|
||||
|
||||
<para>The full, buildable sources for these examples can be found
|
||||
in the examples/ directory of the GTK+ source distribution, or
|
||||
<ulink url="https://gitlab.gnome.org/GNOME/gtk/blob/master/examples">online</ulink> in the GTK+ git repository.
|
||||
in the examples/ directory of the GTK source distribution, or
|
||||
<ulink url="https://gitlab.gnome.org/GNOME/gtk/blob/master/examples">online</ulink> in the GTK git repository.
|
||||
You can build each example separately by using make with the <filename>Makefile.example</filename>
|
||||
file. For more information, see the <filename>README</filename> included in the
|
||||
examples directory.</para>
|
||||
@ -368,7 +368,7 @@
|
||||
</informalexample>
|
||||
|
||||
<para>Another important class that is part of the application support
|
||||
in GTK+ is #GtkApplicationWindow. It is typically subclassed as well.
|
||||
in GTK is #GtkApplicationWindow. It is typically subclassed as well.
|
||||
Our subclass does not do anything yet, so we will just get an empty
|
||||
window.</para>
|
||||
|
||||
@ -797,7 +797,7 @@ preferences_activated (GSimpleAction *action,
|
||||
<title>Adding a search bar</title>
|
||||
|
||||
<para>We continue to flesh out the functionality of our application.
|
||||
For now, we add search. GTK+ supports this with #GtkSearchEntry and
|
||||
For now, we add search. GTK supports this with #GtkSearchEntry and
|
||||
#GtkSearchBar. The search bar is a widget that can slide in from the
|
||||
top to present a search entry.</para>
|
||||
|
||||
@ -1007,7 +1007,7 @@ example_app_window_init (ExampleAppWindow *win)
|
||||
|
||||
<para>Our application already uses a GtkHeaderBar, but so far it
|
||||
still gets a 'normal' window titlebar on top of that. This is a
|
||||
bit redundant, and we will now tell GTK+ to use the header bar
|
||||
bit redundant, and we will now tell GTK to use the header bar
|
||||
as replacement for the titlebar. To do so, we move it around to
|
||||
be a direct child of the window, and set its type to be titlebar.</para>
|
||||
|
||||
@ -1048,7 +1048,7 @@ example_app_window_init (ExampleAppWindow *win)
|
||||
e.g. when another window is moved and uncovers part of the widget, or
|
||||
when the window containing it is resized. It is also possible to explicitly
|
||||
cause part or all of the widget to be redrawn, by calling
|
||||
gtk_widget_queue_draw() or its variants. GTK+ takes care of most of the
|
||||
gtk_widget_queue_draw() or its variants. GTK takes care of most of the
|
||||
details by providing a ready-to-use cairo context to the ::draw signal
|
||||
handler.</para>
|
||||
|
||||
@ -1073,7 +1073,7 @@ example_app_window_init (ExampleAppWindow *win)
|
||||
<para>
|
||||
You can compile the program above with GCC using:
|
||||
<literallayout>
|
||||
<literal>gcc `pkg-config --cflags gtk+-4.0` -o example-4 example-4.c `pkg-config --libs gtk+-4.0`</literal>
|
||||
<literal>gcc `pkg-config --cflags gtk4` -o example-4 example-4.c `pkg-config --libs gtk4`</literal>
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
|
@ -51,11 +51,11 @@
|
||||
<glossterm>column</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
GTK+ contains several widgets which display data in columns,
|
||||
GTK contains several widgets which display data in columns,
|
||||
e.g. the #GtkTreeView.
|
||||
These <glossterm linkend="view-column">view columns</glossterm> in
|
||||
the tree view are represented by #GtkTreeViewColumn
|
||||
objects inside GTK+. They should not be confused with
|
||||
objects inside GTK. They should not be confused with
|
||||
<glossterm linkend="model-column">model columns</glossterm> which
|
||||
are used to organize the data in tree models.
|
||||
</para>
|
||||
@ -114,7 +114,7 @@
|
||||
<glossterm>event</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
Events are the way in which GDK informs GTK+ about external events
|
||||
Events are the way in which GDK informs GTK about external events
|
||||
like pointer motion, button clicks, key presses, etc.
|
||||
</para>
|
||||
</glossdef>
|
||||
@ -177,7 +177,7 @@
|
||||
<para>
|
||||
These widgets follow the well-known model-view pattern, which separates
|
||||
the data (the model) to be displayed from the component which does the
|
||||
actual visualization (the view). Examples of this pattern in GTK+ are
|
||||
actual visualization (the view). Examples of this pattern in GTK are
|
||||
the #GtkTreeView/#GtkTreeModel and #GtkTextView/#GtkTextBuffer
|
||||
</para>
|
||||
<para>
|
||||
@ -281,7 +281,7 @@
|
||||
<glossterm>style</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
A style encapsulates what GTK+ needs to know in order to draw
|
||||
A style encapsulates what GTK needs to know in order to draw
|
||||
a widget. Styles can be modified with
|
||||
<link linkend="gtk3-Resource-Files">resource files</link>.
|
||||
</para>
|
||||
@ -294,7 +294,7 @@
|
||||
<para>
|
||||
A <glossterm linkend="widget">widget</glossterm> that does not
|
||||
require a <glossterm linkend="parent">parent</glossterm> container.
|
||||
The only toplevel widgets in GTK+ are #GtkWindow and widgets derived from it.
|
||||
The only toplevel widgets in GTK are #GtkWindow and widgets derived from it.
|
||||
</para>
|
||||
<glossseealso>
|
||||
<glossterm linkend="container">container</glossterm>
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
<refentryinfo>
|
||||
<title>gtk4-broadwayd</title>
|
||||
<productname>GTK+</productname>
|
||||
<productname>GTK</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
@ -40,7 +40,7 @@
|
||||
<refsect1><title>Description</title>
|
||||
<para>
|
||||
<command>gtk4-broadwayd</command> is a display server for the Broadway
|
||||
GDK backend. It allows multiple GTK+ applications to display their
|
||||
GDK backend. It allows multiple GTK applications to display their
|
||||
windows in the same web browser, by connecting to gtk4-broadwayd.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
<refentryinfo>
|
||||
<title>gtk4-builder-tool</title>
|
||||
<productname>GTK+</productname>
|
||||
<productname>GTK</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
<refentryinfo>
|
||||
<title>gtk4-demo-application</title>
|
||||
<productname>GTK+</productname>
|
||||
<productname>GTK</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
<refentryinfo>
|
||||
<title>gtk4-demo</title>
|
||||
<productname>GTK+</productname>
|
||||
<productname>GTK</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
<refnamediv>
|
||||
<refname>gtk4-demo</refname>
|
||||
<refpurpose>Demonstrate GTK+ widgets</refpurpose>
|
||||
<refpurpose>Demonstrate GTK widgets</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
@ -40,7 +40,7 @@
|
||||
<refsect1><title>Description</title>
|
||||
<para>
|
||||
<command>gtk4-demo</command> is a collection of examples.
|
||||
Its purpose is to demonstrate many GTK+ widgets in a form
|
||||
Its purpose is to demonstrate many GTK widgets in a form
|
||||
that is useful to application developers.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -8,18 +8,18 @@
|
||||
]>
|
||||
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
|
||||
<bookinfo>
|
||||
<title>GTK+ 4 Reference Manual</title>
|
||||
<title>GTK 4 Reference Manual</title>
|
||||
<releaseinfo>
|
||||
This document is for the GTK+ 4 library, version &version;.
|
||||
This document is for the GTK 4 library, version &version;.
|
||||
The latest versions can be found online at
|
||||
<ulink role="online-location" url="https://developer.gnome.org/gtk4/">https://developer.gnome.org/gtk4/</ulink>.
|
||||
If you are looking for the older GTK+ 3 series of libraries,
|
||||
If you are looking for the older GTK 3 series of libraries,
|
||||
see <ulink role="online-location" url="https://developer.gnome.org/gtk3/">https://developer.gnome.org/gtk3/</ulink>.
|
||||
</releaseinfo>
|
||||
</bookinfo>
|
||||
|
||||
<part id="gtk">
|
||||
<title>GTK+ Overview</title>
|
||||
<title>GTK Overview</title>
|
||||
<xi:include href="overview.xml"/>
|
||||
<xi:include href="xml/getting_started.xml"/>
|
||||
<xi:include href="resources.sgml" />
|
||||
@ -29,7 +29,7 @@
|
||||
</part>
|
||||
|
||||
<part id="gtkobjects">
|
||||
<title>GTK+ Widgets and Objects</title>
|
||||
<title>GTK Widgets and Objects</title>
|
||||
|
||||
<chapter>
|
||||
<title>Object Hierarchy</title>
|
||||
@ -330,7 +330,7 @@
|
||||
</part>
|
||||
|
||||
<part id="gtkbase">
|
||||
<title>GTK+ Core Reference</title>
|
||||
<title>GTK Core Reference</title>
|
||||
<xi:include href="xml/gtkmain.xml" />
|
||||
<xi:include href="xml/gtkfeatures.xml" />
|
||||
<xi:include href="xml/gtkaccelgroup.xml" />
|
||||
@ -345,7 +345,7 @@
|
||||
</part>
|
||||
|
||||
<part id="theming">
|
||||
<title>Theming in GTK+</title>
|
||||
<title>Theming in GTK</title>
|
||||
<xi:include href="css-overview.xml" />
|
||||
<xi:include href="css-properties.xml" />
|
||||
<xi:include href="xml/gtkstylecontext.xml" />
|
||||
@ -356,15 +356,15 @@
|
||||
</part>
|
||||
|
||||
<part id="migrating">
|
||||
<title>Migrating from Previous Versions of GTK+</title>
|
||||
<title>Migrating from Previous Versions of GTK</title>
|
||||
|
||||
<partintro>
|
||||
<para>
|
||||
This part describes what you need to change in programs use
|
||||
older versions of GTK+ so that they can use the new features.
|
||||
older versions of GTK so that they can use the new features.
|
||||
It also mentions how to convert applications using widgets
|
||||
found in the libgnomeui library to use their counterparts
|
||||
in GTK+.
|
||||
in GTK.
|
||||
</para>
|
||||
</partintro>
|
||||
|
||||
@ -373,7 +373,7 @@
|
||||
</part>
|
||||
|
||||
<part>
|
||||
<title>GTK+ Tools</title>
|
||||
<title>GTK Tools</title>
|
||||
<xi:include href="gtk4-demo.xml" />
|
||||
<xi:include href="gtk4-demo-application.xml" />
|
||||
<xi:include href="gtk4-widget-factory.xml" />
|
||||
@ -387,7 +387,7 @@
|
||||
</part>
|
||||
|
||||
<part id="platform-support">
|
||||
<title>GTK+ Platform Support</title>
|
||||
<title>GTK Platform Support</title>
|
||||
<xi:include href="building.sgml" />
|
||||
<xi:include href="xml/compiling.sgml" />
|
||||
<xi:include href="running.sgml" />
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
<refentryinfo>
|
||||
<title>gtk4-encode-symbolic-svg</title>
|
||||
<productname>GTK+</productname>
|
||||
<productname>GTK</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
@ -39,7 +39,7 @@
|
||||
<refsect1><title>Description</title>
|
||||
<para>
|
||||
<command>gtk4-encode-symbolic-svg</command> converts symbolic svg icons into
|
||||
specially prepared png files. GTK+ can load and recolor these pngs, just like
|
||||
specially prepared png files. GTK can load and recolor these pngs, just like
|
||||
original svgs, but loading them is much faster.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
<refentryinfo>
|
||||
<title>gtk4-icon-browser</title>
|
||||
<productname>GTK+</productname>
|
||||
<productname>GTK</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
<refentryinfo>
|
||||
<title>gtk4-launch</title>
|
||||
<productname>GTK+</productname>
|
||||
<productname>GTK</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
<refentryinfo>
|
||||
<title>gtk4-query-settings</title>
|
||||
<productname>GTK+</productname>
|
||||
<productname>GTK</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
<refentryinfo>
|
||||
<title>gtk4-update-icon-cache</title>
|
||||
<productname>GTK+</productname>
|
||||
<productname>GTK</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
@ -56,7 +56,7 @@
|
||||
the icons in the directory tree below the given directory.
|
||||
</para>
|
||||
<para>
|
||||
GTK+ can use the cache files created by <command>gtk4-update-icon-cache</command>
|
||||
GTK can use the cache files created by <command>gtk4-update-icon-cache</command>
|
||||
to avoid a lot of system call and disk seek overhead when the application
|
||||
starts. Since the format of the cache files allows them to be mmaped
|
||||
shared between multiple applications, the overall memory consumption is
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
<refentryinfo>
|
||||
<title>gtk4-widget-factory</title>
|
||||
<productname>GTK+</productname>
|
||||
<productname>GTK</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
<refnamediv>
|
||||
<refname>gtk4-widget-factory</refname>
|
||||
<refpurpose>Demonstrate GTK+ widgets</refpurpose>
|
||||
<refpurpose>Demonstrate GTK widgets</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
@ -37,8 +37,8 @@
|
||||
<refsect1><title>Description</title>
|
||||
<para>
|
||||
<command>gtk4-widget-factory</command> is a collection of examples.
|
||||
Its purpose is to demonstrate many GTK+ widgets in a form
|
||||
that is useful to GTK+ theme developers.
|
||||
Its purpose is to demonstrate many GTK widgets in a form
|
||||
that is useful to GTK theme developers.
|
||||
</para>
|
||||
<para>
|
||||
The application shows widgets in different, typical combinations
|
||||
|
@ -1,5 +1,5 @@
|
||||
This directory contains a collection of images of various widgets.
|
||||
They are created via the shooter command in gtk+/docs/tools/, and are
|
||||
They are created via the shooter command in gtk/docs/tools/, and are
|
||||
updated semi-regularly. The images are used in both the headers of
|
||||
individual widgets as well as the visual index of widgets.
|
||||
|
||||
|
@ -4,26 +4,26 @@
|
||||
]>
|
||||
<refentry id="chap-input-handling">
|
||||
<refmeta>
|
||||
<refentrytitle>The GTK+ Input and Event Handling Model</refentrytitle>
|
||||
<refentrytitle>The GTK Input and Event Handling Model</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>The GTK+ Input and Event Handling Model</refname>
|
||||
<refname>The GTK Input and Event Handling Model</refname>
|
||||
<refpurpose>
|
||||
GTK+ input and event handling in detail
|
||||
GTK input and event handling in detail
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
|
||||
<refsect1 id="input-overview">
|
||||
<title>Overview of GTK+ input and event handling</title>
|
||||
<title>Overview of GTK input and event handling</title>
|
||||
|
||||
<para>
|
||||
This chapter describes in detail how GTK+ handles input. If you are interested
|
||||
This chapter describes in detail how GTK handles input. If you are interested
|
||||
in what happens to translate a key press or mouse motion of the users into a
|
||||
change of a GTK+ widget, you should read this chapter. This knowledge will also
|
||||
change of a GTK widget, you should read this chapter. This knowledge will also
|
||||
be useful if you decide to implement your own widgets.
|
||||
</para>
|
||||
|
||||
@ -33,13 +33,13 @@
|
||||
<!-- input devices: master/slave, keyboard/pointer/touch -->
|
||||
<para>
|
||||
The most basic input devices that every computer user has interacted with are
|
||||
keyboards and mice; beyond these, GTK+ supports touchpads, touchscreens and
|
||||
more exotic input devices such as graphics tablets. Inside GTK+, every such
|
||||
keyboards and mice; beyond these, GTK supports touchpads, touchscreens and
|
||||
more exotic input devices such as graphics tablets. Inside GTK, every such
|
||||
input device is represented by a #GdkDevice object.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To simplify dealing with the variability between these input devices, GTK+
|
||||
To simplify dealing with the variability between these input devices, GTK
|
||||
has a concept of master and slave devices. The concrete physical devices that
|
||||
have many different characteristics (mice may have 2 or 3 or 8 buttons,
|
||||
keyboards have different layouts and may or may not have a separate number
|
||||
@ -48,14 +48,14 @@
|
||||
pointer/keyboard pairs - you can think of such a pair as a 'seat'.
|
||||
</para>
|
||||
<para>
|
||||
GTK+ widgets generally deal with the master devices, and thus can be used
|
||||
GTK widgets generally deal with the master devices, and thus can be used
|
||||
with any pointing device or keyboard.
|
||||
</para>
|
||||
|
||||
<!-- input events: button, touch, key, motion, etc -->
|
||||
<para>
|
||||
When a user interacts with an input device (e.g. moves a mouse or presses
|
||||
a key on the keyboard), GTK+ receives events from the windowing system.
|
||||
a key on the keyboard), GTK receives events from the windowing system.
|
||||
These are typically directed at a specific window - for pointer events,
|
||||
the window under the pointer (grabs complicate this), for keyboard events,
|
||||
the window with the keyboard focus.
|
||||
@ -81,7 +81,7 @@
|
||||
</simplelist>
|
||||
</para>
|
||||
<para>
|
||||
When GTK+ is initialized, it sets up an event handler function with
|
||||
When GTK is initialized, it sets up an event handler function with
|
||||
gdk_event_handler_set(), which receives all of these input events
|
||||
(as well as others, for instance window management related events).
|
||||
</para>
|
||||
@ -152,7 +152,7 @@
|
||||
|
||||
<para>
|
||||
Next, the #GtkWidget::event signal is emitted.
|
||||
Handling these signals was the primary way to handle input in GTK+ widgets
|
||||
Handling these signals was the primary way to handle input in GTK widgets
|
||||
before gestures were introduced. The signal is emitted from
|
||||
the target widget up to the top-level, as part of the “bubble” phase.
|
||||
</para>
|
||||
@ -193,7 +193,7 @@
|
||||
by granting a “pointer emulating” hint to one of the currently interacting touch
|
||||
sequences, which will be reported on every #GdkEventTouch event from that sequence. By
|
||||
default, if a widget didn't request touch events by setting %GDK_TOUCH_MASK on its
|
||||
event mask and didn't override #GtkWidget::touch-event, GTK+ will transform these
|
||||
event mask and didn't override #GtkWidget::touch-event, GTK will transform these
|
||||
“pointer emulating” events into semantically similar #GdkEventButton and #GdkEventMotion
|
||||
events. Depending on %GDK_TOUCH_MASK being in the event mask or not, non-pointer-emulating
|
||||
sequences could still trigger gestures or just get filtered out, regardless of the widget
|
||||
|
@ -4,11 +4,11 @@
|
||||
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
|
||||
]>
|
||||
<chapter id="gtk-migrating-2-to-4">
|
||||
<title>Migrating from GTK+ 2.x to GTK+ 4</title>
|
||||
<title>Migrating from GTK 2.x to GTK 4</title>
|
||||
|
||||
<para>
|
||||
If your application is still using GTK+ 2, you should first convert it to
|
||||
GTK+ 3, by following the <ulink url="https://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html">migration guide</ulink> in the GTK+ 3
|
||||
If your application is still using GTK 2, you should first convert it to
|
||||
GTK 3, by following the <ulink url="https://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html">migration guide</ulink> in the GTK 3
|
||||
documentation, and then follow <xref linkend="gtk-migrating-3-to-4"/>.
|
||||
</para>
|
||||
|
||||
|
@ -4,26 +4,26 @@
|
||||
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
|
||||
]>
|
||||
<chapter id="gtk-migrating-3-to-4">
|
||||
<title>Migrating from GTK+ 3.x to GTK+ 4</title>
|
||||
<title>Migrating from GTK 3.x to GTK 4</title>
|
||||
|
||||
<para>
|
||||
GTK+ 4 is a major new version of GTK+ that breaks both API and ABI
|
||||
compared to GTK+ 3.x. Thankfully, most of the changes are not hard
|
||||
GTK 4 is a major new version of GTK that breaks both API and ABI
|
||||
compared to GTK 3.x. Thankfully, most of the changes are not hard
|
||||
to adapt to and there are a number of steps that you can take to
|
||||
prepare your GTK+ 3.x application for the switch to GTK+ 4. After
|
||||
prepare your GTK 3.x application for the switch to GTK 4. After
|
||||
that, there's a small number of adjustments that you may have to do
|
||||
when you actually switch your application to build against GTK+ 4.
|
||||
when you actually switch your application to build against GTK 4.
|
||||
</para>
|
||||
|
||||
<section>
|
||||
<title>Preparation in GTK+ 3.x</title>
|
||||
<title>Preparation in GTK 3.x</title>
|
||||
|
||||
<para>
|
||||
The steps outlined in the following sections assume that your
|
||||
application is working with GTK+ 3.24, which is the final stable
|
||||
release of GTK+ 3.x. It includes all the necessary APIs and tools
|
||||
to help you port your application to GTK+ 4. If you are still using
|
||||
an older version of GTK+ 3.x, you should first get your application
|
||||
application is working with GTK 3.24, which is the final stable
|
||||
release of GTK 3.x. It includes all the necessary APIs and tools
|
||||
to help you port your application to GTK 4. If you are still using
|
||||
an older version of GTK 3.x, you should first get your application
|
||||
to build and work with the latest minor release in the 3.24 series.
|
||||
</para>
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
Over the years, a number of functions, and in some cases, entire
|
||||
widgets have been deprecated. These deprecations are clearly spelled
|
||||
out in the API reference, with hints about the recommended replacements.
|
||||
The API reference for GTK+ 3 also includes an
|
||||
The API reference for GTK 3 also includes an
|
||||
<ulink url="https://developer.gnome.org/gtk3/3.24/api-index-deprecated.html">index</ulink> of all deprecated symbols.
|
||||
</para>
|
||||
<para>
|
||||
@ -70,7 +70,7 @@
|
||||
<section>
|
||||
<title>Do not use widget style properties</title>
|
||||
<para>
|
||||
Style properties do not exist in GTK+ 4. You should stop using them in
|
||||
Style properties do not exist in GTK 4. You should stop using them in
|
||||
your custom CSS and in your code.
|
||||
</para>
|
||||
</section>
|
||||
@ -78,18 +78,18 @@
|
||||
<section>
|
||||
<title>Review your window creation flags</title>
|
||||
<para>
|
||||
GTK+ 4 removes the GDK_WA_CURSOR flag. Instead, just use
|
||||
GTK 4 removes the GDK_WA_CURSOR flag. Instead, just use
|
||||
gdk_window_set_cursor() to set a cursor on the window after
|
||||
creating it.
|
||||
</para>
|
||||
<para>
|
||||
GTK+ 4 also removes the GDK_WA_VISUAL flag, and always uses
|
||||
GTK 4 also removes the GDK_WA_VISUAL flag, and always uses
|
||||
an RGBA visual for windows. To prepare your code for this,
|
||||
use gdk_window_set_visual (gdk_screen_get_rgba_visual ()) after
|
||||
creating your window.
|
||||
</para>
|
||||
<para>
|
||||
GTK+ 4 also removes the GDK_WA_WMCLASS flag. If you need this
|
||||
GTK 4 also removes the GDK_WA_WMCLASS flag. If you need this
|
||||
X11-specific functionality, use XSetClassHint() directly.
|
||||
</para>
|
||||
</section>
|
||||
@ -97,12 +97,12 @@
|
||||
<section>
|
||||
<title>Stop using non-RGBA visuals</title>
|
||||
<para>
|
||||
GTK+ 4 always uses RGBA visuals for its windows; you should make
|
||||
GTK 4 always uses RGBA visuals for its windows; you should make
|
||||
sure that your code works with that.
|
||||
</para>
|
||||
<para>
|
||||
At the same time, you should stop using GdkVisual APIs, this object
|
||||
not longer exist in GTK+ 4. Most of its APIs are deprecated already
|
||||
not longer exist in GTK 4. Most of its APIs are deprecated already
|
||||
and not useful when dealing with RGBA visuals.
|
||||
</para>
|
||||
</section>
|
||||
@ -110,7 +110,7 @@
|
||||
<section>
|
||||
<title>Stop using GtkBox:padding, GtkBox:fill and GtkBox:expand</title>
|
||||
<para>
|
||||
GTK+4 removes these #GtkBox child properties, so you should not use them.
|
||||
GTK4 removes these #GtkBox child properties, so you should not use them.
|
||||
You can replace GtkBox:padding using the #GtkWidget:margin properties
|
||||
on your #GtkBox child widgets.
|
||||
</para>
|
||||
@ -152,7 +152,7 @@
|
||||
<section>
|
||||
<title>Stop using gdk_pixbuf_get_from_window() and gdk_cairo_set_source_surface()</title>
|
||||
<para>
|
||||
These functions are not supported in GTK+ 4. Instead, either use backend-specific
|
||||
These functions are not supported in GTK 4. Instead, either use backend-specific
|
||||
APIs, or render your widgets using gtk_widget_render().
|
||||
</para>
|
||||
</section>
|
||||
@ -162,7 +162,7 @@
|
||||
<para>
|
||||
The functions and properties related to automatically add a GtkImage
|
||||
to a GtkButton, and using a GtkSetting to control its visibility, are
|
||||
not supported in GTK+ 4. Instead, you can just pack a GtkImage inside
|
||||
not supported in GTK 4. Instead, you can just pack a GtkImage inside
|
||||
a GtkButton, and control its visibility like you would for any other
|
||||
widget. If you only want to add a named icon to a GtkButton, you can
|
||||
use gtk_button_set_icon_name().
|
||||
@ -172,24 +172,24 @@
|
||||
<section>
|
||||
<title>Stop using GtkWidget event signals</title>
|
||||
<para>
|
||||
Event controllers and #GtkGestures replace event signals in GTK+ 4. They
|
||||
have been backported to GTK+ 3.x so you can prepare for this change.
|
||||
Event controllers and #GtkGestures replace event signals in GTK 4. They
|
||||
have been backported to GTK 3.x so you can prepare for this change.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Set a proper app_id</title>
|
||||
<para>
|
||||
In GTK+4 we want the application's #GApplication
|
||||
In GTK4 we want the application's #GApplication
|
||||
'application-id' (and therefore the D-Bus name), the desktop
|
||||
file basename and Wayland's xdg-shell app_id to match. In
|
||||
order to achieve this with GTK+3 call g_set_prgname() with the same
|
||||
order to achieve this with GTK3 call g_set_prgname() with the same
|
||||
application id you passed to #GtkApplication. Rename your
|
||||
desktop files to match the application id if needed.
|
||||
</para>
|
||||
<para>
|
||||
The call to g_set_prgname() can be removed once you fully migrated
|
||||
to GTK+4.
|
||||
to GTK4.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@ -197,7 +197,7 @@
|
||||
<title>Stop using GtkBox's pack-type child property</title>
|
||||
<para>
|
||||
In order to improve performance and simplify the widget, GtkBox lost its
|
||||
'pack-type' child property. In GTK+4, every GtkBox instance has a simple
|
||||
'pack-type' child property. In GTK4, every GtkBox instance has a simple
|
||||
list of child widgets that it allocates from start to end.
|
||||
The old behavior of pack-type=END can be emulated by simply making the
|
||||
box child in the center hexpand and right-align the ones at the end.
|
||||
@ -212,15 +212,15 @@
|
||||
<para>
|
||||
This section outlines porting tasks that you need to tackle when
|
||||
you get to the point that you actually build your application against
|
||||
GTK+ 4. Making it possible to prepare for these in GTK+ 3 would
|
||||
GTK 4. Making it possible to prepare for these in GTK 3 would
|
||||
have been either impossible or impractical.
|
||||
</para>
|
||||
|
||||
<section>
|
||||
<title>Stop using GdkScreen</title>
|
||||
<para>
|
||||
The GdkScreen object has been removed in GTK+ 4. Most of its APIs already
|
||||
had replacements in GTK+ 3 and were deprecated, a few remaining replacements
|
||||
The GdkScreen object has been removed in GTK 4. Most of its APIs already
|
||||
had replacements in GTK 3 and were deprecated, a few remaining replacements
|
||||
have been added to GdkDisplay.
|
||||
</para>
|
||||
</section>
|
||||
@ -238,7 +238,7 @@
|
||||
<section>
|
||||
<title>Stop using GdkVisual</title>
|
||||
<para>
|
||||
This object is not useful with current GTK+ drawing APIs and has been removed
|
||||
This object is not useful with current GTK drawing APIs and has been removed
|
||||
without replacement.
|
||||
</para>
|
||||
</section>
|
||||
@ -246,8 +246,8 @@
|
||||
<section>
|
||||
<title>Stop using GdkDeviceManager</title>
|
||||
<para>
|
||||
The GdkDeviceManager object has been removed in GTK+ 4. Most of its APIs already
|
||||
had replacements in GTK+ 3 and were deprecated in favor of GdkSeat.
|
||||
The GdkDeviceManager object has been removed in GTK 4. Most of its APIs already
|
||||
had replacements in GTK 3 and were deprecated in favor of GdkSeat.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@ -275,9 +275,9 @@
|
||||
<section>
|
||||
<title>Stop accessing GdkEvent fields</title>
|
||||
<para>
|
||||
Direct access to GdkEvent structs is no longer possible in GTK+ 4. Some
|
||||
frequently-used fields already had accessors in GTK+ 3, and the remaining
|
||||
fields have gained accessors in GTK+ 4.
|
||||
Direct access to GdkEvent structs is no longer possible in GTK 4. Some
|
||||
frequently-used fields already had accessors in GTK 3, and the remaining
|
||||
fields have gained accessors in GTK 4.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@ -328,7 +328,7 @@
|
||||
<section>
|
||||
<title>Adapt to GtkCssProvider API changes</title>
|
||||
<para>
|
||||
In GTK+ 4, the various #GtkCssProvider load functions have lost
|
||||
In GTK 4, the various #GtkCssProvider load functions have lost
|
||||
their #GError argument. If you want to handle CSS loading errors,
|
||||
use the #GtkCssProvider::parsing-error signal instead.
|
||||
</para>
|
||||
@ -337,7 +337,7 @@
|
||||
<section>
|
||||
<title>Stop using GtkContainer::border-width</title>
|
||||
<para>
|
||||
GTK+ 4 has removed the #GtkContainer::border-width property.
|
||||
GTK 4 has removed the #GtkContainer::border-width property.
|
||||
Use other means to influence the spacing of your containers,
|
||||
such as the CSS margin and padding properties on child widgets.
|
||||
</para>
|
||||
@ -346,9 +346,9 @@
|
||||
<section>
|
||||
<title>Adapt to GtkWidget's size request changes</title>
|
||||
<para>
|
||||
GTK+ 3 used five different virtual functions in GtkWidget to
|
||||
GTK 3 used five different virtual functions in GtkWidget to
|
||||
implement size requisition, namely the gtk_widget_get_preferred_width()
|
||||
family of functions. To simplify widget implementations, GTK+4 uses
|
||||
family of functions. To simplify widget implementations, GTK4 uses
|
||||
only one virtual function, GtkWidgetClass::measure() that widgets
|
||||
have to implement.
|
||||
</para>
|
||||
@ -366,7 +366,7 @@
|
||||
<section>
|
||||
<title>Switch to GtkWidget's children APIs</title>
|
||||
<para>
|
||||
Instead of the GtkContainer subclass, in GTK+ 4, any widget can
|
||||
Instead of the GtkContainer subclass, in GTK 4, any widget can
|
||||
have children, and there is new API to navigate the widget tree:
|
||||
gtk_widget_get_first_child(), gtk_widget_get_last_child(),
|
||||
gtk_widget_get_next_sibling(), gtk_widget_get_prev_sibling().
|
||||
@ -378,7 +378,7 @@
|
||||
<section>
|
||||
<title>Don't use -gtk-gradient in your CSS</title>
|
||||
<para>
|
||||
GTK+ now supports standard CSS syntax for both linear and radial
|
||||
GTK now supports standard CSS syntax for both linear and radial
|
||||
gradients, just use those.
|
||||
</para>
|
||||
</section>
|
||||
@ -386,7 +386,7 @@
|
||||
<section>
|
||||
<title>Don't use -gtk-icon-effect in your CSS</title>
|
||||
<para>
|
||||
GTK+ now supports a more versatile -gtk-icon-filter instead. Replace
|
||||
GTK now supports a more versatile -gtk-icon-filter instead. Replace
|
||||
-gtk-icon-effect: dim; with -gtk-icon-filter: opacity(0.5); and
|
||||
-gtk-icon-effect: hilight; with -gtk-icon-filter: brightness(1.2);.
|
||||
</para>
|
||||
@ -403,8 +403,8 @@
|
||||
<section>
|
||||
<title>Adapt to drawing model changes</title>
|
||||
<para>
|
||||
This area has seen the most radical changes in the transition from GTK+ 3
|
||||
to GTK+ 4. Widgets no longer use a draw() function to render their contents
|
||||
This area has seen the most radical changes in the transition from GTK 3
|
||||
to GTK 4. Widgets no longer use a draw() function to render their contents
|
||||
to a cairo surface. Instead, they have a snapshot() function that creates
|
||||
one or more GskRenderNodes to represent their content. Third-party widgets
|
||||
that use a draw() function or a #GtkWidget::draw signal handler for custom
|
||||
@ -434,7 +434,7 @@
|
||||
<section>
|
||||
<title>Widgets are now visible by default</title>
|
||||
<para>
|
||||
The default value of #GtkWidget::visible in GTK+ 4 is %TRUE, so you no
|
||||
The default value of #GtkWidget::visible in GTK 4 is %TRUE, so you no
|
||||
longer need to explicitly show all your widgets. On the flip side, you
|
||||
need to hide widgets that are not meant to be visible from the start.
|
||||
</para>
|
||||
@ -445,7 +445,7 @@
|
||||
</para>
|
||||
<para>
|
||||
The function gtk_widget_show_all(), the #GtkWidget::no-show-all property
|
||||
and its getter and setter have been removed in GTK+ 4, so you should stop using them.
|
||||
and its getter and setter have been removed in GTK 4, so you should stop using them.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@ -487,8 +487,8 @@
|
||||
<section>
|
||||
<title>GtkWidget event signals are removed</title>
|
||||
<para>
|
||||
Event controllers and #GtkGestures have already been introduced in GTK+ 3 to handle
|
||||
input for many cases. In GTK+ 4, the traditional widget signals for handling input,
|
||||
Event controllers and #GtkGestures have already been introduced in GTK 3 to handle
|
||||
input for many cases. In GTK 4, the traditional widget signals for handling input,
|
||||
such as #GtkWidget::motion-event or #GtkWidget::event have been removed.
|
||||
</para>
|
||||
</section>
|
||||
@ -544,7 +544,7 @@
|
||||
<section>
|
||||
<title>Adapt to icon size API changes</title>
|
||||
<para>
|
||||
Instead of the existing extensible set of symbolic icon sizes, GTK+ now only
|
||||
Instead of the existing extensible set of symbolic icon sizes, GTK now only
|
||||
supports normal and large icons with the #GtkIconSize enumeration. The actual sizes
|
||||
can be defined by themes via the CSS property -gtk-icon-size.
|
||||
</para>
|
||||
|
@ -4,34 +4,34 @@
|
||||
]>
|
||||
<refentry id="gtk-osx">
|
||||
<refmeta>
|
||||
<refentrytitle>Using GTK+ on Mac OS X</refentrytitle>
|
||||
<refentrytitle>Using GTK on Apple macOS</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>Using GTK+ on Mac OS X</refname>
|
||||
<refname>Using GTK on Apple macOS</refname>
|
||||
<refpurpose>
|
||||
OS X-specific aspects of using GTK+
|
||||
MacOS-specific aspects of using GTK
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1>
|
||||
<title>Using GTK+ on Mac OS X</title>
|
||||
<title>Using GTK on Apple macOS</title>
|
||||
|
||||
<para>
|
||||
The Mac OS X port of GTK+ is an implementation of GDK (and therefore GTK+)
|
||||
on top of the Quarz API.
|
||||
The Apple macOS port of GTK is an implementation of GDK (and therefore GTK)
|
||||
on top of the Quartz API.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Currently, the Mac OS X port does not use any additional commandline options
|
||||
Currently, the macOS port does not use any additional commandline options
|
||||
or environment variables.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For up-to-date information about the current status of this port, see the
|
||||
<ulink url="https://wiki.gnome.org/Projects/GTK+/OSX">project page</ulink>.
|
||||
<ulink url="https://wiki.gnome.org/Projects/GTK/OSX">project page</ulink>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
@ -4,15 +4,15 @@
|
||||
]>
|
||||
<refentry id="gtk-other-software">
|
||||
<refmeta>
|
||||
<refentrytitle>Mixing GTK+ with other software</refentrytitle>
|
||||
<refentrytitle>Mixing GTK with other software</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>Mixing GTK+ with other software</refmiscinfo>
|
||||
<refmiscinfo>Mixing GTK with other software</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>Mixing GTK+ with other software</refname>
|
||||
<refname>Mixing GTK with other software</refname>
|
||||
<refpurpose>
|
||||
How to combine GTK+ with other code and event loops
|
||||
How to combine GTK with other code and event loops
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
@ -20,9 +20,9 @@ How to combine GTK+ with other code and event loops
|
||||
<title>Overview</title>
|
||||
|
||||
<para>
|
||||
Often people want to use GTK+ in combination with another library or existing
|
||||
body of code that is not GTK+-aware. The general problem people encounter
|
||||
is that the control flow of the other code does not return to GTK+, so
|
||||
Often people want to use GTK in combination with another library or existing
|
||||
body of code that is not GTK-aware. The general problem people encounter
|
||||
is that the control flow of the other code does not return to GTK, so
|
||||
widgets do not repaint, mouse and keyboard events are ignored, and so forth.
|
||||
</para>
|
||||
|
||||
@ -35,10 +35,10 @@ targetting, and your own familiarity with each approach.
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Periodically yield to GTK+ main loop</title>
|
||||
<title>Periodically yield to GTK main loop</title>
|
||||
|
||||
<para>
|
||||
This is the simplest method, but requires you to modify the non-GTK+ code.
|
||||
This is the simplest method, but requires you to modify the non-GTK code.
|
||||
Say you have a function that does some kind of lengthy task:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
@ -99,7 +99,7 @@ lengthy task.
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Run the other code as a slave of the GTK+ main loop</title>
|
||||
<title>Run the other code as a slave of the GTK main loop</title>
|
||||
|
||||
<para>
|
||||
As a slightly cleaner solution, you can ask the main loop to run a small part of your
|
||||
@ -190,7 +190,7 @@ your needs.
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Integrate the GTK+ main loop with another main loop</title>
|
||||
<title>Integrate the GTK main loop with another main loop</title>
|
||||
|
||||
<para>
|
||||
</para>
|
||||
|
@ -4,17 +4,17 @@
|
||||
]>
|
||||
<partintro>
|
||||
<para>
|
||||
GTK+ is a library for creating graphical user interfaces. It
|
||||
GTK is a library for creating graphical user interfaces. It
|
||||
works on many UNIX-like platforms, Windows, and OS X.
|
||||
GTK+ is released under the GNU Library General Public License
|
||||
GTK is released under the GNU Library General Public License
|
||||
(GNU LGPL), which allows for flexible licensing of client
|
||||
applications. GTK+ has a C-based object-oriented architecture that
|
||||
applications. GTK has a C-based object-oriented architecture that
|
||||
allows for maximum flexibility. Bindings for many other languages have
|
||||
been written, including C++, Objective-C, Guile/Scheme, Perl, Python,
|
||||
TOM, Ada95, Free Pascal, and Eiffel.
|
||||
</para>
|
||||
<para>
|
||||
GTK+ depends on the following libraries:
|
||||
GTK depends on the following libraries:
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
@ -64,7 +64,7 @@ other widgets that display text.
|
||||
ATK is the Accessibility Toolkit. It provides a set of generic
|
||||
interfaces allowing accessibility technologies to interact with a
|
||||
graphical user interface. For example, a screen reader uses ATK to
|
||||
discover the text in an interface and read it to blind users. GTK+
|
||||
discover the text in an interface and read it to blind users. GTK
|
||||
widgets have built-in support for accessibility using the ATK
|
||||
framework.
|
||||
</para></listitem>
|
||||
@ -82,16 +82,16 @@ Use a GdkPixbuf in combination with GtkImage to display images.
|
||||
<varlistentry>
|
||||
<term>GDK</term>
|
||||
<listitem><para>
|
||||
GDK is the abstraction layer that allows GTK+ to support multiple
|
||||
GDK is the abstraction layer that allows GTK to support multiple
|
||||
windowing systems. GDK provides window system facilities on X11, Windows,
|
||||
and OS X.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>GTK+</term>
|
||||
<term>GTK</term>
|
||||
<listitem><para>
|
||||
The GTK+ library itself contains <firstterm>widgets</firstterm>,
|
||||
The GTK library itself contains <firstterm>widgets</firstterm>,
|
||||
that is, GUI components such as GtkButton or GtkTextView.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<refnamediv>
|
||||
<refname>Common Questions</refname>
|
||||
<refpurpose>
|
||||
Find answers to common questions in the GTK+ manual
|
||||
Find answers to common questions in the GTK manual
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
@ -31,13 +31,13 @@ the question you have, this list is a good place to start.
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
How do I get started with GTK+?
|
||||
How do I get started with GTK?
|
||||
</para></question>
|
||||
|
||||
<answer><para>
|
||||
The GTK+ <ulink url="https://www.gtk.org">website</ulink> offers some
|
||||
The GTK <ulink url="https://www.gtk.org">website</ulink> offers some
|
||||
<ulink url="https://www.gtk.org/documentation.php">tutorials</ulink> and other
|
||||
documentation (most of it about GTK+ 2.x, but mostly still applicable).
|
||||
documentation (most of it about GTK 2.x, but mostly still applicable).
|
||||
More documentation ranging from whitepapers to online books can be found at
|
||||
the <ulink url="https://developer.gnome.org">GNOME developer's site</ulink>.
|
||||
After studying these materials you should be well prepared to come back to
|
||||
@ -47,7 +47,7 @@ this reference manual for details.
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
Where can I get help with GTK+, submit a bug report, or make a feature
|
||||
Where can I get help with GTK, submit a bug report, or make a feature
|
||||
request?
|
||||
</para></question>
|
||||
|
||||
@ -63,7 +63,7 @@ See the <link linkend="gtk-resources">documentation on this topic</link>.
|
||||
|
||||
|
||||
<qandaentry>
|
||||
<question><para>How do I port from one GTK+
|
||||
<question><para>How do I port from one GTK
|
||||
version to another?</para></question>
|
||||
|
||||
<answer>
|
||||
@ -88,7 +88,7 @@ against the documentation.
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
How does memory management work in GTK+? Should I free data returned
|
||||
How does memory management work in GTK? Should I free data returned
|
||||
from functions?
|
||||
</para></question>
|
||||
|
||||
@ -135,7 +135,7 @@ reference counting, not floating reference counting.
|
||||
|
||||
<para>
|
||||
To get this, you must acquire a reference to the widget and drop the
|
||||
floating reference (<quote>ref and sink</quote> in GTK+ parlance) after
|
||||
floating reference (<quote>ref and sink</quote> in GTK parlance) after
|
||||
creating it:
|
||||
<informalexample><programlisting>
|
||||
foo = gtk_foo_new (<!-- -->);
|
||||
@ -158,7 +158,7 @@ to get rid of the widget.
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
How do I use GTK+ with threads?
|
||||
How do I use GTK with threads?
|
||||
</para></question>
|
||||
|
||||
<answer>
|
||||
@ -175,7 +175,7 @@ documentation for portable threading primitives.
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
How do I internationalize a GTK+ program?
|
||||
How do I internationalize a GTK program?
|
||||
</para></question>
|
||||
|
||||
<answer>
|
||||
@ -257,13 +257,13 @@ the following convenience:
|
||||
<qandaentry>
|
||||
<question>
|
||||
<para>
|
||||
How do I use non-ASCII characters in GTK+ programs ?
|
||||
How do I use non-ASCII characters in GTK programs ?
|
||||
</para>
|
||||
</question>
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
GTK+ uses <ulink url="http://www.unicode.org">Unicode</ulink> (more exactly
|
||||
GTK uses <ulink url="http://www.unicode.org">Unicode</ulink> (more exactly
|
||||
UTF-8) for all text. UTF-8 encodes each Unicode codepoint as a sequence of
|
||||
one to six bytes and has a number of nice properties which make it a good
|
||||
choice for working with Unicode text in C programs:
|
||||
@ -288,7 +288,7 @@ encodings, see g_locale_to_utf8() and g_convert().
|
||||
</para>
|
||||
<para>
|
||||
Text coming from external sources (e.g. files or user input), has to be
|
||||
converted to UTF-8 before being handed over to GTK+. The following example
|
||||
converted to UTF-8 before being handed over to GTK. The following example
|
||||
writes the content of a IS0-8859-1 encoded text file to
|
||||
<literal>stdout</literal>:
|
||||
<informalexample><programlisting>
|
||||
@ -368,24 +368,24 @@ returned in UTF-8 encoding.
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
How do I use GTK+ with C++?
|
||||
How do I use GTK with C++?
|
||||
</para></question>
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
There are two ways to approach this. The GTK+ header files use the subset
|
||||
of C that's also valid C++, so you can simply use the normal GTK+ API
|
||||
There are two ways to approach this. The GTK header files use the subset
|
||||
of C that's also valid C++, so you can simply use the normal GTK API
|
||||
in a C++ program. Alternatively, you can use a "C++ binding"
|
||||
such as <ulink url="https://www.gtkmm.org/">gtkmm</ulink>
|
||||
which provides a native C++ API.
|
||||
</para>
|
||||
<para>
|
||||
When using GTK+ directly, keep in mind that only functions can be
|
||||
When using GTK directly, keep in mind that only functions can be
|
||||
connected to signals, not methods. So you will need to use global
|
||||
functions or "static" class functions for signal connections.
|
||||
</para>
|
||||
<para>
|
||||
Another common issue when using GTK+ directly is that
|
||||
Another common issue when using GTK directly is that
|
||||
C++ will not implicitly convert an integer to an enumeration.
|
||||
This comes up when using bitfields; in C you can write the following
|
||||
code:
|
||||
@ -410,7 +410,7 @@ There are very few functions that require this cast, however.
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
How do I use GTK+ with other non-C languages?
|
||||
How do I use GTK with other non-C languages?
|
||||
</para></question>
|
||||
|
||||
<answer>
|
||||
@ -620,7 +620,7 @@ single-line text entry, see #GtkEntry.
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
#GtkImage can display images in just about any format GTK+ understands.
|
||||
#GtkImage can display images in just about any format GTK understands.
|
||||
You can also use #GtkDrawingArea if you need to do something more complex,
|
||||
such as draw text or graphics over the top of the image.
|
||||
</para>
|
||||
@ -635,7 +635,7 @@ would use a combo box?
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
With GTK+, a #GtkComboBox is the recommended widget to use for this use case.
|
||||
With GTK, a #GtkComboBox is the recommended widget to use for this use case.
|
||||
This widget looks like either a combo box or the current option menu, depending
|
||||
on the current theme. If you need an editable text entry, use the
|
||||
#GtkComboBox:has-entry property.
|
||||
@ -707,7 +707,7 @@ How do I disable/ghost/desensitize a widget?
|
||||
</para></question>
|
||||
|
||||
<answer><para>
|
||||
In GTK+ a disabled widget is termed "insensitive."
|
||||
In GTK a disabled widget is termed "insensitive."
|
||||
See gtk_widget_set_sensitive().
|
||||
</para></answer>
|
||||
</qandaentry>
|
||||
@ -931,11 +931,11 @@ See gtk_tree_view_set_expander_column() and gtk_tree_view_column_set_visible().
|
||||
|
||||
</qandadiv>
|
||||
|
||||
<qandadiv><title>Using cairo with GTK+</title>
|
||||
<qandadiv><title>Using cairo with GTK</title>
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
How do I use cairo to draw in GTK+ applications ?
|
||||
How do I use cairo to draw in GTK applications ?
|
||||
</para></question>
|
||||
|
||||
<answer><para>
|
||||
@ -943,7 +943,7 @@ The #GtkWidget::draw signal gets a ready-to-use cairo context
|
||||
as parameter that you should use.
|
||||
</para>
|
||||
<para>
|
||||
All drawing in GTK+ is normally done in a draw handler, and GTK+
|
||||
All drawing in GTK is normally done in a draw handler, and GTK
|
||||
creates a temporary pixmap for double-buffering the drawing.
|
||||
It is possible to turn off double-buffering, with
|
||||
gtk_widget_set_double_buffered(), but this is not ideal,
|
||||
@ -961,7 +961,7 @@ Glitz or GL backend of cairo ?
|
||||
<answer><para>
|
||||
No. The GDK X11 backend uses the cairo X backend (and the other
|
||||
GDK backends use their respective native cairo backends). The
|
||||
GTK+ developers believe that the best way to improving the GDK
|
||||
GTK developers believe that the best way to improving the GDK
|
||||
drawing performance is to optimize the cairo X backend and the
|
||||
relevant code paths in the X server that is uses (mostly the
|
||||
Render extension).
|
||||
|
@ -12,7 +12,7 @@
|
||||
<refnamediv>
|
||||
<refname>Mailing lists and bug reports</refname>
|
||||
<refpurpose>
|
||||
Getting help with GTK+
|
||||
Getting help with GTK
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
@ -20,7 +20,7 @@ Getting help with GTK+
|
||||
<title>Opening a bug or feature request</title>
|
||||
|
||||
<para>
|
||||
If you encounter a bug, misfeature, or missing feature in GTK+, please
|
||||
If you encounter a bug, misfeature, or missing feature in GTK, please
|
||||
file a bug report on our
|
||||
<ulink url="https://gitlab.gnome.org/GNOME/gtk/issues/new">GitLab project</ulink>.
|
||||
You should also file issues if the documentation is out of date with the
|
||||
@ -36,27 +36,27 @@ discussed, we'll add a note to that effect in the report.
|
||||
|
||||
<para>
|
||||
The bug tracker should definitely be used for feature requests, it's
|
||||
not only for bugs. We track all GTK+ development in GitLab, to ensure
|
||||
not only for bugs. We track all GTK development in GitLab, to ensure
|
||||
that nothing gets lost.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Working on GTK+</title>
|
||||
<title>Working on GTK</title>
|
||||
|
||||
<para>
|
||||
If you develop a bugfix or enhancement for GTK+, please open a merge
|
||||
If you develop a bugfix or enhancement for GTK, please open a merge
|
||||
request in GitLab as well. You should not attach patches to an issue,
|
||||
or describe the fix as a comment. Merge requests allow us to build
|
||||
GTK+ with your code applied, and run the test suite, on multiple platforms
|
||||
GTK with your code applied, and run the test suite, on multiple platforms
|
||||
and architectures, and verify that nothing breaks. They also allow us to
|
||||
do proper code reviews, so we can iterate over the changes.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You should follow the <ulink url="https://gitlab.gnome.org/GNOME/gtk/blob/master/CONTRIBUTING.md">contribution guide</ulink>
|
||||
for GTK+, available on GitLab.
|
||||
for GTK, available on GitLab.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@ -72,8 +72,8 @@ get lost, or forgotten. Always open a merge request.
|
||||
<title>Mailing lists</title>
|
||||
|
||||
<para>
|
||||
There are several mailing lists dedicated to GTK+ and related
|
||||
libraries. Discussion of GLib, Pango, and ATK in addition to GTK+
|
||||
There are several mailing lists dedicated to GTK and related
|
||||
libraries. Discussion of GLib, Pango, and ATK in addition to GTK
|
||||
proper is welcome on these lists. You can subscribe or view the
|
||||
archives of these lists on
|
||||
<ulink url="https://mail.gnome.org">http://mail.gnome.org</ulink>.
|
||||
@ -88,28 +88,28 @@ some days to happen.
|
||||
<varlistentry>
|
||||
<term><ulink url="mailto:gtk-list@gnome.org">gtk-list@gnome.org</ulink></term>
|
||||
<listitem><para>
|
||||
gtk-list covers general GTK+ topics; questions about using GTK+ in programs,
|
||||
GTK+ from a user standpoint, announcements of GTK+-related projects
|
||||
such as themes or GTK+ modules would all be on-topic. The bulk of the
|
||||
traffic consists of GTK+ programming questions.
|
||||
gtk-list covers general GTK topics; questions about using GTK in programs,
|
||||
GTK from a user standpoint, announcements of GTK-related projects
|
||||
such as themes or GTK modules would all be on-topic. The bulk of the
|
||||
traffic consists of GTK programming questions.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><ulink url="mailto:gtk-app-devel-list@gnome.org">gtk-app-devel-list@gnome.org</ulink></term>
|
||||
<listitem><para>
|
||||
gtk-app-devel-list covers writing applications in GTK+. It's narrower
|
||||
gtk-app-devel-list covers writing applications in GTK. It's narrower
|
||||
in scope than gtk-list, but the two lists overlap quite a
|
||||
bit. gtk-app-devel-list is a good place to ask questions about GTK+
|
||||
bit. gtk-app-devel-list is a good place to ask questions about GTK
|
||||
programming. </para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><ulink url="mailto:gtk-devel-list@gnome.org">gtk-devel-list@gnome.org</ulink></term>
|
||||
<listitem><para>
|
||||
gtk-devel-list is for discussion of work on GTK+ itself, it is
|
||||
gtk-devel-list is for discussion of work on GTK itself, it is
|
||||
<emphasis>not</emphasis> for
|
||||
asking questions about how to use GTK+ in applications. gtk-devel-list
|
||||
asking questions about how to use GTK in applications. gtk-devel-list
|
||||
is appropriate for discussion of patches, bugs, proposed features,
|
||||
and so on.
|
||||
</para></listitem>
|
||||
@ -118,7 +118,7 @@ and so on.
|
||||
<varlistentry>
|
||||
<term><ulink url="mailto:gtk-i18n-list@gnome.org">gtk-i18n-list@gnome.org</ulink></term>
|
||||
<listitem><para>
|
||||
gtk-i18n-list is for discussion of internationalization in GTK+;
|
||||
gtk-i18n-list is for discussion of internationalization in GTK;
|
||||
Pango is the main focus of the list. Questions about the details of
|
||||
using Pango, and discussion of proposed Pango patches or features, are
|
||||
all on topic.
|
||||
@ -129,7 +129,7 @@ all on topic.
|
||||
<term><ulink url="mailto:gtk-doc-list@gnome.org">gtk-doc-list@gnome.org</ulink></term>
|
||||
<listitem><para>
|
||||
gtk-doc-list is for discussion of the <application>gtk-doc</application>
|
||||
documentation system (used to document GTK+), and for work on the GTK+
|
||||
documentation system (used to document GTK), and for work on the GTK
|
||||
documentation.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
@ -4,26 +4,26 @@
|
||||
]>
|
||||
<refentry id="gtk-running">
|
||||
<refmeta>
|
||||
<refentrytitle>Running GTK+ Applications</refentrytitle>
|
||||
<refentrytitle>Running GTK Applications</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>Running GTK+ Applications</refname>
|
||||
<refname>Running GTK Applications</refname>
|
||||
<refpurpose>
|
||||
How to run and debug your GTK+ application
|
||||
How to run and debug your GTK application
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1>
|
||||
<title>Running and debugging GTK+ Applications</title>
|
||||
<title>Running and debugging GTK Applications</title>
|
||||
|
||||
<refsect2>
|
||||
<title>Environment variables</title>
|
||||
|
||||
<para>
|
||||
GTK+ inspects a number of environment variables in addition to standard
|
||||
GTK inspects a number of environment variables in addition to standard
|
||||
variables like <envar>LANG</envar>, <envar>PATH</envar>, <envar>HOME</envar>
|
||||
or <envar>DISPLAY</envar>; mostly to determine paths to look for certain
|
||||
files. The <link linkend="x11-envar">X11</link>,
|
||||
@ -36,8 +36,8 @@ additional environment variables.
|
||||
<title><envar>GTK_DEBUG</envar></title>
|
||||
|
||||
<para>
|
||||
Unless GTK+ has been configured with <option>--enable-debug=no</option>,
|
||||
this variable can be set to a list of debug options, which cause GTK+
|
||||
Unless GTK has been configured with <option>--enable-debug=no</option>,
|
||||
this variable can be set to a list of debug options, which cause GTK
|
||||
to print out different types of debugging information.
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
@ -126,45 +126,45 @@ additional environment variables.
|
||||
<title><envar>GTK_PATH</envar></title>
|
||||
|
||||
<para>
|
||||
Specifies a list of directories to search when GTK+ is looking for
|
||||
Specifies a list of directories to search when GTK is looking for
|
||||
dynamically loaded objects such as input method
|
||||
modules and print backends. If the path to
|
||||
the dynamically loaded object is given as an absolute path name,
|
||||
then GTK+ loads it directly.
|
||||
Otherwise, GTK+ goes in turn through the directories in <envar>GTK_PATH</envar>,
|
||||
then GTK loads it directly.
|
||||
Otherwise, GTK goes in turn through the directories in <envar>GTK_PATH</envar>,
|
||||
followed by the directory <filename>.gtk-4.0</filename> in the user's
|
||||
home directory, followed by the system default directory,
|
||||
which is <filename><replaceable>libdir</replaceable>/gtk-4.0/modules</filename>.
|
||||
(If <envar>GTK_EXE_PREFIX</envar> is defined, <replaceable>libdir</replaceable> is
|
||||
<filename>$GTK_EXE_PREFIX/lib</filename>. Otherwise it is the libdir
|
||||
specified when GTK+ was configured, usually
|
||||
specified when GTK was configured, usually
|
||||
<filename>/usr/lib</filename>, or
|
||||
<filename>/usr/local/lib</filename>.)
|
||||
For each directory in this list, GTK+ actually looks in a
|
||||
For each directory in this list, GTK actually looks in a
|
||||
subdirectory
|
||||
<filename><replaceable>directory</replaceable>/<replaceable>version</replaceable>/<replaceable>host</replaceable>/<replaceable>type</replaceable></filename>
|
||||
Where <replaceable>version</replaceable> is derived from the
|
||||
version of GTK+ (use <literal>pkg-config
|
||||
--variable=gtk_binary_version gtk+-3.0</literal> to determine this from a
|
||||
version of GTK (use <literal>pkg-config
|
||||
--variable=gtk_binary_version gtk4</literal> to determine this from a
|
||||
script), <replaceable>host</replaceable> is the architecture on
|
||||
which GTK+ was built. (use <literal>pkg-config
|
||||
--variable=gtk_host gtk+-3.0</literal> to determine this from a
|
||||
which GTK was built. (use <literal>pkg-config
|
||||
--variable=gtk_host gtk4</literal> to determine this from a
|
||||
script), and <replaceable>type</replaceable> is a directory
|
||||
specific to the type of modules; currently it can be
|
||||
<literal>modules</literal>, <literal>engines</literal>,
|
||||
<literal>immodules</literal>, <literal>filesystems</literal> or
|
||||
<literal>printbackends</literal>, corresponding to the types of
|
||||
modules mentioned above. Either <replaceable>version</replaceable>,
|
||||
<replaceable>host</replaceable>, or both may be omitted. GTK+ looks
|
||||
<replaceable>host</replaceable>, or both may be omitted. GTK looks
|
||||
first in the most specific directory, then in directories with
|
||||
fewer components.
|
||||
The components of GTK_PATH are separated by the ':' character on
|
||||
Linux and Unix, and the ';' character on Windows.
|
||||
</para>
|
||||
<warning>
|
||||
Note that this environment variable is read by GTK+ 2.x and GTK+ 3.x too,
|
||||
Note that this environment variable is read by GTK 2.x and GTK 3.x too,
|
||||
which makes it unsuitable for setting it system-wide (or session-wide),
|
||||
since doing so will cause applications using different GTK+ versions
|
||||
since doing so will cause applications using different GTK versions
|
||||
to see incompatible modules.
|
||||
</warning>
|
||||
</formalpara>
|
||||
@ -179,7 +179,7 @@ additional environment variables.
|
||||
<literal>Gtk/IMModule</literal>, that will be used for the default
|
||||
IM module.
|
||||
This also can be a colon-separated list of input-methods, which
|
||||
GTK+ will try in turn until it finds one available on the system.
|
||||
GTK will try in turn until it finds one available on the system.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
@ -187,8 +187,8 @@ additional environment variables.
|
||||
<title><envar>GTK_EXE_PREFIX</envar></title>
|
||||
|
||||
<para>
|
||||
If set, GTK+ uses <filename>$GTK_EXE_PREFIX/lib</filename> instead of
|
||||
the libdir configured when GTK+ was compiled.
|
||||
If set, GTK uses <filename>$GTK_EXE_PREFIX/lib</filename> instead of
|
||||
the libdir configured when GTK was compiled.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
@ -196,8 +196,8 @@ additional environment variables.
|
||||
<title><envar>GTK_DATA_PREFIX</envar></title>
|
||||
|
||||
<para>
|
||||
If set, makes GTK+ use <filename>$GTK_DATA_PREFIX</filename>
|
||||
instead of the prefix configured when GTK+ was compiled.
|
||||
If set, makes GTK use <filename>$GTK_DATA_PREFIX</filename>
|
||||
instead of the prefix configured when GTK was compiled.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
@ -205,7 +205,7 @@ additional environment variables.
|
||||
<title><envar>GTK_THEME</envar></title>
|
||||
|
||||
<para>
|
||||
If set, makes GTK+ use the named theme instead of the theme
|
||||
If set, makes GTK use the named theme instead of the theme
|
||||
that is specified by the gtk-theme-name setting. This is intended
|
||||
mainly for easy debugging of theme issues.
|
||||
</para>
|
||||
@ -217,7 +217,7 @@ additional environment variables.
|
||||
|
||||
<para>
|
||||
The following environment variables are used by GdkPixbuf, GDK or
|
||||
Pango, not by GTK+ itself, but we list them here for completeness
|
||||
Pango, not by GTK itself, but we list them here for completeness
|
||||
nevertheless.
|
||||
</para>
|
||||
|
||||
@ -229,7 +229,7 @@ nevertheless.
|
||||
This environment variable overrides the default value
|
||||
<filename><replaceable>libdir</replaceable>/gtk-4.0/4.0.0/loaders.cache</filename>
|
||||
(<replaceable>libdir</replaceable> is the sysconfdir specified when
|
||||
GTK+ was configured, usually <filename>/usr/local/lib</filename>.)
|
||||
GTK was configured, usually <filename>/usr/local/lib</filename>.)
|
||||
</para>
|
||||
<para>
|
||||
The <filename>loaders.cache</filename> file is generated by the
|
||||
@ -241,7 +241,7 @@ nevertheless.
|
||||
<title><envar>GDK_DEBUG</envar></title>
|
||||
|
||||
<para>
|
||||
If GTK+ has been configured with <option>--enable-debug=yes</option>,
|
||||
If GTK has been configured with <option>--enable-debug=yes</option>,
|
||||
this variable can be set to a list of debug options, which cause GDK
|
||||
to print out different types of debugging information.
|
||||
<variablelist>
|
||||
@ -331,7 +331,7 @@ nevertheless.
|
||||
<title><envar>GSK_DEBUG</envar></title>
|
||||
|
||||
<para>
|
||||
If GTK+ has been configured with <option>--enable-debug=yes</option>,
|
||||
If GTK has been configured with <option>--enable-debug=yes</option>,
|
||||
this variable can be set to a list of debug options, which cause GSK
|
||||
to print out different types of debugging information.
|
||||
<variablelist>
|
||||
@ -406,7 +406,7 @@ nevertheless.
|
||||
|
||||
<para>
|
||||
If set, selects the GDK backend to use. Selecting a backend requires that
|
||||
GTK+ is compiled with support for that backend. The following backends can
|
||||
GTK is compiled with support for that backend. The following backends can
|
||||
be selected, provided they are included in the GDK libraries you are using:
|
||||
<variablelist>
|
||||
|
||||
@ -498,7 +498,7 @@ nevertheless.
|
||||
|
||||
<para>
|
||||
The default value of this environment variable is 1. If changed to 0, this
|
||||
disables the default use of client-side decorations on GTK+ windows, thus
|
||||
disables the default use of client-side decorations on GTK windows, thus
|
||||
making the window manager responsible for drawing the decorations of
|
||||
windows that do not have a custom titlebar widget.
|
||||
</para>
|
||||
@ -512,7 +512,7 @@ nevertheless.
|
||||
<title><envar>XDG_DATA_HOME</envar>, <envar>XDG_DATA_DIRS</envar></title>
|
||||
|
||||
<para>
|
||||
GTK+ uses these environment variables to locate icon themes
|
||||
GTK uses these environment variables to locate icon themes
|
||||
and MIME information. For more information, see
|
||||
<ulink url="https://freedesktop.org/Standards/icon-theme-spec">Icon Theme Specification</ulink>,
|
||||
the <ulink url="https://freedesktop.org/Standards/shared-mime-info-spec">Shared MIME-info Database</ulink>
|
||||
@ -524,9 +524,9 @@ nevertheless.
|
||||
<title><envar>DESKTOP_STARTUP_ID</envar></title>
|
||||
|
||||
<para>
|
||||
GTK+ uses this environment variable to provide startup notification
|
||||
GTK uses this environment variable to provide startup notification
|
||||
according to the <ulink url="https://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">Startup Notification Spec</ulink>.
|
||||
Following the specification, GTK+ unsets this variable after reading
|
||||
Following the specification, GTK unsets this variable after reading
|
||||
it (to keep it from leaking to child processes). So, if you need its
|
||||
value for your own purposes, you have to read it before calling
|
||||
gtk_init().
|
||||
@ -541,20 +541,20 @@ nevertheless.
|
||||
<inlinegraphic fileref="inspector.png" format="PNG"></inlinegraphic>
|
||||
|
||||
<para>
|
||||
GTK+ includes an interactive debugger, called the GTK+ Inspector, which
|
||||
lets you explore the widget tree of any GTK+ application at runtime, as
|
||||
GTK includes an interactive debugger, called the GTK Inspector, which
|
||||
lets you explore the widget tree of any GTK application at runtime, as
|
||||
well as tweak the theme and trigger visual debugging aids. You can
|
||||
easily try out changes at runtime before putting them into the code.
|
||||
</para>
|
||||
<para>
|
||||
Note that the GTK+ inspector can only show GTK+ internals. It can not
|
||||
understand the application-specific logic of a GTK+ application. Also,
|
||||
the fact that the GTK+ inspector is running in the application process
|
||||
Note that the GTK inspector can only show GTK internals. It can not
|
||||
understand the application-specific logic of a GTK application. Also,
|
||||
the fact that the GTK inspector is running in the application process
|
||||
limits what it can do. It is meant as a complement to full-blown debuggers
|
||||
and system tracing facilities such as DTrace, not as a replacement.
|
||||
</para>
|
||||
<para>
|
||||
To enable the GTK+ inspector, you can use the Control-Shift-I or
|
||||
To enable the GTK inspector, you can use the Control-Shift-I or
|
||||
Control-Shift-D keyboard shortcuts, or set the
|
||||
<envar>GTK_DEBUG=interactive</envar> environment variable.
|
||||
</para>
|
||||
@ -567,7 +567,7 @@ nevertheless.
|
||||
|
||||
<para>
|
||||
In some situations, it may be inappropriate to give users access to the
|
||||
GTK+ inspector. The keyboard shortcuts can be disabled with the
|
||||
GTK inspector. The keyboard shortcuts can be disabled with the
|
||||
`enable-inspector-keybinding` key in the `org.gtk.Settings.Debug`
|
||||
GSettings schema.
|
||||
</para>
|
||||
|
@ -18,14 +18,14 @@
|
||||
<title>Conceptual Overview</title>
|
||||
|
||||
<para>
|
||||
GTK+ has an extremely powerful framework for multiline text editing. The
|
||||
GTK has an extremely powerful framework for multiline text editing. The
|
||||
primary objects involved in the process are #GtkTextBuffer, which represents the
|
||||
text being edited, and #GtkTextView, a widget which can display a #GtkTextBuffer.
|
||||
Each buffer can be displayed by any number of views.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
One of the important things to remember about text in GTK+ is that it's in the
|
||||
One of the important things to remember about text in GTK is that it's in the
|
||||
UTF-8 encoding. This means that one character can be encoded as multiple
|
||||
bytes. Character counts are usually referred to as
|
||||
<firstterm>offsets</firstterm>, while byte counts are called
|
||||
@ -197,7 +197,7 @@ foreground color — use CSS to override their default values.
|
||||
|
||||
<para>
|
||||
The <application>gtk-demo</application> application that comes with
|
||||
GTK+ contains more example code for #GtkTextView.
|
||||
GTK contains more example code for #GtkTextView.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<refsect1>
|
||||
<title>Overview</title>
|
||||
<para>
|
||||
To create a tree or list in GTK+, use the #GtkTreeModel interface in
|
||||
To create a tree or list in GTK, use the #GtkTreeModel interface in
|
||||
conjunction with the #GtkTreeView widget. This widget is
|
||||
designed around a <firstterm>Model/View/Controller</firstterm>
|
||||
design and consists of four major parts:
|
||||
@ -46,7 +46,7 @@
|
||||
<refsect1>
|
||||
<title>Creating a model</title>
|
||||
<para>
|
||||
GTK+ provides two simple models that can be used: the #GtkListStore
|
||||
GTK provides two simple models that can be used: the #GtkListStore
|
||||
and the #GtkTreeStore. GtkListStore is used to model list widgets,
|
||||
while the GtkTreeStore models trees. It is possible to develop a new
|
||||
type of model, but the existing models should be satisfactory for all
|
||||
@ -164,7 +164,7 @@ tree = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
|
||||
</para>
|
||||
<para>
|
||||
Cell renderers are used to draw the data in the tree model in a
|
||||
way. There are a number of cell renderers that come with GTK+,
|
||||
way. There are a number of cell renderers that come with GTK,
|
||||
including the #GtkCellRendererText, #GtkCellRendererPixbuf and
|
||||
the #GtkCellRendererToggle.
|
||||
It is relatively easy to write a custom renderer.
|
||||
|
@ -4,23 +4,23 @@
|
||||
]>
|
||||
<refentry id="gtk-wayland">
|
||||
<refmeta>
|
||||
<refentrytitle>Using GTK+ with Wayland</refentrytitle>
|
||||
<refentrytitle>Using GTK with Wayland</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>Using GTK+ with Wayland</refname>
|
||||
<refname>Using GTK with Wayland</refname>
|
||||
<refpurpose>
|
||||
Wayland-specific aspects of using GTK+
|
||||
Wayland-specific aspects of using GTK
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1>
|
||||
<title>Using GTK+ with Wayland</title>
|
||||
<title>Using GTK with Wayland</title>
|
||||
|
||||
<para>
|
||||
The GDK Wayland backend provides support for running GTK+ applications
|
||||
The GDK Wayland backend provides support for running GTK applications
|
||||
under the Wayland display server. To run your application in this way,
|
||||
select the Wayland backend by setting <literal>GDK_BACKEND=wayland</literal>.
|
||||
</para>
|
||||
|
@ -4,24 +4,24 @@
|
||||
]>
|
||||
<refentry id="gtk-windows">
|
||||
<refmeta>
|
||||
<refentrytitle>Using GTK+ on Windows</refentrytitle>
|
||||
<refentrytitle>Using GTK on Windows</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>Using GTK+ on Windows</refname>
|
||||
<refname>Using GTK on Windows</refname>
|
||||
<refpurpose>
|
||||
Windows-specific aspects of using GTK+
|
||||
Windows-specific aspects of using GTK
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1>
|
||||
<title>Using GTK+ on Windows</title>
|
||||
<title>Using GTK on Windows</title>
|
||||
|
||||
<para>
|
||||
The Windows port of GTK+ is an implementation of GDK (and therefore GTK+)
|
||||
on top of the Win32 API. When compiling GTK+ on Windows, this backend is
|
||||
The Windows port of GTK is an implementation of GDK (and therefore GTK)
|
||||
on top of the Win32 API. When compiling GTK on Windows, this backend is
|
||||
the default.
|
||||
</para>
|
||||
|
||||
@ -82,7 +82,7 @@ additional environment variables.
|
||||
<title><envar>GDK_IGNORE_WINTAB</envar></title>
|
||||
|
||||
<para>
|
||||
If this variable is set, GTK+ doesn't use
|
||||
If this variable is set, GTK doesn't use
|
||||
the Wintab API for tablet support.
|
||||
</para>
|
||||
</formalpara>
|
||||
@ -91,7 +91,7 @@ the Wintab API for tablet support.
|
||||
<title><envar>GDK_USE_WINTAB</envar></title>
|
||||
|
||||
<para>
|
||||
If this variable is set, GTK+ uses the Wintab API for
|
||||
If this variable is set, GTK uses the Wintab API for
|
||||
tablet support. This is the default.
|
||||
</para>
|
||||
</formalpara>
|
||||
@ -120,7 +120,7 @@ When any other cursor theme is used, GTK will prefer cursors from that theme,
|
||||
falling back to Windows cursors and built-in X cursors.
|
||||
</para>
|
||||
<para>
|
||||
Theme can be changed by setting <literal>gtk-cursor-theme-name</literal> GTK+ setting. Users can override GTK+ settings in the <filename>settings.ini</filename> file or at runtime in the GTK+ Inspector.
|
||||
Theme can be changed by setting <literal>gtk-cursor-theme-name</literal> GTK setting. Users can override GTK settings in the <filename>settings.ini</filename> file or at runtime in the GTK Inspector.
|
||||
</para>
|
||||
<para>
|
||||
Themes are loaded from normal Windows variants of the XDG locations:
|
||||
@ -135,9 +135,9 @@ The <literal>gtk-cursor-theme-size</literal> setting is ignored, GTK will use th
|
||||
</refsect2>
|
||||
|
||||
<para>
|
||||
More information about GTK+ on Windows, including detailed build
|
||||
More information about GTK on Windows, including detailed build
|
||||
instructions, binary downloads, etc, can be found
|
||||
<ulink url="https://wiki.gnome.org/Projects/GTK+/Win32">online</ulink>.
|
||||
<ulink url="https://wiki.gnome.org/Projects/GTK/Win32">online</ulink>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
@ -4,23 +4,23 @@
|
||||
]>
|
||||
<refentry id="gtk-x11">
|
||||
<refmeta>
|
||||
<refentrytitle>Using GTK+ on the X Window System</refentrytitle>
|
||||
<refentrytitle>Using GTK on the X Window System</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>Using GTK+ on the X Window System</refname>
|
||||
<refname>Using GTK on the X Window System</refname>
|
||||
<refpurpose>
|
||||
X11-specific aspects of using GTK+
|
||||
X11-specific aspects of using GTK
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1>
|
||||
<title>GTK+ for the X Window System</title>
|
||||
<title>GTK for the X Window System</title>
|
||||
|
||||
<para>
|
||||
On UNIX, the X backend is the default build for GTK+.
|
||||
On UNIX, the X backend is the default build for GTK.
|
||||
So you don't need to do anything special when compiling it,
|
||||
and everything should "just work."
|
||||
</para>
|
||||
@ -145,7 +145,7 @@ url="http://www.freedesktop.org/standards/">convention</ulink>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
GTK+ has functions for asking the window manager to do various things;
|
||||
GTK has functions for asking the window manager to do various things;
|
||||
see for example <link
|
||||
linkend="gtk-window-iconify">gtk_window_iconify()</link> or <link
|
||||
linkend="gtk-window-maximize">gtk_window_maximize()</link> or <link
|
||||
|
@ -1,8 +1,8 @@
|
||||
The doc shooter is used to take screenshots of widgets for the GTK+
|
||||
The doc shooter is used to take screenshots of widgets for the GTK
|
||||
reference manuals. We use these images for both the headers of the
|
||||
images, and for the visual index of GNOME images. They aren't part of
|
||||
the docs build. Instead, the images are taken, and then copied by hand
|
||||
into gtk+/docs/reference/gtk/images/
|
||||
into gtk/docs/reference/gtk/images/
|
||||
|
||||
Ideally, the images should be taken once a release, and all images
|
||||
should be updated at the same time. A simple theme should be used to
|
||||
|
@ -856,13 +856,13 @@ create_about_dialog (void)
|
||||
|
||||
widget = gtk_about_dialog_new ();
|
||||
g_object_set (widget,
|
||||
"program-name", "GTK+ Code Demos",
|
||||
"program-name", "GTK Code Demos",
|
||||
"version", PACKAGE_VERSION,
|
||||
"copyright", "© 1997-2013 The GTK+ Team",
|
||||
"copyright", "© 1997-2013 The GTK Team",
|
||||
"website", "http://www.gtk.org",
|
||||
"comments", "Program to demonstrate GTK+ functions.",
|
||||
"comments", "Program to demonstrate GTK functions.",
|
||||
"logo-icon-name", "help-about",
|
||||
"title", "About GTK+ Code Demos",
|
||||
"title", "About GTK Code Demos",
|
||||
"authors", authors,
|
||||
NULL);
|
||||
gtk_window_set_icon_name (GTK_WINDOW (widget), "help-about");
|
||||
|
@ -1,5 +1,5 @@
|
||||
Notes about the inner workings of the widget system of GTK+
|
||||
===========================================================
|
||||
Notes about the inner workings of the widget system of GTK
|
||||
==========================================================
|
||||
|
||||
This file contains some notes as to how the widget system does
|
||||
and should work. It consists of three parts:
|
||||
|
Loading…
Reference in New Issue
Block a user