GTK-3.24.52

#### Beyond Linux® From Scratch (systemd Edition) - Version r13.1-84

### Chapter 25. Graphical Environment Libraries

- Prev

  Graphene-1.10.8

- Next

  GTK-4.22.4

- Up
- Home

# GTK-3.24.52

## Introduction to GTK3

The GTK3 package contains libraries used for creating graphical user interfaces for applications.

### Note

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

### Package Information

- Download (HTTP): https://download.gnome.org/sources/gtk/3.24/gtk-3.24.52.tar.xz

- Download MD5 sum: 4dfad1e56bf8ad25dfab58add17e7146

- Download size: 13 MB

- Estimated disk space required: 302 MB (with tests)

- Estimated build time: 0.6 SBU (using parallelism=4; add 2.4 SBU for tests)

### GTK3 Dependencies

#### Required

at-spi2-core-2.60.6, gdk-pixbuf-2.44.7, libepoxy-1.5.10, and Pango-1.58.2

#### Recommended

adwaita-icon-theme-50.0 (at runtime; default for some gtk3 settings keys) docbook-xsl-nons-1.79.2 (for generating manual pages), hicolor-icon-theme-0.18 (needed for tests), ISO Codes-4.20.1, libxkbcommon-1.13.2, libxslt-1.1.45 (for generating manual pages), Wayland-1.26.0, and wayland-protocols-1.49

#### Recommended (Required if building GNOME)

GLib-2.88.3 (with GObject Introspection)

#### Optional

colord-1.4.8, Cups-2.4.19, Evince-48.4 (runtime for the print previewer), GTK-Doc-1.36.1, libcloudproviders-0.3.6, PyAtSpi2-2.58.2 (for tests), sassc-3.6.2, tinysparql-3.11.1, and PAPI

## Installation of GTK3

Install GTK3 by running the following commands:

    mkdir build &&
    cd    build &&

    meson setup ..            \
          --prefix=/usr       \
          --buildtype=release \
          -D man=true         \
          -D broadway_backend=true &&
    ninja

To test the results you need a graphical session, then issue dbus-run-session ninja test.

One test, `gtk:a11y / tree-relationships`, is known to fail with a recent librsvg release. Another test, `gtk:reftest treeview-fixed-height.ui`, is known to fail due to small output differences compared to what the test suite expects.

Now, as the `root` user:

    ninja install

### Note

If you installed the package on to your system using a “DESTDIR” method, an important file was not installed and must be copied and/or generated. Generate it using the following command as the `root` user:

    gtk-query-immodules-3.0 --update-cache

### Note

If you installed the package to your system using a “DESTDIR” method, `/usr/share/glib-2.0/schemas/gschemas.compiled` was not updated/created. Create (or update) the file using the following command as the `root` user:

    glib-compile-schemas /usr/share/glib-2.0/schemas

## Command Explanations

`-D broadway_backend=true`: This switch enables the HTML5 GTK backend.

`-D man=true`: This switch allows generating manual pages.

`-D gtk_doc=true`: This switch enables building documentation. It requires GTK-Doc-1.36.1.

`-D tracker3=true`: This switch enables the search function based on TinySPARQL in the GTK3 file chooser dialog. It requires tinysparql-3.11.1.

`-D cloudproviders=true`: Use this switch if you have libcloudproviders-0.3.6 installed and wish to enable support for cloud providers in a file chooser window.

## Configuring GTK3

### Config Files

`~/.config/gtk-3.0/settings.ini` and `/etc/gtk-3.0/settings.ini`

### Configuration Information

GTK3 themes change the way a GTK3 application looks. An icon theme can be used to change the icons that appear on the application's toolbar. If you have installed a GTK3 theme (e.g. the Adwaita theme built in GTK3), an icon theme (such as oxygen-icons-6.29.0) and/or a font (Dejavu fonts), you can set your preferences in `~/.config/gtk-3.0/settings.ini`, or the default system wide configuration file (as the `root` user), in `/etc/gtk-3.0/settings.ini`. For the local user an example is:

    mkdir -vp ~/.config/gtk-3.0
    cat > ~/.config/gtk-3.0/settings.ini << "EOF"
    [Settings]
    gtk-theme-name = Adwaita
    gtk-icon-theme-name = oxygen
    gtk-font-name = DejaVu Sans 12
    gtk-cursor-theme-size = 18
    gtk-toolbar-style = GTK_TOOLBAR_BOTH_HORIZ
    gtk-xft-antialias = 1
    gtk-xft-hinting = 1
    gtk-xft-hintstyle = hintslight
    gtk-xft-rgba = rgb
    gtk-cursor-theme-name = Adwaita
    EOF

There are many settings keys, some with default values. You can find them at Settings: GTK3 Reference Manual. There are many more themes available at https://www.gnome-look.org/browse/ and other places.

As part of GTK-3.0's redesign, the scroll bar buttons are no longer visible on the scrollbar in many applications. If this functionality is desired, modify the `gtk.css` file and restore them using the following command:

    cat > ~/.config/gtk-3.0/gtk.css << "EOF"
    *  {
       -GtkScrollbar-has-backward-stepper: 1;
       -GtkScrollbar-has-forward-stepper: 1;
    }
    EOF

## Contents

Installed Programs: broadwayd, gtk3-demo, gtk3-demo-application, gtk3-icon-browser, gtk3-widget-factory, gtk-builder-tool, gtk-encode-symbolic-svg, gtk-launch, gtk-query-immodules-3.0, gtk-query-settings, and gtk-update-icon-cache
Installed Libraries: libgailutil-3.so, libgdk-3.so, and libgtk-3.so
Installed Directories: /etc/gtk-3.0, /usr/include/{gail,gtk}-3.0, /usr/{lib,share}/gtk-3.0, and /usr/share/themes/{Default,Emacs}/gtk-3.0

### Short Descriptions

broadwayd | provides support for displaying GTK3 applications in a web browser, using HTML5 and web sockets
gtk3-demo | is a simple program that demonstrates some of the tasks that can be done with GTK3
gtk3-demo-application | is a simple GTK3 application
gtk3-icon-browser | is a utility to explore the icons in the current icon theme. It shows icons in various sizes, their symbolic variants where available, as well as a description of the icon and its context
gtk3-widget-factory | is a program to view GTK3 themes and widgets
gtk-builder-tool | performs various operations on GtkBuilder .ui files
gtk-encode-symbolic-svg | converts symbolic SVG icons into specially prepared PNG files. GTK3 can load and recolor these PNGs, just like original SVGs, but loading them is much faster
gtk-launch | launches an application using the given name. The name should match the application desktop file name, as residing in `/usr/share/applications`, with or without the '.desktop' suffix
gtk-query-immodules-3.0 | collects information about loadable input method modules for GTK3 and writes it to the default cache file location, or to standard output
gtk-query-settings | provides a complete listing of all settings related to GTK3
gtk-update-icon-cache | is an icon theme caching utility that creates mmap()able cache files for icon themes
`libgailutil-3.so` | contains functions that implement the accessibility interfaces defined by the GNOME Accessibility Toolkit
`libgdk-3.so` | contains functions that act as a wrapper around the low-level drawing and windowing functions provided by the underlying graphics system
`libgtk-3.so` | contains functions that provide an API to implement graphical user interfaces

- Prev

  Graphene-1.10.8

- Next

  GTK-4.22.4

- Up
- Home