Compare commits

..

3 Commits

Author SHA1 Message Date
Ernestas Kulik
cb7202ac6f gtkselection: Drop gtk_selection_data_get_targets()
As the data isn’t set anywhere with the type “ATOM”, this doesn’t work
as expected and can be replaced by a target atom check.
2018-07-31 23:29:26 +03:00
Ernestas Kulik
ef632da8b6 gtkselection: Drop format field
It’s not used anywhere in a meaningful way and looks safe to rip out and
replace with a hardcoded constant where appropriate.
2018-07-31 23:29:26 +03:00
Ernestas Kulik
0967f6f3fc tests: testdnd: Use G_N_ELEMENTS macro
Wasted some horizontal screen estate, but beats rolling our own thing.
2018-07-31 23:29:26 +03:00
791 changed files with 68888 additions and 92030 deletions

1
.gitignore vendored
View File

@@ -1 +0,0 @@
/subprojects/*/

View File

@@ -13,7 +13,7 @@ stages:
- subprojects/pango/
fedora-x86_64:
image: registry.gitlab.gnome.org/gnome/gtk/master:v2
image: registry.gitlab.gnome.org/gnome/gtk/master:v1
stage: build
script:
- bash -x ./.gitlab-ci/test-docker.sh
@@ -64,7 +64,7 @@ flatpak:widget-factory:
<<: *flatpak-defaults
pages:
image: registry.gitlab.gnome.org/gnome/gtk/master:v2
image: registry.gitlab.gnome.org/gnome/gtk/master:v1
stage: deploy
script:
- meson -Ddocumentation=true _build .

View File

@@ -1,4 +1,4 @@
FROM fedora:29
FROM fedora:28
RUN dnf -y install \
hicolor-icon-theme \
@@ -33,7 +33,6 @@ RUN dnf -y install \
iso-codes \
itstool \
json-glib-devel \
lcov \
libattr-devel \
libepoxy-devel \
libffi-devel \
@@ -70,7 +69,7 @@ RUN dnf -y install \
xorg-x11-server-Xvfb \
&& dnf clean all
RUN pip3 install meson==0.49.0
RUN pip3 install meson
ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID}

View File

@@ -2,7 +2,7 @@
set -e
TAG="registry.gitlab.gnome.org/gnome/gtk/master:v2"
TAG="registry.gitlab.gnome.org/gnome/gtk/master:v1"
sudo docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \
--file "Dockerfile" .

View File

@@ -1,144 +1,31 @@
# Contribution guidelines
Thank you for considering contributing to the GTK project!
These guidelines are meant for new contributors, regardless of their level
of proficiency; following them allows the maintainers of the GTK project to
more effectively evaluate your contribution, and provide prompt feedback to
you. Additionally, by following these guidelines you clearly communicate
that you respect the time and effort that the people developing GTK put into
managing the project.
GTK is a complex free software GUI toolkit, and it would not exist without
contributions from the free and open source software community. There are
many things that we value:
- bug reporting and fixing
- documentation and examples
- tests
- new features
Please, do not use the issue tracker for support questions. If you have
questions on how to use GTK effectively, you can use:
- the `#gtk` IRC channel on irc.gnome.org
- the [gtk](https://mail.gnome.org/mailman/listinfo/gtk-list) mailing list,
for general questions on GTK
- the [gtk-app-devel](https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list)
mailing list, for questions on application development with GTK
- the [gtk-devel](https://mail.gnome.org/mailman/listinfo/gtk-devel-list)
mailing list, for questions on developing GTK itself
You can also look at the GTK tag on [Stack
Overflow](https://stackoverflow.com/questions/tagged/gtk).
The issue tracker is meant to be used for actionable issues only.
## How to report bugs
### Security issues
You should not open a new issue for security related questions.
When in doubt, send an email to the [security](mailto:security@gnome.org)
mailing list.
### Bug reports
If you're reporting a bug make sure to list:
0. which version of GTK are you using?
0. which operating system are you using?
0. the necessary steps to reproduce the issue
0. the expected outcome
0. a description of the behavior; screenshots are also welcome
0. a small, self-contained example exhibiting the behavior; if this
is not available, try reproducing the issue using the GTK examples
or interactive tests
If the issue includes a crash, you should also include:
0. the eventual warnings printed on the terminal
0. a backtrace, obtained with tools such as GDB or LLDB
For small issues, such as:
- spelling/grammar fixes in the documentation
- typo correction
- comment clean ups
- changes to metadata files (CI, `.gitignore`)
- build system changes
- source tree clean ups and reorganizations
You should directly open a merge request instead of filing a new issue.
### Features and enhancements
Feature discussion can be open ended and require high bandwidth channels; if
you are proposing a new feature on the issue tracker, make sure to make
an actionable proposal, and list:
0. what you're trying to achieve
0. prior art, in other toolkits or applications
0. design and theming changes
If you're proposing the integration of new features it helps to have
multiple applications using shared or similar code, especially if they have
iterated over it various times.
Each feature should also come fully documented, and with tests.
## Your first contribution
### Prerequisites
If you want to contribute to the GTK project, you will need to have the
development tools appropriate for your operating system, including:
If you want to hack on the GTK+ project, you'll need to have the development
tools appropriate for your operating system, including:
- Python 3.x
- Meson
- Ninja
- Gettext (19.7 or newer)
- a [C99 compatible compiler](https://wiki.gnome.org/Projects/GLib/CompilerRequirements)
- a C99 compatible compiler
Up-to-date instructions about developing GNOME applications and libraries
can be found on [the GNOME Developer Center](https://developer.gnome.org).
can be found here:
The GTK project uses GitLab for code hosting and for tracking issues. More
information about using GitLab can be found [on the GNOME
wiki](https://wiki.gnome.org/GitLab).
* https://developer.gnome.org
### Dependencies
Information about using GitLab with GNOME can be found here:
In order to get GTK from Git installed on your system, you need to have the
required versions of all the software dependencies required by GTK; typically,
this means a recent version of GLib, Cairo, Pango, and ATK, as well as the
platform-specific dependencies for the windowing system you are using (Wayland,
X11, Windows, or macOS).
* https://wiki.gnome.org/GitLab
The core dependencies for GTK are:
- [GLib, GObject, and GIO](https://gitlab.gnome.org/GNOME/glib)
- [Cairo](http://cairographics.org)
- [Pango](https://gitlab.gnome.org/GNOME/pango)
- [GdkPixbuf](https://gitlab.gnome.org/GNOME/gdk-pixbuf)
- [Epoxy](https://github.com/anholt/libepoxy)
- [ATK](https://gitlab.gnome.org/GNOME/atk)
- [Graphene](https://github.com/ebassi/graphene)
GTK will attempt to download and build some of these dependencies if it
cannot find them on your system.
Additionally, you may want to look at projects that create a development
environment for you, like [jhbuild](https://wiki.gnome.org/HowDoI/Jhbuild)
and [gvsbuild](https://github.com/wingtk/gvsbuild).
### Getting started
In order to get Git GTK+ installed on your system, you need to have the
required versions of all the GTK+ dependencies; typically, this means a
recent version of GLib, Cairo, Pango, and ATK, as well as the platform
specific dependencies for the windowing system you are using (Wayland, X11,
Windows, or macOS).
You should start by forking the GTK repository from the GitLab web UI, and
cloning from your fork:
```sh
```ssh
$ git clone https://gitlab.gnome.org/yourusername/gtk.git
$ cd gtk
```
@@ -151,7 +38,7 @@ $ git clone git@gitlab.gnome.org:GNOME/gtk.git
$ cd gtk
```
To compile the Git version of GTK on your system, you will need to
To compile the Git version of GTK+ on your system, you will need to
configure your build using Meson:
```sh
@@ -160,6 +47,11 @@ $ cd _builddir
$ ninja
```
**Note**: For information about submitting patches and pushing changes
to Git, see the `README.md` and `README.commits` files. In particular,
don't, under any circumstances, push anything to Git before reading and
understanding `README.commmits`.
Typically, you should work on your own branch:
```sh
@@ -168,99 +60,6 @@ $ git checkout -b your-branch
Once you've finished working on the bug fix or feature, push the branch
to the Git repository and open a new merge request, to let the GTK
maintainers review your contribution.
### Code reviews
Each contribution is reviewed by the core developers of the GTK project.
The [CODE-OWNERS](./docs/CODE-OWNERS) document contains the list of core
contributors to GTK and the areas for which they are responsible; you
should ensure to receive their review and signoff on your changes.
### Commit messages
The expected format for git commit messages is as follows:
```plain
Short explanation of the commit
Longer explanation explaining exactly what's changed, whether any
external or private interfaces changed, what bugs were fixed (with bug
tracker reference if applicable) and so forth. Be concise but not too
brief.
Closes #1234
```
- Always add a brief description of the commit to the _first_ line of
the commit and terminate by two newlines (it will work without the
second newline, but that is not nice for the interfaces).
- First line (the brief description) must only be one sentence and
should start with a capital letter unless it starts with a lowercase
symbol or identifier. Don't use a trailing period either. Don't exceed
72 characters.
- The main description (the body) is normal prose and should use normal
punctuation and capital letters where appropriate. Consider the commit
message as an email sent to the developers (or yourself, six months
down the line) detailing **why** you changed something. There's no need
to specify the **how**: the changes can be inlined.
- When committing code on behalf of others use the `--author` option, e.g.
`git commit -a --author "Joe Coder <joe@coder.org>"` and `--signoff`.
- If your commit is addressing an issue, use the
[GitLab syntax](https://docs.gitlab.com/ce/user/project/issues/automatic_issue_closing.html)
to automatically close the issue when merging the commit with the upstream
repository:
```plain
Closes #1234
Fixes #1234
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1234
```
- If you have a merge request with multiple commits and none of them
completely fixes an issue, you should add a reference to the issue in
the commit message, e.g. `Bug: #1234`, and use the automatic issue
closing syntax in the description of the merge request.
### Commit access to the GTK repository
GTK is part of the GNOME infrastructure. At the current time, any
person with write access to the GNOME repository can merge changes to
GTK. This is a good thing, in that it encourages many people to work
on GTK, and progress can be made quickly. However, GTK is a fairly
large and complicated project on which many other things depend, so to
avoid unnecessary breakage, and to take advantage of the knowledge
about GTK that has been built up over the years, we'd like to ask
people committing to GTK to follow a few rules:
0. Ask first. If your changes are major, or could possibly break existing
code, you should always ask. If your change is minor and you've been
working on GTK for a while it probably isn't necessary to ask. But when
in doubt, ask. Even if your change is correct, somebody may know a
better way to do things. If you are making changes to GTK, you should
be subscribed to the [gtk-devel](https://mail.gnome.org/mailman/listinfo/gtk-devel-list)
mailing list; this is a good place to ask about intended changes.
The `#gtk` IRC channel on irc.gnome.org is also a good place to find GTK
developers to discuss changes, but if you live outside of the EU/US time
zones, an email to the gtk-devel mailing list is the most certain and
preferred method.
0. Ask _first_.
0. Always write a meaningful commit message. Changes without a sufficient
commit message will be reverted.
0. Never push to the `master` branch, or any stable branches, directly; you
should always go through a merge request, to ensure that the code is
tested on the CI infrastructure at the very least. A merge request is
also the proper place to get a comprehensive code review from the core
developers of GTK.
If you have been contributing to GTK for a while and you don't have commit
access to the repository, you may ask to obtain it following the [GNOME account
process](https://wiki.gnome.org/AccountsTeam/NewAccounts).
maintainers review your contribution. The [CODE-OWNERS](./docs-CODE-OWNERS)
document contains the list of core contributors to GTK and the areas for
which they are responsible.

72
README.commits Normal file
View File

@@ -0,0 +1,72 @@
GTK+ is part of the GNOME git repository. At the current time, any
person with write access to the GNOME repository, can make changes to
GTK+. This is a good thing, in that it encourages many people to work
on GTK+, and progress can be made quickly. However, GTK+ is a fairly
large and complicated package that many other things depend on, so to
avoid unnecessary breakage, and to take advantage of the knowledge
about GTK+ that has been built up over the years, we'd like to ask
people committing to GTK+ to follow a few rules:
0) Ask first. If your changes are major, or could possibly break existing
code, you should always ask. If your change is minor and you've
been working on GTK+ for a while it probably isn't necessary
to ask. But when in doubt, ask. Even if your change is correct,
somebody may know a better way to do things.
If you are making changes to GTK+, you should be subscribed
to gtk-devel-list@gnome.org. (Subscription address:
gtk-devel-list-request@gnome.org.) This is a good place to ask
about intended changes.
#gtk+ on GIMPNet (irc.gimp.org, irc.us.gimp.org, irc.eu.gimp.org, ...)
is also a good place to find GTK+ developers to discuss changes with,
however, email to gtk-devel-list is the most certain and preferred
method.
1) Ask _first_.
2) With git, we no longer maintain a ChangeLog file, but you are expected
to produce a meaningful commit message. Changes without a sufficient
commit message will be reverted. See below for the expected format
of commit messages.
Notes:
* When developing larger features or complicated bug fixes, it is
advisable to work in a branch in your own cloned GTK+ repository.
You may even consider making your repository publically available
so that others can easily test and review your changes.
* The expected format for git commit messages is as follows:
=== begin example commit ===
Short explanation of the commit
Longer explanation explaining exactly what's changed, whether any
external or private interfaces changed, what bugs were fixed (with bug
tracker reference if applicable) and so forth. Be concise but not too brief.
=== end example commit ===
- Always add a brief description of the commit to the _first_ line of
the commit and terminate by two newlines (it will work without the
second newline, but that is not nice for the interfaces).
- First line (the brief description) must only be one sentence and
should start with a capital letter unless it starts with a lowercase
symbol or identifier. Don't use a trailing period either. Don't exceed
72 characters.
- The main description (the body) is normal prose and should use normal
punctuation and capital letters where appropriate. Normally, for patches
sent to a mailing list it's copied from there.
- When committing code on behalf of others use the --author option, e.g.
git commit -a --author "Joe Coder <joe@coder.org>" and --signoff.
Owen Taylor
13 Aug 1998
17 Apr 2001
Matthias Clasen
31 Mar 2009

View File

@@ -1,17 +1,17 @@
GTK — The GTK toolkit
=====================
GTK+ — The GTK toolkit
======================
[![Build Status](https://gitlab.gnome.org/GNOME/gtk/badges/master/build.svg)](https://gitlab.gnome.org/GNOME/gtk/pipelines)
General information
-------------------
GTK is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK is suitable for projects ranging
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects ranging
from small one-off projects to complete application suites.
GTK is free software and part of the GNU Project. However, the
licensing terms for GTK, the GNU LGPL, allow it to be used by all
GTK+ is free software and part of the GNU Project. However, the
licensing terms for GTK+, the GNU LGPL, allow it to be used by all
developers, including those developing proprietary software, without any
license fees or royalties.
@@ -31,15 +31,10 @@ Information about mailing lists can be found at
- http://www.gtk.org/mailing-lists.php
Nightly documentation can be found at
- Gtk: https://gnome.pages.gitlab.gnome.org/gtk/gtk/
- Gdk: https://gnome.pages.gitlab.gnome.org/gtk/gdk/
- Gsk: https://gnome.pages.gitlab.gnome.org/gtk/gsk/
Building and installing
-----------------------
In order to build GTK you will need:
In order to build GTK+ you will need:
- [a C99 compatible compiler](https://wiki.gnome.org/Projects/GLib/CompilerRequirements)
- [Python 3](https://www.python.org/)
@@ -79,7 +74,7 @@ If you are building the Wayland backend, you will also need:
- Wayland-cursor
- Wayland-EGL
Once you have all the necessary dependencies, you can build GTK by using
Once you have all the necessary dependencies, you can build GTK+ by using
Meson:
```sh
@@ -94,7 +89,7 @@ You can run the test suite using:
$ meson test
```
And, finally, you can install GTK using:
And, finally, you can install GTK+ using:
```
$ sudo ninja install
@@ -118,10 +113,10 @@ In the bug report please include:
* Information about your system. For instance:
- which version of GTK you are using
- which version of GTK+ you are using
- what operating system and version
- for Linux, which distribution
- if you built GTK, the list of options used to configure the build
- if you built GTK+, the list of options used to configure the build
And anything else you think is relevant.
@@ -143,7 +138,7 @@ In the bug report please include:
Release notes
-------------
The release notes for GTK are part of the migration guide in the API
The release notes for GTK+ are part of the migration guide in the API
reference. See:
- [3.x release notes](https://developer.gnome.org/gtk3/unstable/gtk-migrating-2-to-3.html)
@@ -152,7 +147,7 @@ reference. See:
Licensing terms
---------------
GTK is released under the terms of the GNU Lesser General Public License,
GTK+ is released under the terms of the GNU Lesser General Public License,
version 2.1 or, at your option, any later version, as published by the Free
Software Foundation.

View File

@@ -5,6 +5,7 @@
"sdk": "org.gnome.Sdk",
"command": "gtk4-demo",
"tags": ["devel", "development", "nightly"],
"rename-desktop-file": "gtk4-demo.desktop",
"rename-icon": "gtk4-demo",
"desktop-file-name-prefix": "(Development) ",
"finish-args": [

View File

@@ -5,6 +5,7 @@
"sdk": "org.gnome.Sdk",
"command": "gtk4-widget-factory",
"tags": ["devel", "development", "nightly"],
"rename-desktop-file": "gtk4-widget-factory.desktop",
"rename-icon": "gtk4-widget-factory",
"desktop-file-name-prefix": "(Development) ",
"finish-args": [

View File

@@ -200,20 +200,20 @@ activate_about (GSimpleAction *action,
};
gtk_show_about_dialog (GTK_WINDOW (window),
"program-name", "GTK Code Demos",
"version", g_strdup_printf ("%s,\nRunning against GTK %d.%d.%d",
"program-name", "GTK+ Code Demos",
"version", g_strdup_printf ("%s,\nRunning against GTK+ %d.%d.%d",
PACKAGE_VERSION,
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ()),
"copyright", "(C) 1997-2013 The GTK Team",
"copyright", "(C) 1997-2013 The GTK+ Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK functions.",
"comments", "Program to demonstrate GTK+ functions.",
"authors", authors,
"documenters", documentors,
"logo-icon-name", "gtk4-demo",
"title", "About GTK Code Demos",
"title", "About GTK+ Code Demos",
NULL);
}
@@ -455,16 +455,13 @@ demo_application_window_constructed (GObject *object)
}
static void
demo_application_window_size_allocate (GtkWidget *widget,
int width,
int height,
int baseline)
demo_application_window_size_allocate (GtkWidget *widget,
const GtkAllocation *allocation,
int baseline)
{
DemoApplicationWindow *window = (DemoApplicationWindow *)widget;
GTK_WIDGET_CLASS (demo_application_window_parent_class)->size_allocate (widget,
width,
height,
GTK_WIDGET_CLASS (demo_application_window_parent_class)->size_allocate (widget, allocation,
baseline);
if (!window->maximized && !window->fullscreen)

View File

@@ -96,12 +96,12 @@ create_page1 (GtkWidget *assistant)
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
label = gtk_label_new ("You must fill out this entry to continue:");
gtk_container_add (GTK_CONTAINER (box), label);
gtk_box_pack_start (GTK_BOX (box), label);
entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
gtk_widget_set_valign (entry, GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (box), entry);
gtk_box_pack_start (GTK_BOX (box), entry);
g_signal_connect (G_OBJECT (entry), "changed",
G_CALLBACK (on_entry_changed), assistant);
@@ -119,7 +119,7 @@ create_page2 (GtkWidget *assistant)
checkbutton = gtk_check_button_new_with_label ("This is optional data, you may continue "
"even if you do not check this");
gtk_container_add (GTK_CONTAINER (box), checkbutton);
gtk_box_pack_start (GTK_BOX (box), checkbutton);
gtk_assistant_append_page (GTK_ASSISTANT (assistant), box);
gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), box, TRUE);

127
demos/gtk-demo/button_box.c Normal file
View File

@@ -0,0 +1,127 @@
/* Button Boxes
*
* The Button Box widgets are used to arrange buttons with padding.
*/
#include <glib/gi18n.h>
#include <gtk/gtk.h>
static GtkWidget *
create_bbox (gint horizontal,
char *title,
gint spacing,
gint layout)
{
GtkWidget *frame;
GtkWidget *bbox;
GtkWidget *button;
frame = gtk_frame_new (title);
if (horizontal)
bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
else
bbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
g_object_set (bbox, "margin", 5, NULL);
gtk_container_add (GTK_CONTAINER (frame), bbox);
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), layout);
gtk_box_set_spacing (GTK_BOX (bbox), spacing);
button = gtk_button_new_with_label (_("OK"));
gtk_container_add (GTK_CONTAINER (bbox), button);
button = gtk_button_new_with_label (_("Cancel"));
gtk_container_add (GTK_CONTAINER (bbox), button);
button = gtk_button_new_with_label (_("Help"));
gtk_container_add (GTK_CONTAINER (bbox), button);
return frame;
}
GtkWidget *
do_button_box (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *main_vbox;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *frame_horz;
GtkWidget *frame_vert;
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Button Boxes");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&window);
main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
g_object_set (main_vbox, "margin", 10, NULL);
gtk_container_add (GTK_CONTAINER (window), main_vbox);
frame_horz = gtk_frame_new ("Horizontal Button Boxes");
gtk_widget_set_margin_top (frame_horz, 10);
gtk_widget_set_margin_bottom (frame_horz, 10);
gtk_box_pack_start (GTK_BOX (main_vbox), frame_horz);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
g_object_set (vbox, "margin", 10, NULL);
gtk_container_add (GTK_CONTAINER (frame_horz), vbox);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Spread", 40, GTK_BUTTONBOX_SPREAD));
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Edge", 40, GTK_BUTTONBOX_EDGE));
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Start", 40, GTK_BUTTONBOX_START));
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "End", 40, GTK_BUTTONBOX_END));
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Center", 40, GTK_BUTTONBOX_CENTER));
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Expand", 0, GTK_BUTTONBOX_EXPAND));
frame_vert = gtk_frame_new ("Vertical Button Boxes");
gtk_box_pack_start (GTK_BOX (main_vbox), frame_vert);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
g_object_set (hbox, "margin", 10, NULL);
gtk_container_add (GTK_CONTAINER (frame_vert), hbox);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Spread", 10, GTK_BUTTONBOX_SPREAD));
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Edge", 10, GTK_BUTTONBOX_EDGE));
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Start", 10, GTK_BUTTONBOX_START));
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "End", 10, GTK_BUTTONBOX_END));
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Center", 10, GTK_BUTTONBOX_CENTER));
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Expand", 0, GTK_BUTTONBOX_EXPAND));
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
return window;
}

View File

@@ -7,7 +7,7 @@
* computers, as long as there is a network connection to the
* computer where the application is running.
*
* Only some of the windowing systems where GTK runs have the
* Only some of the windowing systems where GTK+ runs have the
* concept of multiple displays. (The X Window System is the
* main example.) Other windowing systems can only handle one
* keyboard and mouse, and combine all monitors into
@@ -315,7 +315,7 @@ create_frame (ChangeDisplayInfo *info,
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrollwin),
GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (hbox), scrollwin);
gtk_box_pack_start (GTK_BOX (hbox), scrollwin);
*tree_view = gtk_tree_view_new ();
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (*tree_view), FALSE);
@@ -325,7 +325,7 @@ create_frame (ChangeDisplayInfo *info,
gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
*button_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
gtk_container_add (GTK_CONTAINER (hbox), *button_vbox);
gtk_box_pack_start (GTK_BOX (hbox), *button_vbox);
if (!info->size_group)
info->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
@@ -365,11 +365,11 @@ create_display_frame (ChangeDisplayInfo *info)
button = left_align_button_new ("_Open...");
g_signal_connect (button, "clicked", G_CALLBACK (open_display_cb), info);
gtk_container_add (GTK_CONTAINER (button_vbox), button);
gtk_box_pack_start (GTK_BOX (button_vbox), button);
button = left_align_button_new ("_Close");
g_signal_connect (button, "clicked", G_CALLBACK (close_display_cb), info);
gtk_container_add (GTK_CONTAINER (button_vbox), button);
gtk_box_pack_start (GTK_BOX (button_vbox), button);
info->display_model = (GtkTreeModel *)gtk_list_store_new (DISPLAY_NUM_COLUMNS,
G_TYPE_STRING,
@@ -542,10 +542,10 @@ do_changedisplay (GtkWidget *do_widget)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
g_object_set (vbox, "margin", 8, NULL);
gtk_container_add (GTK_CONTAINER (content_area), vbox);
gtk_box_pack_start (GTK_BOX (content_area), vbox);
frame = create_display_frame (info);
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), frame);
initialize_displays (info);

View File

@@ -259,45 +259,45 @@ do_clipboard (GtkWidget *do_widget)
label = gtk_label_new ("\"Copy\" will copy the text\nin the entry to the clipboard");
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_box_pack_start (GTK_BOX (vbox), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
g_object_set (hbox, "margin", 8, NULL);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
/* Create the first entry */
entry = gtk_entry_new ();
gtk_container_add (GTK_CONTAINER (hbox), entry);
gtk_box_pack_start (GTK_BOX (hbox), entry);
/* Create the button */
button = gtk_button_new_with_mnemonic (_("_Copy"));
gtk_container_add (GTK_CONTAINER (hbox), button);
gtk_box_pack_start (GTK_BOX (hbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (copy_button_clicked), entry);
label = gtk_label_new ("\"Paste\" will paste the text from the clipboard to the entry");
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_box_pack_start (GTK_BOX (vbox), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
g_object_set (hbox, "margin", 8, NULL);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
/* Create the second entry */
entry = gtk_entry_new ();
gtk_container_add (GTK_CONTAINER (hbox), entry);
gtk_box_pack_start (GTK_BOX (hbox), entry);
/* Create the button */
button = gtk_button_new_with_mnemonic (_("_Paste"));
gtk_container_add (GTK_CONTAINER (hbox), button);
gtk_box_pack_start (GTK_BOX (hbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (paste_button_clicked), entry);
label = gtk_label_new ("Images can be transferred via the clipboard, too");
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_box_pack_start (GTK_BOX (vbox), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
g_object_set (hbox, "margin", 8, NULL);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
/* Create the first image */
image = gtk_image_new_from_icon_name ("dialog-warning");

View File

@@ -1,7 +1,7 @@
/* Color Chooser
*
* A GtkColorChooser lets the user choose a color. There are several
* implementations of the GtkColorChooser interface in GTK. The
* implementations of the GtkColorChooser interface in GTK+. The
* GtkColorChooserDialog is a prebuilt dialog containing a
* GtkColorChooserWidget.
*/
@@ -88,7 +88,7 @@ do_colorsel (GtkWidget *do_widget)
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), frame);
da = gtk_drawing_area_new ();
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 200);
@@ -101,7 +101,7 @@ do_colorsel (GtkWidget *do_widget)
gtk_widget_set_halign (button, GTK_ALIGN_END);
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (vbox), button);
gtk_box_pack_start (GTK_BOX (vbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (change_color_callback), NULL);

View File

@@ -144,7 +144,7 @@ create_capital_store (void)
{ NULL, "Jackson" },
{ NULL, "Jefferson City" },
{ NULL, "Juneau" },
{ "K - O", NULL },
{ "K - O" },
{ NULL, "Lansing" },
{ NULL, "Lincoln" },
{ NULL, "Little Rock" },
@@ -154,7 +154,7 @@ create_capital_store (void)
{ NULL, "Nashville" },
{ NULL, "Oklahoma City" },
{ NULL, "Olympia" },
{ "P - S", NULL },
{ NULL, "P - S" },
{ NULL, "Phoenix" },
{ NULL, "Pierre" },
{ NULL, "Providence" },
@@ -326,7 +326,7 @@ do_combobox (GtkWidget *do_widget)
* insensitive rows
*/
frame = gtk_frame_new ("Items with icons");
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), frame);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
g_object_set (box, "margin", 5, NULL);
@@ -367,7 +367,7 @@ do_combobox (GtkWidget *do_widget)
/* A combobox demonstrating trees.
*/
frame = gtk_frame_new ("Where are we ?");
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), frame);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
g_object_set (box, "margin", 5, NULL);
@@ -395,7 +395,7 @@ do_combobox (GtkWidget *do_widget)
/* A GtkComboBoxEntry with validation */
frame = gtk_frame_new ("Editable");
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), frame);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
g_object_set (box, "margin", 5, NULL);
@@ -413,7 +413,7 @@ do_combobox (GtkWidget *do_widget)
/* A combobox with string IDs */
frame = gtk_frame_new ("String IDs");
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), frame);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
g_object_set (box, "margin", 5, NULL);

View File

@@ -143,6 +143,7 @@
<file>application_demo.c</file>
<file>assistant.c</file>
<file>builder.c</file>
<file>button_box.c</file>
<file>changedisplay.c</file>
<file>clipboard.c</file>
<file>colorsel.c</file>

View File

@@ -199,6 +199,9 @@
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
@@ -252,10 +255,16 @@
</object>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkStatusbar" id="statusbar1">
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
</child>

View File

@@ -56,16 +56,16 @@ interactive_dialog_clicked (GtkButton *button,
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_container_add (GTK_CONTAINER (content_area), hbox);
gtk_box_pack_start (GTK_BOX (content_area), hbox);
image = gtk_image_new_from_icon_name ("dialog-question");
gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
gtk_container_add (GTK_CONTAINER (hbox), image);
gtk_box_pack_start (GTK_BOX (hbox), image);
table = gtk_grid_new ();
gtk_grid_set_row_spacing (GTK_GRID (table), 4);
gtk_grid_set_column_spacing (GTK_GRID (table), 4);
gtk_container_add (GTK_CONTAINER (hbox), table);
gtk_box_pack_start (GTK_BOX (hbox), table);
label = gtk_label_new_with_mnemonic ("_Entry 1");
gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
local_entry1 = gtk_entry_new ();
@@ -123,29 +123,29 @@ do_dialog (GtkWidget *do_widget)
/* Standard message dialog */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
button = gtk_button_new_with_mnemonic ("_Message Dialog");
g_signal_connect (button, "clicked",
G_CALLBACK (message_dialog_clicked), NULL);
gtk_container_add (GTK_CONTAINER (hbox), button);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL));
gtk_box_pack_start (GTK_BOX (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL));
/* Interactive dialog*/
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
button = gtk_button_new_with_mnemonic ("_Interactive Dialog");
g_signal_connect (button, "clicked",
G_CALLBACK (interactive_dialog_clicked), NULL);
gtk_container_add (GTK_CONTAINER (hbox), vbox2);
gtk_container_add (GTK_CONTAINER (vbox2), button);
gtk_box_pack_start (GTK_BOX (hbox), vbox2);
gtk_box_pack_start (GTK_BOX (vbox2), button);
table = gtk_grid_new ();
gtk_grid_set_row_spacing (GTK_GRID (table), 4);
gtk_grid_set_column_spacing (GTK_GRID (table), 4);
gtk_container_add (GTK_CONTAINER (hbox), table);
gtk_box_pack_start (GTK_BOX (hbox), table);
label = gtk_label_new_with_mnemonic ("_Entry 1");
gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);

View File

@@ -352,7 +352,7 @@ do_dnd (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (window), vbox);
fixed = gtk_fixed_new ();
gtk_container_add (GTK_CONTAINER (vbox), fixed);
gtk_box_pack_start (GTK_BOX (vbox), fixed);
gtk_widget_set_hexpand (fixed, TRUE);
gtk_widget_set_vexpand (fixed, TRUE);

View File

@@ -208,12 +208,12 @@ do_drawingarea (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Checkerboard pattern</u>");
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_box_pack_start (GTK_BOX (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_vexpand (frame, TRUE);
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), frame);
da = gtk_drawing_area_new ();
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 100);
@@ -228,12 +228,12 @@ do_drawingarea (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Scribble area</u>");
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_box_pack_start (GTK_BOX (vbox), label);
frame = gtk_frame_new (NULL);
gtk_widget_set_vexpand (frame, TRUE);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), frame);
da = gtk_drawing_area_new ();
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 100);

View File

@@ -356,7 +356,7 @@ do_editable_cells (GtkWidget *do_widget)
g_object_set (vbox, "margin", 5, NULL);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_container_add (GTK_CONTAINER (vbox),
gtk_box_pack_start (GTK_BOX (vbox),
gtk_label_new ("Shopping list (you can edit the cells!)"));
sw = gtk_scrolled_window_new (NULL, NULL);
@@ -365,7 +365,7 @@ do_editable_cells (GtkWidget *do_widget)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (vbox), sw);
gtk_box_pack_start (GTK_BOX (vbox), sw);
/* create models */
items_model = create_items_model ();
@@ -387,17 +387,17 @@ do_editable_cells (GtkWidget *do_widget)
/* some buttons */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
button = gtk_button_new_with_label ("Add item");
g_signal_connect (button, "clicked",
G_CALLBACK (add_item), treeview);
gtk_container_add (GTK_CONTAINER (hbox), button);
gtk_box_pack_start (GTK_BOX (hbox), button);
button = gtk_button_new_with_label ("Remove item");
g_signal_connect (button, "clicked",
G_CALLBACK (remove_item), treeview);
gtk_container_add (GTK_CONTAINER (hbox), button);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_window_set_default_size (GTK_WINDOW (window), 320, 200);
}

View File

@@ -34,19 +34,19 @@ do_entry_buffer (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"Entries share a buffer. Typing in one is reflected in the other.");
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_box_pack_start (GTK_BOX (vbox), label);
/* Create a buffer */
buffer = gtk_entry_buffer_new (NULL, 0);
/* Create our first entry */
entry = gtk_entry_new_with_buffer (buffer);
gtk_container_add (GTK_CONTAINER (vbox), entry);
gtk_box_pack_start (GTK_BOX (vbox), entry);
/* Create the second entry */
entry = gtk_entry_new_with_buffer (buffer);
gtk_entry_set_visibility (GTK_ENTRY (entry), FALSE);
gtk_container_add (GTK_CONTAINER (vbox), entry);
gtk_box_pack_start (GTK_BOX (vbox), entry);
g_object_unref (buffer);
}

View File

@@ -60,11 +60,11 @@ do_entry_completion (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), "Completion demo, try writing <b>total</b> or <b>gnome</b> for example.");
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_box_pack_start (GTK_BOX (vbox), label);
/* Create our entry */
entry = gtk_entry_new ();
gtk_container_add (GTK_CONTAINER (vbox), entry);
gtk_box_pack_start (GTK_BOX (vbox), entry);
/* Create the completion object */
completion = gtk_entry_completion_new ();

View File

@@ -73,7 +73,7 @@ do_expander (GtkWidget *do_widget)
"resize the window. Do it already !", -1);
gtk_container_add (GTK_CONTAINER (sw), tv);
gtk_container_add (GTK_CONTAINER (expander), sw);
gtk_container_add (GTK_CONTAINER (area), expander);
gtk_box_pack_end (GTK_BOX (area), expander);
g_signal_connect (expander, "notify::expanded",
G_CALLBACK (expander_cb), window);

View File

@@ -134,9 +134,7 @@ static GtkWidget *
create_video (void)
{
GtkMediaStream *stream = gtk_media_file_new_for_resource ("/images/gtk-logo.webm");
GtkWidget *w = gtk_picture_new_for_paintable (GDK_PAINTABLE (stream));
gtk_widget_set_size_request (w, 64, 64);
GtkWidget *w = gtk_image_new_from_paintable (GDK_PAINTABLE (stream));
gtk_media_stream_set_loop (stream, TRUE);
gtk_media_stream_play (stream);
g_object_unref (stream);

View File

@@ -1,8 +1,8 @@
/* Foreign drawing
*
* Many applications can't use GTK widgets, for a variety of reasons,
* Many applications can't use GTK+ widgets, for a variety of reasons,
* but still want their user interface to appear integrated with the
* rest of the desktop, and follow GTK themes. This demo shows how to
* rest of the desktop, and follow GTK+ themes. This demo shows how to
* use GtkStyleContext and the gtk_render_ APIs to achieve this.
*
* Note that this is a very simple, non-interactive example.

View File

@@ -1,6 +1,6 @@
[Desktop Entry]
Name=GTK Demo
Comment=GTK code examples and demonstrations
Name=GTK+ Demo
Comment=GTK+ code examples and demonstrations
Exec=gtk4-demo
Icon=gtk4-demo
Terminal=false

View File

@@ -128,10 +128,9 @@ gtk_fishbowl_measure (GtkWidget *widget,
}
static void
gtk_fishbowl_size_allocate (GtkWidget *widget,
int width,
int height,
int baseline)
gtk_fishbowl_size_allocate (GtkWidget *widget,
const GtkAllocation *allocation,
int baseline)
{
GtkFishbowl *fishbowl = GTK_FISHBOWL (widget);
GtkFishbowlPrivate *priv = gtk_fishbowl_get_instance_private (fishbowl);
@@ -148,8 +147,8 @@ gtk_fishbowl_size_allocate (GtkWidget *widget,
continue;
gtk_widget_get_preferred_size (child->widget, &child_requisition, NULL);
child_allocation.x = round (child->x * (width - child_requisition.width));
child_allocation.y = round (child->y * (height - child_requisition.height));
child_allocation.x = allocation->x + round (child->x * (allocation->width - child_requisition.width));
child_allocation.y = allocation->y + round (child->y * (allocation->height - child_requisition.height));
child_allocation.width = child_requisition.width;
child_allocation.height = child_requisition.height;

View File

@@ -266,7 +266,7 @@ do_iconview (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (window), vbox);
tool_bar = gtk_toolbar_new ();
gtk_container_add (GTK_CONTAINER (vbox), tool_bar);
gtk_box_pack_start (GTK_BOX (vbox), tool_bar);
up_button = gtk_tool_button_new (NULL, NULL);
gtk_tool_button_set_label (GTK_TOOL_BUTTON (up_button), _("_Up"));
@@ -292,7 +292,7 @@ do_iconview (GtkWidget *do_widget)
GTK_POLICY_AUTOMATIC);
gtk_widget_set_vexpand (sw, TRUE);
gtk_container_add (GTK_CONTAINER (vbox), sw);
gtk_box_pack_start (GTK_BOX (vbox), sw);
/* Create the store and fill it with the contents of '/' */
parent = g_strdup ("/");

View File

@@ -262,7 +262,7 @@ start_progressive_loading (GtkWidget *picture)
* pauses in the reading process.
*/
load_timeout = g_timeout_add (150, progressive_timeout, picture);
g_source_set_name_by_id (load_timeout, "[gtk] progressive_timeout");
g_source_set_name_by_id (load_timeout, "[gtk+] progressive_timeout");
}
static void
@@ -354,13 +354,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Image loaded from a file</u>");
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_box_pack_start (GTK_BOX (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), frame);
image = gtk_image_new_from_icon_name ("gtk3-demo");
gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
@@ -373,13 +373,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Animation loaded from a file</u>");
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_box_pack_start (GTK_BOX (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), frame);
picture = gtk_picture_new_for_resource ("/images/floppybuddy.gif");
@@ -390,13 +390,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Symbolic themed icon</u>");
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_box_pack_start (GTK_BOX (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gicon = g_themed_icon_new_with_default_fallbacks ("battery-caution-charging-symbolic");
image = gtk_image_new_from_gicon (gicon);
@@ -412,13 +412,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Progressive image loading</u>");
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_box_pack_start (GTK_BOX (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), frame);
/* Create an empty image for now; the progressive loader
* will create the pixbuf and fill it in.
@@ -435,13 +435,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Displaying video</u>");
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_box_pack_start (GTK_BOX (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), frame);
video = gtk_video_new_for_resource ("/images/gtk-logo.webm");
gtk_media_stream_set_loop (gtk_video_get_media_stream (GTK_VIDEO (video)), TRUE);
@@ -454,7 +454,7 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>GtkWidgetPaintable</u>");
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_box_pack_start (GTK_BOX (vbox), label);
paintable = gtk_widget_paintable_new (do_widget);
picture = gtk_picture_new_for_paintable (paintable);
@@ -464,7 +464,7 @@ do_images (GtkWidget *do_widget)
/* Sensitivity control */
button = gtk_toggle_button_new_with_mnemonic ("_Insensitive");
gtk_container_add (GTK_CONTAINER (base_vbox), button);
gtk_box_pack_start (GTK_BOX (base_vbox), button);
g_signal_connect (button, "toggled",
G_CALLBACK (toggle_sensitivity_callback),

View File

@@ -65,24 +65,24 @@ do_infobar (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (window), vbox);
bar = gtk_info_bar_new ();
gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_box_pack_start (GTK_BOX (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_INFO);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_INFO");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
button = gtk_toggle_button_new_with_label ("Message");
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
gtk_container_add (GTK_CONTAINER (actions), button);
bar = gtk_info_bar_new ();
gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_box_pack_start (GTK_BOX (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_WARNING);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_WARNING");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
button = gtk_toggle_button_new_with_label ("Warning");
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
@@ -91,24 +91,24 @@ do_infobar (GtkWidget *do_widget)
bar = gtk_info_bar_new_with_buttons (_("_OK"), GTK_RESPONSE_OK, NULL);
gtk_info_bar_set_show_close_button (GTK_INFO_BAR (bar), TRUE);
g_signal_connect (bar, "response", G_CALLBACK (on_bar_response), window);
gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_box_pack_start (GTK_BOX (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_QUESTION);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_QUESTION");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
button = gtk_toggle_button_new_with_label ("Question");
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
gtk_container_add (GTK_CONTAINER (actions), button);
bar = gtk_info_bar_new ();
gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_box_pack_start (GTK_BOX (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_ERROR);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_ERROR");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
button = gtk_toggle_button_new_with_label ("Error");
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
@@ -116,12 +116,12 @@ do_infobar (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (actions), button);
bar = gtk_info_bar_new ();
gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_box_pack_start (GTK_BOX (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_OTHER);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_OTHER");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
button = gtk_toggle_button_new_with_label ("Other");
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
@@ -130,7 +130,7 @@ do_infobar (GtkWidget *do_widget)
frame = gtk_frame_new ("Info bars");
gtk_widget_set_margin_top (frame, 8);
gtk_widget_set_margin_bottom (frame, 8);
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), frame);
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
g_object_set (vbox2, "margin", 8, NULL);
@@ -138,9 +138,9 @@ do_infobar (GtkWidget *do_widget)
/* Standard message dialog */
label = gtk_label_new ("An example of different info bars");
gtk_container_add (GTK_CONTAINER (vbox2), label);
gtk_box_pack_start (GTK_BOX (vbox2), label);
gtk_container_add (GTK_CONTAINER (vbox2), actions);
gtk_box_pack_start (GTK_BOX (vbox2), actions);
}
if (!gtk_widget_get_visible (window))

View File

@@ -268,7 +268,7 @@ do_list_store (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (window), vbox);
label = gtk_label_new ("This is the bug list (note: not based on real data, it would be nice to have a nice ODBC interface to bugzilla or so, though).");
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_box_pack_start (GTK_BOX (vbox), label);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
@@ -276,7 +276,7 @@ do_list_store (GtkWidget *do_widget)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (vbox), sw);
gtk_box_pack_start (GTK_BOX (vbox), sw);
/* create tree model */
model = create_model ();

View File

@@ -361,12 +361,12 @@ do_listbox (GtkWidget *do_widget)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_container_add (GTK_CONTAINER (window), vbox);
label = gtk_label_new ("Messages from GTK and friends");
gtk_container_add (GTK_CONTAINER (vbox), label);
label = gtk_label_new ("Messages from Gtk+ and friends");
gtk_box_pack_start (GTK_BOX (vbox), label);
scrolled = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_widget_set_vexpand (scrolled, TRUE);
gtk_container_add (GTK_CONTAINER (vbox), scrolled);
gtk_box_pack_start (GTK_BOX (vbox), scrolled);
listbox = gtk_list_box_new ();
gtk_container_add (GTK_CONTAINER (scrolled), listbox);

View File

@@ -67,6 +67,9 @@
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="short_time_label">
@@ -76,6 +79,10 @@
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="pack-type">end</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
@@ -111,6 +118,9 @@
<object class="GtkLabel" id="label4">
<property name="label" translatable="yes">Resent by</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="resent_by_button">
@@ -120,6 +130,9 @@
<property name="relief">none</property>
<property name="uri">http://www.gtk.org</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
@@ -159,6 +172,9 @@
<property name="relief">none</property>
<signal name="clicked" handler="reshare_clicked" swapped="yes"/>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="favorite-buttton">
@@ -168,6 +184,9 @@
<property name="relief">none</property>
<signal name="clicked" handler="favorite_clicked" swapped="yes"/>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="more-button">
@@ -181,8 +200,14 @@
</object>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
@@ -225,8 +250,14 @@ FAVORITES</property>
</child>
<child type="label_item"/>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box6">
@@ -248,8 +279,14 @@ FAVORITES</property>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
</child>

View File

@@ -42,24 +42,24 @@ activate_about (GSimpleAction *action,
{
GtkApplication *app = user_data;
const gchar *authors[] = {
"The GTK Team",
"The GTK+ Team",
NULL
};
gtk_show_about_dialog (GTK_WINDOW (gtk_application_get_active_window (app)),
"program-name", "GTK Demo",
"version", g_strdup_printf ("%s,\nRunning against GTK %d.%d.%d",
"program-name", "GTK+ Demo",
"version", g_strdup_printf ("%s,\nRunning against GTK+ %d.%d.%d",
PACKAGE_VERSION,
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ()),
"copyright", "(C) 1997-2013 The GTK Team",
"copyright", "(C) 1997-2013 The GTK+ Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK widgets",
"comments", "Program to demonstrate GTK+ widgets",
"authors", authors,
"logo-icon-name", "gtk4-demo",
"title", "About GTK Demo",
"logo-icon-name", "gtk3-demo",
"title", "About GTK+ Demo",
NULL);
}
@@ -831,14 +831,15 @@ load_file (const gchar *demoname,
/* Skipping blank lines */
while (g_ascii_isspace (*p))
p++;
if (!*p)
if (*p)
{
p = lines[i];
state++;
/* Fall through */
}
else
break;
p = lines[i];
state++;
/* Fall through */
case 3:
/* Reading program body */
gtk_text_buffer_insert (source_buffer, &start, p, -1);

View File

@@ -16,10 +16,9 @@
</columns>
</object>
<object class="GtkApplicationWindow" id="window">
<style><class name="devel"/></style>
<property name="default-width">800</property>
<property name="default-height">600</property>
<property name="title">GTK Demo</property>
<property name="title">GTK+ Demo</property>
<signal name="destroy" handler="gtk_main_quit" swapped="no"/>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar">
@@ -152,6 +151,9 @@
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>

View File

@@ -115,7 +115,7 @@ do_menus (GtkWidget *do_widget)
menubar = gtk_menu_bar_new ();
gtk_widget_set_hexpand (menubar, TRUE);
gtk_container_add (GTK_CONTAINER (box1), menubar);
gtk_box_pack_start (GTK_BOX (box1), menubar);
gtk_widget_show (menubar);
menu = create_menu (2);
@@ -136,19 +136,19 @@ do_menus (GtkWidget *do_widget)
gtk_widget_show (menuitem);
box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
gtk_container_add (GTK_CONTAINER (box1), box2);
gtk_box_pack_start (GTK_BOX (box1), box2);
gtk_widget_show (box2);
button = gtk_button_new_with_label ("Flip");
g_signal_connect (button, "clicked",
G_CALLBACK (change_orientation), menubar);
gtk_container_add (GTK_CONTAINER (box2), button);
gtk_box_pack_start (GTK_BOX (box2), button);
gtk_widget_show (button);
button = gtk_button_new_with_label ("Close");
g_signal_connect_swapped (button, "clicked",
G_CALLBACK(gtk_widget_destroy), window);
gtk_container_add (GTK_CONTAINER (box2), button);
gtk_box_pack_start (GTK_BOX (box2), button);
gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
gtk_widget_show (button);

View File

@@ -4,6 +4,7 @@ demos = files([
'application_demo.c',
'assistant.c',
'builder.c',
'button_box.c',
'changedisplay.c',
'clipboard.c',
'colorsel.c',
@@ -128,7 +129,7 @@ foreach icon_size: [ '16x16', '22x22', '24x24', '32x32', '48x48', '256x256', ]
endforeach
# desktop file
install_data('org.gtk.Demo.desktop', install_dir: gtk_applicationsdir)
install_data('gtk4-demo.desktop', install_dir: gtk_applicationsdir)
# GSettings
install_data('org.gtk.Demo.gschema.xml', install_dir: gtk_schemasdir)

View File

@@ -3,12 +3,12 @@
<id>org.gtk.Demo.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>LGPL-2.0+</project_license>
<name>GTK Demo</name>
<summary>Program to demonstrate GTK functions</summary>
<name>GTK+ Demo</name>
<summary>Program to demonstrate GTK+ functions</summary>
<description>
<p>
GTK Demo is a collection of examples that demonstrate the major
features of the GTK toolkit.
GTK+ Demo is a collection of examples that demonstrate the major
features of the GTK+ toolkit.
</p>
</description>
<screenshots>
@@ -30,4 +30,4 @@
<translation type="gettext">gtk-4.0</translation>
<update_contact>matthias.clasen_at_gmail.com</update_contact>
<developer_name>Matthias Clasen and others</developer_name>
</component>
</component>

View File

@@ -65,7 +65,7 @@ do_overlay (GtkWidget *do_widget)
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_widget_set_margin_top (label, 8);
gtk_widget_set_margin_bottom (label, 50);
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_box_pack_start (GTK_BOX (vbox), label);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), vbox);
@@ -74,7 +74,7 @@ do_overlay (GtkWidget *do_widget)
gtk_entry_set_placeholder_text (GTK_ENTRY (entry), "Your Lucky Number");
gtk_widget_set_margin_top (entry, 50);
gtk_widget_set_margin_bottom (entry, 8);
gtk_container_add (GTK_CONTAINER (vbox), entry);
gtk_box_pack_start (GTK_BOX (vbox), entry);
gtk_container_add (GTK_CONTAINER (window), overlay);

View File

@@ -84,16 +84,15 @@ drawing_area_ensure_surface (DrawingArea *area,
}
static void
drawing_area_size_allocate (GtkWidget *widget,
int width,
int height,
int baseline)
drawing_area_size_allocate (GtkWidget *widget,
const GtkAllocation *allocation,
int baseline)
{
DrawingArea *area = (DrawingArea *) widget;
drawing_area_ensure_surface (area, width, height);
drawing_area_ensure_surface (area, allocation->width, allocation->height);
GTK_WIDGET_CLASS (drawing_area_parent_class)->size_allocate (widget, width, height, baseline);
GTK_WIDGET_CLASS (drawing_area_parent_class)->size_allocate (widget, allocation, baseline);
}
static void

View File

@@ -148,7 +148,7 @@ do_panes (GtkWidget *do_widget)
vpaned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
g_object_set (vpaned, "margin", 5, NULL);
gtk_container_add (GTK_CONTAINER (vbox), vpaned);
gtk_box_pack_start (GTK_BOX (vbox), vpaned);
hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
gtk_paned_add1 (GTK_PANED (vpaned), hpaned);
@@ -173,13 +173,13 @@ do_panes (GtkWidget *do_widget)
/* Now create toggle buttons to control sizing */
gtk_container_add (GTK_CONTAINER (vbox),
gtk_box_pack_start (GTK_BOX (vbox),
create_pane_options (GTK_PANED (hpaned),
"Horizontal",
"Left",
"Right"));
gtk_container_add (GTK_CONTAINER (vbox),
gtk_box_pack_start (GTK_BOX (vbox),
create_pane_options (GTK_PANED (vpaned),
"Vertical",
"Top",

View File

@@ -55,11 +55,10 @@ create_complex_popover (GtkWidget *parent,
}
static void
entry_size_allocate_cb (GtkEntry *entry,
int width,
int height,
int baseline,
gpointer user_data)
entry_size_allocate_cb (GtkEntry *entry,
const GtkAllocation *allocation,
int baseline,
gpointer user_data)
{
GtkEntryIconPosition popover_pos;
GtkPopover *popover = user_data;

View File

@@ -81,6 +81,9 @@
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>

View File

@@ -12,7 +12,7 @@
#include <string.h>
#define HEART "♥"
const char text[] = "I ♥ GTK";
const char text[] = "I ♥ GTK+";
static void
fancy_shape_renderer (cairo_t *cr,

View File

@@ -240,20 +240,20 @@ do_search_entry (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), "Search entry demo");
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_box_pack_start (GTK_BOX (vbox), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
/* Create our entry */
entry = gtk_search_entry_new ();
gtk_container_add (GTK_CONTAINER (hbox), entry);
gtk_box_pack_start (GTK_BOX (hbox), entry);
/* Create the find and cancel buttons */
notebook = gtk_notebook_new ();
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE);
gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE);
gtk_container_add (GTK_CONTAINER (hbox), notebook);
gtk_box_pack_start (GTK_BOX (hbox), notebook);
find_button = gtk_button_new_with_label ("Find");
g_signal_connect (find_button, "clicked",

View File

@@ -83,38 +83,38 @@ do_search_entry2 (GtkWidget *do_widget)
entry = gtk_search_entry_new ();
container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_widget_set_halign (container, GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (container), entry);
gtk_box_pack_start (GTK_BOX (container), entry);
searchbar = gtk_search_bar_new ();
gtk_search_bar_connect_entry (GTK_SEARCH_BAR (searchbar), GTK_ENTRY (entry));
gtk_search_bar_set_show_close_button (GTK_SEARCH_BAR (searchbar), FALSE);
gtk_container_add (GTK_CONTAINER (searchbar), container);
gtk_container_add (GTK_CONTAINER (vbox), searchbar);
gtk_box_pack_start (GTK_BOX (vbox), searchbar);
/* Hook the search bar to key presses */
gtk_search_bar_set_key_capture_widget (GTK_SEARCH_BAR (searchbar), window);
/* Help */
label = gtk_label_new ("Start Typing to search");
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_box_pack_start (GTK_BOX (vbox), label);
/* Toggle button */
button = gtk_toggle_button_new_with_label ("Search");
g_object_bind_property (button, "active",
searchbar, "search-mode-enabled",
G_BINDING_BIDIRECTIONAL);
gtk_container_add (GTK_CONTAINER (vbox), button);
gtk_box_pack_start (GTK_BOX (vbox), button);
/* Result */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
label = gtk_label_new ("Result:");
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_margin_start (label, 6);
gtk_container_add (GTK_CONTAINER (hbox), label);
gtk_box_pack_start (GTK_BOX (hbox), label);
label = gtk_label_new ("");
gtk_container_add (GTK_CONTAINER (hbox), label);
gtk_box_pack_start (GTK_BOX (hbox), label);
g_signal_connect (entry, "search-changed",
G_CALLBACK (search_changed_cb), label);
@@ -122,15 +122,15 @@ do_search_entry2 (GtkWidget *do_widget)
G_CALLBACK (changed_cb), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
label = gtk_label_new ("Signal:");
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_margin_start (label, 6);
gtk_container_add (GTK_CONTAINER (hbox), label);
gtk_box_pack_start (GTK_BOX (hbox), label);
label = gtk_label_new ("");
gtk_container_add (GTK_CONTAINER (hbox), label);
gtk_box_pack_start (GTK_BOX (hbox), label);
g_signal_connect (entry, "search-changed",
G_CALLBACK (search_changed), label);

View File

@@ -19,7 +19,7 @@ do_sidebar (GtkWidget *do_widget)
GtkWidget *widget;
GtkWidget *header;
const gchar* pages[] = {
"Welcome to GTK",
"Welcome to GTK+",
"GtkStackSidebar Widget",
"Automatic navigation",
"Consistent appearance",
@@ -49,7 +49,7 @@ do_sidebar (GtkWidget *do_widget)
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
sidebar = gtk_stack_sidebar_new ();
gtk_container_add (GTK_CONTAINER (box), sidebar);
gtk_box_pack_start (GTK_BOX (box), sidebar);
stack = gtk_stack_new ();
gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN);
@@ -57,9 +57,9 @@ do_sidebar (GtkWidget *do_widget)
/* Separator between sidebar and stack */
widget = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
gtk_container_add (GTK_CONTAINER(box), widget);
gtk_box_pack_start (GTK_BOX(box), widget);
gtk_container_add (GTK_CONTAINER (box), stack);
gtk_box_pack_start (GTK_BOX (box), stack);
for (i=0; (c = *(pages+i)) != NULL; i++ )
{

View File

@@ -116,7 +116,7 @@ do_sizegroup (GtkWidget *do_widget)
/* Create one frame holding color options */
frame = gtk_frame_new ("Color Options");
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), frame);
table = gtk_grid_new ();
g_object_set (table, "margin", 5, NULL);
@@ -129,7 +129,7 @@ do_sizegroup (GtkWidget *do_widget)
/* And another frame holding line style options */
frame = gtk_frame_new ("Line Options");
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), frame);
table = gtk_grid_new ();
g_object_set (table, "margin", 5, NULL);
@@ -142,7 +142,7 @@ do_sizegroup (GtkWidget *do_widget)
/* And a check button to turn grouping on and off */
check_button = gtk_check_button_new_with_mnemonic ("_Enable grouping");
gtk_container_add (GTK_CONTAINER (vbox), check_button);
gtk_box_pack_start (GTK_BOX (vbox), check_button);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE);
g_signal_connect (check_button, "toggled",

View File

@@ -53,7 +53,7 @@ do_spinner (GtkWidget *do_widget)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
g_object_set (vbox, "margin", 5, NULL);
gtk_container_add (GTK_CONTAINER (content_area), vbox);
gtk_box_pack_start (GTK_BOX (content_area), vbox);
/* Sensitive */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);

View File

@@ -157,7 +157,7 @@ create_text_view (GtkWidget *hbox,
guint timeout;
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (hbox), swindow);
gtk_box_pack_start (GTK_BOX (hbox), swindow);
textview = gtk_text_view_new ();
gtk_container_add (GTK_CONTAINER (swindow), textview);

View File

@@ -280,7 +280,7 @@ insert_text (GtkTextBuffer *buffer)
gtk_text_buffer_insert (buffer, &iter,
"This line (and most of the others in this buffer) is word-wrapped, "
"using the proper Unicode algorithm. Word wrap should work in all "
"scripts and languages that GTK supports. Let's make this a long "
"scripts and languages that GTK+ supports. Let's make this a long "
"paragraph to demonstrate: blah blah blah blah blah blah blah blah "
"blah blah blah blah blah blah blah blah blah blah blah\n\n", -1);

View File

@@ -131,6 +131,9 @@
<property name="can-focus">1</property>
<property name="receives-default">1</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton">
@@ -138,6 +141,9 @@
<property name="can-focus">1</property>
<property name="receives-default">1</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
</child>

View File

@@ -1,10 +1,10 @@
/* Theming/Style Classes
*
* GTK uses CSS for theming. Style classes can be associated
* GTK+ uses CSS for theming. Style classes can be associated
* with widgets to inform the theme about intended rendering.
*
* This demo shows some common examples where theming features
* of GTK are used for certain effects: primary toolbars,
* of GTK+ are used for certain effects: primary toolbars,
* inline toolbars and linked buttons.
*/

View File

@@ -12,10 +12,12 @@ do_transparent (GtkWidget *do_widget)
if (!window)
{
GtkWidget *sw;
GtkWidget *overlay;
GtkWidget *button;
GtkWidget *label;
GtkWidget *picture;
GtkWidget *box;
GtkWidget *image;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_display (GTK_WINDOW (window),
@@ -52,8 +54,17 @@ do_transparent (GtkWidget *do_widget)
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), button);
gtk_container_child_set (GTK_CONTAINER (overlay), button, "blur", 5.0, NULL);
picture = gtk_picture_new_for_resource ("/transparent/portland-rose.jpg");
gtk_container_add (GTK_CONTAINER (overlay), picture);
sw = gtk_scrolled_window_new (NULL, NULL);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (overlay), sw);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (sw), box);
image = gtk_image_new_from_resource ("/transparent/portland-rose.jpg");
gtk_container_add (GTK_CONTAINER (box), image);
}
if (!gtk_widget_get_visible (window))

View File

@@ -401,7 +401,7 @@ do_tree_store (GtkWidget *do_widget)
g_object_set (vbox, "margin", 8, NULL);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_container_add (GTK_CONTAINER (vbox),
gtk_box_pack_start (GTK_BOX (vbox),
gtk_label_new ("Jonathan's Holiday Card Planning Sheet"));
sw = gtk_scrolled_window_new (NULL, NULL);
@@ -410,7 +410,7 @@ do_tree_store (GtkWidget *do_widget)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (vbox), sw);
gtk_box_pack_start (GTK_BOX (vbox), sw);
/* create model */
model = create_model ();

View File

@@ -513,5 +513,3 @@ trophy-gold=
night-light=
daytime-sunrise=
daytime-sunset=
on=
off=

View File

@@ -17,4 +17,4 @@ executable('gtk4-icon-browser',
link_args: extra_demo_ldflags,
install: true)
install_data('org.gtk.IconBrowser.desktop', install_dir: gtk_applicationsdir)
install_data('gtk4-icon-browser.desktop', install_dir: gtk_applicationsdir)

View File

@@ -6,7 +6,6 @@
<property name="child-model">store</property>
</object>
<template class="IconBrowserWindow" parent="GtkApplicationWindow">
<style><class name="devel"/></style>
<property name="title" translatable="yes">Icon Browser</property>
<property name="default-width">1024</property>
<property name="default-height">768</property>
@@ -121,7 +120,7 @@
<property name="use-header-bar">1</property>
<property name="resizable">0</property>
<property name="hide-on-close">1</property>
<child internal-child="content_area">
<child internal-child="vbox">
<object class="GtkBox">
<child>
<object class="GtkGrid">

View File

@@ -1,6 +1,6 @@
[Desktop Entry]
Name=Widget Factory
Comment=A showcase for GTK widgets, designed for testing themes.
Comment=A showcase for GTK+ widgets, designed for testing themes.
Exec=gtk4-widget-factory
Icon=gtk4-widget-factory
Terminal=false

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<menu id="app-menu">
<section>
<item>
<attribute name="label" translatable="yes">About</attribute>
<attribute name="action">app.about</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
<attribute name="accel">&lt;Primary&gt;q</attribute>
</item>
</section>
</menu>
</interface>

View File

@@ -13,7 +13,7 @@ executable('gtk4-widget-factory',
install: true)
# desktop file
install_data('org.gtk.WidgetFactory.desktop', install_dir: gtk_applicationsdir)
install_data('gtk4-widget-factory.desktop', install_dir: gtk_applicationsdir)
# icons
icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor')

View File

@@ -3,11 +3,11 @@
<id>org.gtk.WidgetFactory.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>LGPL-2.0+</project_license>
<name>GTK Widget Factory</name>
<summary>Program to demonstrate GTK functions</summary>
<name>GTK+ Widget Factory</name>
<summary>Program to demonstrate GTK+ functions</summary>
<description>
<p>
GTK Widget Factory is a showcase of GTK widgets. It was
GTK+ Widget Factory is a showcase of GTK+ widgets. It was
originally created to help theme authors test their creations
for completeness.
</p>

View File

@@ -212,28 +212,28 @@ activate_about (GSimpleAction *action,
glib_major_version,
glib_minor_version,
glib_micro_version);
g_string_append_printf (s, "\tGTK\t%d.%d.%d\n",
g_string_append_printf (s, "\tGTK+\t%d.%d.%d\n",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
g_string_append_printf (s, "\nA link can apppear here: <http://www.gtk.org>");
version = g_strdup_printf ("%s\nRunning against GTK %d.%d.%d",
version = g_strdup_printf ("%s\nRunning against GTK+ %d.%d.%d",
PACKAGE_VERSION,
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
gtk_show_about_dialog (GTK_WINDOW (gtk_application_get_active_window (app)),
"program-name", "GTK Widget Factory",
"program-name", "GTK+ Widget Factory",
"version", version,
"copyright", "(C) 1997-2013 The GTK Team",
"copyright", "(C) 1997-2013 The GTK+ Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK themes and widgets",
"comments", "Program to demonstrate GTK+ themes and widgets",
"authors", authors,
"logo-icon-name", "gtk4-widget-factory",
"title", "About GTK Widget Factory",
"title", "About GTK+ Widget Factory",
"system-information", s->str,
NULL);
@@ -803,7 +803,7 @@ overshot (GtkScrolledWindow *sw, GtkPositionType pos, GtkWidget *widget)
"margin", 6,
"xalign", 0.0,
NULL);
gtk_container_add (GTK_CONTAINER (row), label);
gtk_box_pack_start (GTK_BOX (row), label);
gdk_rgba_parse (&rgba, color);
swatch = g_object_new (g_type_from_name ("GtkColorSwatch"),
"rgba", &rgba,
@@ -815,7 +815,7 @@ overshot (GtkScrolledWindow *sw, GtkPositionType pos, GtkWidget *widget)
NULL);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (box), swatch);
gtk_container_add (GTK_CONTAINER (row), box);
gtk_box_pack_start (GTK_BOX (row), box);
gtk_list_box_insert (GTK_LIST_BOX (widget), row, -1);
row = gtk_widget_get_parent (row);
gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (row), FALSE);
@@ -914,7 +914,7 @@ populate_colors (GtkWidget *widget, GtkWidget *chooser)
"hexpand", TRUE,
"xalign", 0.0,
NULL);
gtk_container_add (GTK_CONTAINER (row), label);
gtk_box_pack_start (GTK_BOX (row), label);
gdk_rgba_parse (&rgba, colors[i].color);
swatch = g_object_new (g_type_from_name ("GtkColorSwatch"),
"rgba", &rgba,
@@ -926,7 +926,7 @@ populate_colors (GtkWidget *widget, GtkWidget *chooser)
NULL);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (box), swatch);
gtk_container_add (GTK_CONTAINER (row), box);
gtk_box_pack_start (GTK_BOX (row), box);
gtk_list_box_insert (GTK_LIST_BOX (widget), row, -1);
row = gtk_widget_get_parent (row);
gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (row), FALSE);

View File

@@ -6,6 +6,9 @@
<gresource prefix="/org/gtk/WidgetFactory">
<file>widget-factory.css</file>
</gresource>
<gresource prefix="/org/gtk/WidgetFactory/gtk">
<file preprocess="xml-stripblanks">menus.ui</file>
</gresource>
<gresource prefix="/org/gtk/WidgetFactory/gtk">
<file preprocess="xml-stripblanks">help-overlay.ui</file>
</gresource>

View File

@@ -16,16 +16,6 @@
<attribute name="action">win.transition</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
<attribute name="action">win.show-help-overlay</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_About Widget Factory</attribute>
<attribute name="action">app.about</attribute>
</item>
</section>
</menu>
<menu id="dinner_menu">
<section>
@@ -406,8 +396,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</columns>
</object>
<object class="GtkApplicationWindow" id="window">
<style><class name="devel"/></style>
<property name="title">GTK Widget Factory</property>
<property name="title">GTK+ Widget Factory</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar1">
<property name="show-title-buttons">1</property>
@@ -472,6 +461,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entry1">
@@ -483,6 +475,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="secondary-icon-tooltip-text">Change mode</property>
<signal name="icon-release" handler="on_entry_icon_release" swapped="no"/>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entry2">
@@ -491,6 +486,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="invisible-char">•</property>
<property name="text" translatable="yes">entry</property>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box223">
@@ -510,8 +508,14 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="can-focus">1</property>
<property name="icon-name">window-close-symbolic</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkBox">
@@ -573,6 +577,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="sensitive">0</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton1">
@@ -581,6 +588,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="max-width-chars">2</property>
<property name="adjustment">adjustment2</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton2">
@@ -589,6 +599,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="width-chars">2</property>
<property name="max-width-chars">2</property>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
</child>
@@ -782,6 +795,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<object class="GtkSeparator" id="separator1">
<property name="orientation">vertical</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box19">
@@ -801,6 +817,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="togglebutton3">
@@ -809,6 +828,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="receives-default">1</property>
<property name="active">1</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="togglebutton4">
@@ -818,6 +840,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="receives-default">1</property>
<property name="active">1</property>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox1">
@@ -830,6 +855,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</attributes>
</child>
</object>
<packing>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox2">
@@ -843,6 +871,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</attributes>
</child>
</object>
<packing>
<property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkFontButton" id="fontbutton1">
@@ -850,6 +881,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="receives-default">1</property>
<property name="level">family|style|size|features|variations</property>
</object>
<packing>
<property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkColorButton" id="colorbutton1">
@@ -858,10 +892,16 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="rgba">#31316867a09f</property>
<property name="use-alpha">1</property>
</object>
<packing>
<property name="position">8</property>
</packing>
</child>
<child>
<object class="GtkFileChooserButton" id="filechooserbutton1">
</object>
<packing>
<property name="position">8</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="linkbutton1">
@@ -872,24 +912,39 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="relief">none</property>
<property name="uri">http://www.gtk.org</property>
</object>
<packing>
<property name="position">9</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="switch1">
<property name="halign">center</property>
</object>
<packing>
<property name="position">10</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="switch2">
<property name="sensitive">0</property>
<property name="halign">center</property>
</object>
<packing>
<property name="position">11</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="separator2">
<property name="orientation">vertical</property>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box20">
@@ -910,17 +965,26 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="fraction">0.5</property>
<property name="inverted">1</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkProgressBar" id="progressbar3">
<property name="fraction">0.5</property>
<property name="show-text">1</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkLevelBar" id="levelbar1">
<property name="value">0.6</property>
</object>
<packing>
<property name="position">10</property>
</packing>
</child>
<child>
<object class="GtkLevelBar" id="levelbar2">
@@ -933,6 +997,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<offset name="full" value="5"/>
</offsets>
</object>
<packing>
<property name="position">11</property>
</packing>
</child>
</object>
</child>
@@ -961,10 +1028,16 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="fill-level">75</property>
<property name="draw-value">0</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkScale" id="scale5">
@@ -982,6 +1055,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<mark value="4" position="bottom"></mark>
</marks>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box25">
@@ -1005,6 +1081,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="inverted">1</property>
<property name="halign">start</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
@@ -1039,17 +1118,32 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="halign">start</property>
<signal name="format-value" handler="scale_format_value_blank"/>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="separator3">
<property name="orientation">vertical</property>
</object>
<packing>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box26">
@@ -1082,6 +1176,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame3">
@@ -1095,6 +1192,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame4">
@@ -1108,13 +1208,22 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="separator4">
<property name="orientation">vertical</property>
</object>
<packing>
<property name="position">7</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box4">
@@ -1215,13 +1324,25 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">8</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="separator5"/>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box5">
@@ -1247,6 +1368,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<object class="GtkBox" id="box7">
<property name="orientation">vertical</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="label6">
@@ -1328,6 +1452,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkNotebook" id="notebook3">
@@ -1381,6 +1508,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkNotebook" id="notebook4">
@@ -1434,8 +1564,14 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</packing>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
</object>
<packing>
@@ -2910,6 +3046,9 @@ microphone-sensitivity-medium-symbolic</property>
<class name="small-button"/>
</style>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
</child>
@@ -2940,6 +3079,9 @@ microphone-sensitivity-medium-symbolic</property>
<class name="small-button"/>
</style>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
</child>
@@ -2998,6 +3140,9 @@ microphone-sensitivity-medium-symbolic</property>
<property name="show-emoji-icon">1</property>
<property name="placeholder-text" translatable="yes">Age…</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<style>
<class name="linked"/>
@@ -3133,7 +3278,7 @@ bad things might happen.</property>
<property name="use-header-bar">1</property>
<property name="title" translatable="yes">Zelda</property>
<property name="hide-on-close">1</property>
<child internal-child="content_area">
<child internal-child="vbox">
<object class="GtkBox">
<child>
<object class="GtkLabel">
@@ -3172,7 +3317,7 @@ bad things might happen.</property>
<property name="use-header-bar">1</property>
<property name="title" translatable="yes">Settings</property>
<property name="hide-on-close">1</property>
<child internal-child="content_area">
<child internal-child="vbox">
<object class="GtkBox">
<child>
<object class="GtkGrid">
@@ -3293,7 +3438,7 @@ bad things might happen.</property>
<property name="use-header-bar">1</property>
<property name="title" translatable="yes">Choose one</property>
<property name="hide-on-close">1</property>
<child internal-child="content_area">
<child internal-child="vbox">
<object class="GtkBox">
<child>
<object class="GtkFlowBox" id="selection_flowbox">
@@ -3438,4 +3583,4 @@ bad things might happen.</property>
</object>
</child>
</object>
</interface>
</interface>

View File

@@ -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.

View File

@@ -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,

View File

@@ -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.

View File

@@ -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().

View File

@@ -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.

View File

@@ -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

View File

@@ -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>

View File

@@ -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 gtk4
$ pkg-config --cflags gtk+-4.0
-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 gtk4
$ pkg-config --libs gtk+-4.0
-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 gtk4` hello.c -o hello `pkg-config --libs gtk4`
$ cc `pkg-config --cflags gtk+-4.0` hello.c -o hello `pkg-config --libs gtk+-4.0`
</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 4.2:
to use symbols that were not deprecated in 3.2:
<programlisting>
$ cc `pkg-config --cflags gtk4` -DGDK_VERSION_MIN_REQIRED=GDK_VERSION_4_2 hello.c -o hello `pkg-config --libs gtk4`
$ 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`
</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 4.2:
it to use any symbols that were introduced after 3.4:
<programlisting>
$ cc `pkg-config --cflags gtk4` -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_4_2 hello.c -o hello `pkg-config --libs gtk4`
$ 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`
</programlisting>
</para>

View File

@@ -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.

View File

@@ -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">

View File

@@ -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>

View File

@@ -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>
@@ -44,30 +44,30 @@
<informalexample>
<para>Create a new file with the following content named <filename>example-0.c.</filename></para>
<programlisting><xi:include href="@SRC_DIR@/examples/window-default.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/window-default.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>
You can compile the program above with GCC using:
<literallayout>
<literal>gcc `pkg-config --cflags gtk4` -o example-0 example-0.c `pkg-config --libs gtk4`</literal>
<literal>gcc `pkg-config --cflags gtk+-4.0` -o example-0 example-0.c `pkg-config --libs gtk+-4.0`</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,16 +151,16 @@
</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">
<programlisting><xi:include href="../../../../examples/hello-world.c" parse="text">
<xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
<para>
You can compile the program above with GCC using:
<literallayout>
<literal>gcc `pkg-config --cflags gtk4` -o example-1 example-1.c `pkg-config --libs gtk4`</literal>
<literal>gcc `pkg-config --cflags gtk+-4.0` -o example-1 example-1.c `pkg-config --libs gtk+-4.0`</literal>
</literallayout>
</para>
</section>
@@ -169,8 +169,8 @@
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
#GtkBox which is GTK's way of controlling the size and layout of buttons.
The #GtkBox is created and assigned to gtk_box_new() which takes a
#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
particular case as we are dealing with only one button. After initializing
@@ -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>
@@ -233,12 +233,12 @@
<example id="gtk-getting-started-grid-packing">
<title>Packing buttons</title>
<para>Create a new file with the following content named example-2.c.</para>
<programlisting><xi:include href="@SRC_DIR@/examples/grid-packing.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/grid-packing.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
<para>
You can compile the program above with GCC using:
<literallayout>
<literal>gcc `pkg-config --cflags gtk4` -o example-2 example-2.c `pkg-config --libs gtk4`</literal>
<literal>gcc `pkg-config --cflags gtk+-4.0` -o example-2 example-2.c `pkg-config --libs gtk+-4.0`</literal>
</literallayout>
</para>
</section>
@@ -250,21 +250,21 @@
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>
<example>
<title>Packing buttons with GtkBuilder</title>
<para>Create a new file with the following content named example-3.c.</para>
<programlisting><xi:include href="@SRC_DIR@/examples/builder.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/builder.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<para>Create a new file with the following content named builder.ui.</para>
<programlisting><xi:include href="@SRC_DIR@/examples/builder.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/builder.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
<para>
You can compile the program above with GCC using:
<literallayout>
<literal>gcc `pkg-config --cflags gtk4` -o example-3 example-3.c `pkg-config --libs gtk4`</literal>
<literal>gcc `pkg-config --cflags gtk+-4.0` -o example-3 example-3.c `pkg-config --libs gtk+-4.0`</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>
@@ -346,7 +346,7 @@
of our application class.</para>
<informalexample>
<programlisting><xi:include href="@SRC_DIR@/examples/application1/main.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/application1/main.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>All the application logic is in the application class, which
@@ -364,16 +364,16 @@
GIO <ulink url="https://developer.gnome.org/gio/2.36/GApplication.html#GApplication.description">documentation</ulink>.</para>
<informalexample>
<programlisting><xi:include href="@SRC_DIR@/examples/application1/exampleapp.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/application1/exampleapp.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</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>
<informalexample>
<programlisting><xi:include href="@SRC_DIR@/examples/application1/exampleappwin.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/application1/exampleappwin.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>As part of the initial setup of our application, we also
@@ -388,7 +388,7 @@
</informalfigure>
<informalexample>
<programlisting><xi:include href="@SRC_DIR@/examples/application1/org.gtk.exampleapp.desktop" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/application1/exampleapp.desktop" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Note that <replaceable>@<!-- -->bindir@</replaceable> needs to be replaced
@@ -420,7 +420,7 @@
</para>
<informalexample>
<programlisting><xi:include href="@SRC_DIR@/examples/application2/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/application2/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>To make use of this file in our application, we revisit
@@ -460,7 +460,7 @@ example_app_window_class_init (ExampleAppWindowClass *class)
</para>
<informalexample>
<programlisting><xi:include href="@SRC_DIR@/examples/application2/exampleapp.gresource.xml" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/application2/exampleapp.gresource.xml" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>This file has to be converted into a C source file that will be
@@ -599,7 +599,7 @@ example_app_window_open (ExampleAppWindow *win,
in a ui file, and add it as a resource to our binary.</para>
<informalexample>
<programlisting><xi:include href="@SRC_DIR@/examples/application4/app-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/application4/app-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>To associate the app menu with the application, we have to call
@@ -698,7 +698,7 @@ example_app_class_init (ExampleAppClass *class)
GSettings requires a schema that describes our settings:</para>
<informalexample>
<programlisting><xi:include href="@SRC_DIR@/examples/application5/org.gtk.exampleapp.gschema.xml" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/application5/org.gtk.exampleapp.gschema.xml" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Before we can make use of this schema in our application,
@@ -747,13 +747,13 @@ example_app_window_init (ExampleAppWindow *win)
<para>Lets start with the template.</para>
<informalexample>
<programlisting><xi:include href="@SRC_DIR@/examples/application6/prefs.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/application6/prefs.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Next comes the dialog subclass.</para>
<informalexample>
<programlisting><xi:include href="@SRC_DIR@/examples/application6/exampleappprefs.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/application6/exampleappprefs.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Now we revisit the <literal>preferences_activated(<!-- -->)</literal> function in our
@@ -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>
@@ -805,7 +805,7 @@ preferences_activated (GSimpleAction *action,
to slide out the search bar below the header bar.</para>
<informalexample>
<programlisting><xi:include href="@SRC_DIR@/examples/application7/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/application7/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>Implementing the search needs quite a few code changes that
@@ -882,7 +882,7 @@ example_app_window_init (ExampleAppWindow *win)
which demonstrates #GtkMenuButton, #GtkRevealer and #GtkListBox.</para>
<informalexample>
<programlisting><xi:include href="@SRC_DIR@/examples/application8/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/application8/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>The code to populate the sidebar with buttons for the words
@@ -893,7 +893,7 @@ example_app_window_init (ExampleAppWindow *win)
ui file.</para>
<informalexample>
<programlisting><xi:include href="@SRC_DIR@/examples/application8/gears-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/application8/gears-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>To connect the menuitem to the show-words setting, we use
@@ -952,7 +952,7 @@ example_app_window_init (ExampleAppWindow *win)
triggers the show-lines action:</para>
<informalexample>
<programlisting><xi:include href="@SRC_DIR@/examples/application9/gears-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/application9/gears-menu.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>To make this menu item do something, we create a property
@@ -1007,12 +1007,12 @@ 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>
<informalexample>
<programlisting><xi:include href="@SRC_DIR@/examples/application10/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/application10/window.ui" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample>
<para>A small extra bonus of using a header bar is that we get
@@ -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>
@@ -1068,12 +1068,12 @@ example_app_window_init (ExampleAppWindow *win)
<example id="gtk-getting-started-drawing">
<title>Drawing in response to input</title>
<para>Create a new file with the following content named example-4.c.</para>
<programlisting><xi:include href="@SRC_DIR@/examples/drawing.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
<programlisting><xi:include href="../../../../examples/drawing.c" parse="text"><xi:fallback>MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
<para>
You can compile the program above with GCC using:
<literallayout>
<literal>gcc `pkg-config --cflags gtk4` -o example-4 example-4.c `pkg-config --libs gtk4`</literal>
<literal>gcc `pkg-config --cflags gtk+-4.0` -o example-4 example-4.c `pkg-config --libs gtk+-4.0`</literal>
</literallayout>
</para>
</section>

View File

@@ -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>

View File

@@ -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>

View File

@@ -6,7 +6,7 @@
<refentryinfo>
<title>gtk4-builder-tool</title>
<productname>GTK</productname>
<productname>GTK+</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>

View File

@@ -6,7 +6,7 @@
<refentryinfo>
<title>gtk4-demo-application</title>
<productname>GTK</productname>
<productname>GTK+</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>

View File

@@ -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>

View File

@@ -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>
@@ -41,16 +41,6 @@
<xi:include href="visual_index.xml" />
</chapter>
<chapter id="Lists">
<title>GListModel support</title>
<xi:include href="xml/gtkfilterlistmodel.xml" />
<xi:include href="xml/gtkflattenlistmodel.xml" />
<xi:include href="xml/gtkmaplistmodel.xml" />
<xi:include href="xml/gtkslicelistmodel.xml" />
<xi:include href="xml/gtksortlistmodel.xml" />
<xi:include href="xml/gtktreelistmodel.xml" />
</chapter>
<chapter id="Application">
<title>Application support</title>
<xi:include href="xml/gtkapplication.xml" />
@@ -71,6 +61,7 @@
<xi:include href="xml/gtkmessagedialog.xml" />
<xi:include href="xml/gtkaboutdialog.xml" />
<xi:include href="xml/gtkassistant.xml" />
<xi:include href="xml/gtkinvisible.xml" />
<xi:include href="xml/gtkwindowgroup.xml" />
</chapter>
@@ -88,6 +79,7 @@
<xi:include href="xml/gtkactionbar.xml" />
<xi:include href="xml/gtkheaderbar.xml" />
<xi:include href="xml/gtkoverlay.xml" />
<xi:include href="xml/gtkbbox.xml" />
<xi:include href="xml/gtkpaned.xml" />
<xi:include href="xml/gtklayout.xml" />
<xi:include href="xml/gtknotebook.xml" />
@@ -309,7 +301,6 @@
<title>Gestures and event handling</title>
<xi:include href="xml/gtkeventcontroller.xml" />
<xi:include href="xml/gtkeventcontrollerkey.xml" />
<xi:include href="xml/gtkeventcontrollerlegacy.xml" />
<xi:include href="xml/gtkeventcontrollerscroll.xml" />
<xi:include href="xml/gtkeventcontrollermotion.xml" />
<xi:include href="xml/gtkgesture.xml" />
@@ -328,7 +319,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" />
@@ -343,7 +334,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" />
@@ -354,15 +345,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>
@@ -371,7 +362,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" />
@@ -385,7 +376,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" />

View File

@@ -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>

View File

@@ -6,7 +6,7 @@
<refentryinfo>
<title>gtk4-icon-browser</title>
<productname>GTK</productname>
<productname>GTK+</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>

View File

@@ -6,7 +6,7 @@
<refentryinfo>
<title>gtk4-launch</title>
<productname>GTK</productname>
<productname>GTK+</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>

View File

@@ -6,7 +6,7 @@
<refentryinfo>
<title>gtk4-query-settings</title>
<productname>GTK</productname>
<productname>GTK+</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>

View File

@@ -1,3 +1,6 @@
<INCLUDE>gtk/gtk.h</INCLUDE>
<SECTION>
<FILE>gtkaboutdialog</FILE>
<TITLE>GtkAboutDialog</TITLE>
@@ -270,6 +273,31 @@ GtkAspectFramePrivate
gtk_aspect_frame_get_type
</SECTION>
<SECTION>
<FILE>gtkbbox</FILE>
<TITLE>GtkButtonBox</TITLE>
GtkButtonBox
GtkButtonBoxClass
gtk_button_box_new
gtk_button_box_get_layout
gtk_button_box_get_child_secondary
gtk_button_box_get_child_non_homogeneous
GtkButtonBoxStyle
gtk_button_box_set_layout
gtk_button_box_set_child_secondary
gtk_button_box_set_child_non_homogeneous
<SUBSECTION Standard>
GTK_BUTTON_BOX
GTK_IS_BUTTON_BOX
GTK_TYPE_BUTTON_BOX
GTK_BUTTON_BOX_CLASS
GTK_IS_BUTTON_BOX_CLASS
GTK_BUTTON_BOX_GET_CLASS
<SUBSECTION Private>
GtkButtonBoxPrivate
gtk_button_box_get_type
</SECTION>
<SECTION>
<FILE>gtkbin</FILE>
<TITLE>GtkBin</TITLE>
@@ -294,14 +322,17 @@ gtk_bin_get_type
GtkBox
GtkBoxClass
gtk_box_new
gtk_box_pack_start
gtk_box_pack_end
gtk_box_get_homogeneous
gtk_box_set_homogeneous
gtk_box_get_spacing
gtk_box_set_spacing
gtk_box_reorder_child
gtk_box_query_child_packing
gtk_box_set_child_packing
gtk_box_get_baseline_position
gtk_box_set_baseline_position
gtk_box_insert_child_after
gtk_box_reorder_child_after
<SUBSECTION Standard>
GTK_BOX
GTK_IS_BOX
@@ -411,30 +442,6 @@ gtk_list_box_get_type
gtk_list_box_row_get_type
</SECTION>
<SECTION>
<FILE>gtkselectionmodel</FILE>
<TITLE>GtkSelectionModel</TITLE>
GtkSelectionModel
gtk_selection_model_is_selected
gtk_selection_model_select_item
gtk_selection_model_unselect_item
gtk_selection_model_select_range
gtk_selection_model_unselect_range
gtk_selection_model_select_all
gtk_selection_model_unselect_all
<SUBSECTION>
gtk_selection_model_selection_changed
<SUBSECTION Standard>
GTK_SELECTION_MODEL
GTK_SELECTION_MODEL_CLASS
GTK_SELECTION_MODEL_GET_CLASS
GTK_IS_SELECTION_MODEL
GTK_IS_SELECTION_MODEL_CLASS
GTK_TYPE_SELECTION_MODEL
<SUBSECTION Private>
gtk_selection_model_get_type
</SECTION>
<SECTION>
<FILE>gtkbuildable</FILE>
GtkBuildable
@@ -751,6 +758,9 @@ gtk_container_child_set_valist
gtk_container_child_notify
gtk_container_child_notify_by_pspec
gtk_container_forall
gtk_container_get_focus_chain
gtk_container_set_focus_chain
gtk_container_unset_focus_chain
gtk_container_class_find_child_property
gtk_container_class_install_child_property
gtk_container_class_install_child_properties
@@ -1232,26 +1242,6 @@ GTK_TYPE_FILE_FILTER
gtk_file_filter_get_type
</SECTION>
<SECTION>
<FILE>gtkfilterlistmodel</FILE>
<TITLE>GtkFilterListModel</TITLE>
GtkFilterListModel
gtk_filter_list_model_new
gtk_filter_list_model_get_model
gtk_filter_list_model_set_filter_func
gtk_filter_list_model_has_filter
gtk_filter_list_model_refilter
<SUBSECTION Standard>
GTK_FILTER_LIST_MODEL
GTK_IS_FILTER_LIST_MODEL
GTK_TYPE_FILTER_LIST_MODEL
GTK_FILTER_LIST_MODEL_CLASS
GTK_IS_FILTER_LIST_MODEL_CLASS
GTK_FILTER_LIST_MODEL_GET_CLASS
<SUBSECTION Private>
gtk_filter_list_model_get_type
</SECTION>
<SECTION>
<FILE>gtkfixed</FILE>
<TITLE>GtkFixed</TITLE>
@@ -1272,24 +1262,6 @@ GtkFixedChild
gtk_fixed_get_type
</SECTION>
<SECTION>
<FILE>gtkflattenlistmodel</FILE>
<TITLE>GtkFlattenListModel</TITLE>
GtkFlattenListModel
gtk_flatten_list_model_new
gtk_flatten_list_model_set_model
gtk_flatten_list_model_get_model
<SUBSECTION Standard>
GTK_FLATTEN_LIST_MODEL
GTK_IS_FLATTEN_LIST_MODEL
GTK_TYPE_FLATTEN_LIST_MODEL
GTK_FLATTEN_LIST_MODEL_CLASS
GTK_IS_FLATTEN_LIST_MODEL_CLASS
GTK_FLATTEN_LIST_MODEL_GET_CLASS
<SUBSECTION Private>
gtk_flatten_list_model_get_type
</SECTION>
<SECTION>
<FILE>gtkfontbutton</FILE>
<TITLE>GtkFontButton</TITLE>
@@ -1610,6 +1582,23 @@ gtk_im_multicontext_get_type
GtkIMMulticontextPrivate
</SECTION>
<SECTION>
<FILE>gtkinvisible</FILE>
<TITLE>GtkInvisible</TITLE>
GtkInvisible
gtk_invisible_new
<SUBSECTION Standard>
GTK_INVISIBLE
GTK_IS_INVISIBLE
GTK_TYPE_INVISIBLE
GTK_INVISIBLE_CLASS
GTK_IS_INVISIBLE_CLASS
GTK_INVISIBLE_GET_CLASS
<SUBSECTION Private>
gtk_invisible_get_type
GtkInvisiblePrivate
</SECTION>
<SECTION>
<FILE>gtklabel</FILE>
<TITLE>GtkLabel</TITLE>
@@ -1720,27 +1709,6 @@ GtkLinkButtonPrivate
gtk_link_button_get_type
</SECTION>
<SECTION>
<FILE>gtkmaplistmodel</FILE>
<TITLE>GtkMapListModel</TITLE>
GtkMapListModel
GtkMapListModelMapFunc
gtk_map_list_model_new
gtk_map_list_model_set_map_func
gtk_map_list_model_set_model
gtk_map_list_model_get_model
gtk_map_list_model_has_map
<SUBSECTION Standard>
GTK_MAP_LIST_MODEL
GTK_IS_MAP_LIST_MODEL
GTK_TYPE_MAP_LIST_MODEL
GTK_MAP_LIST_MODEL_CLASS
GTK_IS_MAP_LIST_MODEL_CLASS
GTK_MAP_LIST_MODEL_GET_CLASS
<SUBSECTION Private>
gtk_map_list_model_get_type
</SECTION>
<SECTION>
<FILE>gtkmenu</FILE>
<TITLE>GtkMenu</TITLE>
@@ -2569,51 +2537,6 @@ GtkSizeGroupPrivate
gtk_size_group_get_type
</SECTION>
<SECTION>
<FILE>gtkslicelistmodel</FILE>
<TITLE>GtkSliceListModel</TITLE>
GtkSliceListModel
gtk_slice_list_model_new
gtk_slice_list_model_new_for_type
gtk_slice_list_model_set_model
gtk_slice_list_model_get_model
gtk_slice_list_model_set_offset
gtk_slice_list_model_get_offset
gtk_slice_list_model_set_size
gtk_slice_list_model_get_size
<SUBSECTION Standard>
GTK_SLICE_LIST_MODEL
GTK_IS_SLICE_LIST_MODEL
GTK_TYPE_SLICE_LIST_MODEL
GTK_SLICE_LIST_MODEL_CLASS
GTK_IS_SLICE_LIST_MODEL_CLASS
GTK_SLICE_LIST_MODEL_GET_CLASS
<SUBSECTION Private>
gtk_slice_list_model_get_type
</SECTION>
<SECTION>
<FILE>gtksortlistmodel</FILE>
<TITLE>GtkSortListModel</TITLE>
GtkSortListModel
gtk_sort_list_model_new
gtk_sort_list_model_new_for_type
gtk_sort_list_model_set_sort_func
gtk_sort_list_model_has_sort
gtk_sort_list_model_set_model
gtk_sort_list_model_get_model
gtk_sort_list_model_resort
<SUBSECTION Standard>
GTK_SORT_LIST_MODEL
GTK_IS_SORT_LIST_MODEL
GTK_TYPE_SORT_LIST_MODEL
GTK_SORT_LIST_MODEL_CLASS
GTK_IS_SORT_LIST_MODEL_CLASS
GTK_SORT_LIST_MODEL_GET_CLASS
<SUBSECTION Private>
gtk_sort_list_model_get_type
</SECTION>
<SECTION>
<FILE>gtkspinbutton</FILE>
<TITLE>GtkSpinButton</TITLE>
@@ -3338,6 +3261,7 @@ gtk_tooltip_set_icon
gtk_tooltip_set_icon_from_icon_name
gtk_tooltip_set_icon_from_gicon
gtk_tooltip_set_custom
gtk_tooltip_trigger_tooltip_query
gtk_tooltip_set_tip_area
<SUBSECTION Standard>
GTK_TYPE_TOOLTIP
@@ -3347,49 +3271,6 @@ GTK_TOOLTIP
gtk_tooltip_get_type
</SECTION>
<SECTION>
<FILE>gtktreelistmodel</FILE>
<TITLE>GtkTreeListModel</TITLE>
GtkTreeListModel
GtkTreeListRow
GtkTreeListModelCreateModelFunc
gtk_tree_list_model_new
gtk_tree_list_model_get_model
gtk_tree_list_model_get_passthrough
gtk_tree_list_model_set_autoexpand
gtk_tree_list_model_get_autoexpand
gtk_tree_list_model_get_child_row
gtk_tree_list_model_get_row
<SUBSECTION>
gtk_tree_list_row_get_item
gtk_tree_list_row_set_expanded
gtk_tree_list_row_get_expanded
gtk_tree_list_row_is_expandable
gtk_tree_list_row_get_position
gtk_tree_list_row_get_depth
gtk_tree_list_row_get_children
gtk_tree_list_row_get_parent
gtk_tree_list_row_get_child_row
<SUBSECTION Standard>
GTK_TREE_LIST_MODEL
GTK_IS_TREE_LIST_MODEL
GTK_TYPE_TREE_LIST_MODEL
GTK_TREE_LIST_MODEL_CLASS
GTK_IS_TREE_LIST_MODEL_CLASS
GTK_TREE_LIST_MODEL_GET_CLASS
GTK_TREE_LIST_ROW
GTK_IS_TREE_LIST_ROW
GTK_TYPE_TREE_LIST_ROW
GTK_TREE_LIST_ROW_CLASS
GTK_IS_TREE_LIST_ROW_CLASS
GTK_TREE_LIST_ROW_GET_CLASS
<SUBSECTION Private>
gtk_tree_list_model_get_type
gtk_tree_list_row_get_type
</SECTION>
<SECTION>
<FILE>gtktreemodel</FILE>
<TITLE>GtkTreeModel</TITLE>
@@ -4396,6 +4277,7 @@ gtk_widget_list_accel_closures
gtk_widget_can_activate_accel
gtk_widget_event
gtk_widget_activate
gtk_widget_intersect
gtk_widget_is_focus
gtk_widget_grab_focus
gtk_widget_grab_default
@@ -4578,10 +4460,6 @@ gtk_widget_class_bind_template_callback
gtk_widget_class_bind_template_callback_full
gtk_widget_class_set_connect_func
<SUBSECTION>
gtk_widget_observe_children
gtk_widget_observe_controllers
<SUBSECTION Standard>
GTK_WIDGET
GTK_IS_WIDGET
@@ -4625,7 +4503,6 @@ gtk_window_set_destroy_with_parent
gtk_window_set_display
gtk_window_is_active
gtk_window_is_maximized
gtk_window_get_toplevels
gtk_window_list_toplevels
gtk_window_add_mnemonic
gtk_window_remove_mnemonic
@@ -5351,6 +5228,7 @@ GtkPrintOperationPrivate
<SECTION>
<INCLUDE>gtk/gtkunixprint.h</INCLUDE>
<FILE>gtkprintunixdialog</FILE>
<TITLE>GtkPrintUnixDialog</TITLE>
GtkPrintUnixDialog
@@ -5698,6 +5576,7 @@ gtk_print_context_get_type
<SECTION>
<INCLUDE>gtk/gtkunixprint.h</INCLUDE>
<FILE>gtkprintjob</FILE>
<TITLE>GtkPrintJob</TITLE>
GtkPrintJob
@@ -5749,6 +5628,7 @@ gtk_print_job_get_type
<SECTION>
<INCLUDE>gtk/gtkunixprint.h</INCLUDE>
<FILE>gtkpagesetupunixdialog</FILE>
<TITLE>GtkPageSetupUnixDialog</TITLE>
GtkPageSetupUnixDialog
@@ -6576,24 +6456,6 @@ GTK_GESTURE_SINGLE_GET_CLASS
gtk_gesture_single_get_type
</SECTION>
<SECTION>
<FILE>gtkeventcontrollerlegacy</FILE>
<TITLE>GtkEventControllerlegacy</TITLE>
GtkEventControllerlegacy
gtk_event_controller_legacy_new
<SUBSECTION Standard>
GTK_TYPE_EVENT_CONTROLLER_LEGACY
GTK_EVENT_CONTROLLER_LEGACY
GTK_EVENT_CONTROLLER_LEGACY_CLASS
GTK_IS_EVENT_CONTROLLER_LEGACY
GTK_IS_EVENT_CONTROLLER_LEGACY_CLASS
GTK_EVENT_CONTROLLER_LEGACY_GET_CLASS
<SUBSECTION Private>
gtk_event_controller_legacy_get_type
</SECTION>
<SECTION>
<FILE>gtkeventcontrollerscroll</FILE>
<TITLE>GtkEventControllerScroll</TITLE>

View File

@@ -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

View File

@@ -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

View File

@@ -18,6 +18,7 @@ gtk_bin_get_type
gtk_box_get_type
gtk_builder_get_type
gtk_buildable_get_type
gtk_button_box_get_type
gtk_button_get_type
gtk_calendar_get_type
gtk_cell_area_get_type
@@ -53,7 +54,6 @@ gtk_entry_completion_get_type
gtk_entry_get_type
gtk_event_controller_get_type
gtk_event_controller_key_get_type
gtk_event_controller_legacy_get_type
gtk_event_controller_motion_get_type
gtk_event_controller_scroll_get_type
gtk_expander_get_type
@@ -90,6 +90,7 @@ gtk_im_context_get_type
gtk_im_context_simple_get_type
gtk_im_multicontext_get_type
gtk_info_bar_get_type
gtk_invisible_get_type
gtk_label_get_type
gtk_layout_get_type
gtk_link_button_get_type

View File

@@ -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.

View File

@@ -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

View File

@@ -11,6 +11,7 @@ private_headers = [
'gtkapplicationprivate.h',
'gtkbindingsprivate.h',
'gtkbitmaskprivate.h',
'gtkboxprivate.h',
'gtkbuilderprivate.h',
'gtkbuttonprivate.h',
'gtkcellareaboxcontextprivate.h',
@@ -339,6 +340,7 @@ content_files = [
'css-overview.xml',
'css-properties.xml',
'drawing-model.xml',
'getting_started.xml',
'glossary.xml',
'gtk4-broadwayd.xml',
'gtk4-builder-tool.xml',
@@ -370,6 +372,7 @@ content_files = [
expand_content_files = [
'compiling.sgml',
'drawing-model.xml',
'getting_started.xml',
'glossary.xml',
'input-handling.xml',
'migrating-2to4.xml',
@@ -380,7 +383,6 @@ expand_content_files = [
]
configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
configure_file(input: 'getting_started.xml.in', output: 'getting_started.xml', configuration: src_dir_conf)
types_conf = configuration_data()
if os_win32
@@ -411,9 +413,6 @@ gnome.gtkdoc('gtk4',
'--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
'--ignore-headers=' + ' '.join(private_headers),
],
mkdb_args: [
'--default-includes=gtk/gtk.h',
],
fixxref_args: [
'--html-dir=@0@'.format(docpath),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),

View File

@@ -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>

View File

@@ -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>
GTK4 removes these #GtkBox child properties, so you should not use them.
GTK+4 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,35 +172,8 @@
<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.
</para>
</section>
<section>
<title>Set a proper app_id</title>
<para>
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 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 GTK4.
</para>
</section>
<section>
<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 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.
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>
@@ -212,15 +185,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 +211,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 +219,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 +248,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>
@@ -297,14 +270,6 @@
</para>
</section>
<section>
<title>Stop using GtkEventBox</title>
<para>
GtkEventBox is no longer needed and has been removed.
All widgets receive all events.
</para>
</section>
<section>
<title>Adapt to GtkHeaderBar API changes</title>
<para>
@@ -328,7 +293,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 +302,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 +311,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, GTK4 uses
family of functions. To simplify widget implementations, GTK+4 uses
only one virtual function, GtkWidgetClass::measure() that widgets
have to implement.
</para>
@@ -366,7 +331,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 +343,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 +351,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 +368,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 +399,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>
@@ -443,10 +408,6 @@
from ui files it run the command <command>gtk4-builder-tool simplify --replace</command>
on them.
</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.
</para>
</section>
<section>
@@ -487,8 +448,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 +505,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>

View File

@@ -4,34 +4,34 @@
]>
<refentry id="gtk-osx">
<refmeta>
<refentrytitle>Using GTK on Apple macOS</refentrytitle>
<refentrytitle>Using GTK+ on Mac OS X</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Using GTK on Apple macOS</refname>
<refname>Using GTK+ on Mac OS X</refname>
<refpurpose>
MacOS-specific aspects of using GTK
OS X-specific aspects of using GTK+
</refpurpose>
</refnamediv>
<refsect1>
<title>Using GTK on Apple macOS</title>
<title>Using GTK+ on Mac OS X</title>
<para>
The Apple macOS port of GTK is an implementation of GDK (and therefore GTK)
on top of the Quartz API.
The Mac OS X port of GTK+ is an implementation of GDK (and therefore GTK+)
on top of the Quarz API.
</para>
<para>
Currently, the macOS port does not use any additional commandline options
Currently, the Mac OS X 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>

Some files were not shown because too many files have changed in this diff Show More