Settings


Object Hierarchy:

Gtk.Settings Gtk.Settings Gtk.Settings GLib.Object GLib.Object GLib.Object->Gtk.Settings Gtk.StyleProvider Gtk.StyleProvider Gtk.StyleProvider->Gtk.Settings

Description:

[ CCode ( type_id = "gtk_settings_get_type ()" ) ]
public sealed class Settings : Object, StyleProvider

Provides a mechanism to share global settings between applications.

GTK relies on the platform-specific API for getting desktop-wide settings.

On Wayland, the settings are obtained via a settings portal that is part of the Linux desktop APIs for application.

On the X window system, this sharing is realized by an XSettings manager.

On macOS, the settings are obtained from `NSUserDefaults`.

In the absence of these sharing mechanisms, GTK reads default values for settings from `settings.ini` files in `/etc/gtk-4.0`, `$XDG_CONFIG_DIRS/gtk-4.0` and `$XDG_CONFIG_HOME/gtk-4.0`. These files must be valid key files (see `GKeyFile`), and have a section called Settings. Themes can also provide default values for settings by installing a `settings.ini` file next to their `gtk.css` file.

Applications can override system-wide settings by setting the property of the `GtkSettings` object with @set. This should be restricted to special cases though; `GtkSettings` are not meant as an application configuration facility.

There is one `GtkSettings` instance per display. It can be obtained with [func@Gtk.Settings.get_for_display], but in many cases, it is more convenient to use [method@Gtk.Widget.get_settings].


Namespace: Gtk
Package: gtk4

Content:

Properties:

Static methods:

Creation methods:

Methods:

Inherited Members:

All known members inherited from interface Gtk.StyleProvider