Adw.Application

g Adw.Application Adw.Application GObject.GInterface GObject.GInterface Gio.ActionGroup Gio.ActionGroup GObject.GInterface->Gio.ActionGroup Gio.ActionMap Gio.ActionMap GObject.GInterface->Gio.ActionMap GObject.Object GObject.Object Gio.Application Gio.Application GObject.Object->Gio.Application Gio.ActionGroup->Gio.Application Gio.ActionMap->Gio.Application Gtk.Application Gtk.Application Gio.Application->Gtk.Application Gtk.Application->Adw.Application

Subclasses:

None

Methods

Inherited:

Gtk.Application (15), Gio.Application (39), GObject.Object (37), Gio.ActionGroup (14), Gio.ActionMap (5)

Structs:

GObject.ObjectClass (5)

class

new (application_id, flags)

get_style_manager ()

Virtual Methods

Inherited:

Gtk.Application (2), Gio.Application (15), GObject.Object (7), Gio.ActionGroup (14), Gio.ActionMap (3)

Properties

Inherited:

Gtk.Application (4), Gio.Application (9)

Name

Type

Flags

Short Description

style-manager

Adw.StyleManager

r

Signals

Inherited:

Gtk.Application (3), Gio.Application (7), GObject.Object (1), Gio.ActionGroup (4)

Fields

Inherited:

Gtk.Application (3), Gio.Application (7), GObject.Object (1), Gio.ActionGroup (4)

Name

Type

Access

Description

parent_instance

Gtk.Application

r

Class Details

class Adw.Application(**kwargs)
Bases:

Gtk.Application

Abstract:

No

Structure:

Adw.ApplicationClass

A base class for Adwaita applications.

AdwApplication handles library initialization by calling [func`init`] in the default [signal`Gio`.Application::startup] signal handler, in turn chaining up as required by [class`Gtk`.Application]. Therefore, any subclass of AdwApplication should always chain up its startup handler before using any Adwaita or GTK API.

Automatic Resources

AdwApplication will automatically load certain resources located in the application’s resource base path (see [method`Gio`.Application.set_resource_base_path], if they’re present.

### Shortcuts Dialog

If there’s a resource located at shortcuts-dialog.ui which defines an [class`ShortcutsDialog`] with the ID shortcuts_dialog, AdwApplication will set up an app.shortcuts action that creates and presents this dialog, as well as a <kbd>Ctrl</kbd><kbd>?</kbd> accelerator for it.

### Stylesheet

If there’s a resource located at style.css, AdwApplication will load styles from it. This can be used to add custom styles to the application.

#### Additional styles (deprecated)

AdwApplication will also load the following stylesheets conditionally:

  • style-dark.css when [property`StyleManager`:py:data::dark<Adw.Application.props.dark>] is TRUE.

  • style-hc.css when the system high contrast preference is enabled.

  • style-hc-dark.css when the system high contrast preference is enabled and [property`StyleManager`:py:data::dark<Adw.Application.props.dark>] is TRUE.

:::warning These resources are deprecated since 1.9.

Use style.css with the following media queries instead:

  • prefers-color-scheme: dark for styles used only for dark appearance.

    • prefers-contrast: more for styles used only when the system high contrast preference is enabled.

classmethod new(application_id, flags)
Parameters:
Returns:

the newly created AdwApplication

Return type:

Adw.Application

Creates a new AdwApplication.

If application_id is not NULL, then it must be valid. See [func`Gio`.Application.id_is_valid].

If no application ID is given then some features (most notably application uniqueness) will be disabled.

get_style_manager()
Returns:

the style manager

Return type:

Adw.StyleManager

Gets the style manager for self.

This is a convenience property allowing to access AdwStyleManager through property bindings or expressions.

Property Details

Adw.Application.props.style_manager
Name:

style-manager

Type:

Adw.StyleManager

Default Value:

None

Flags:

READABLE

The style manager for this application.

This is a convenience property allowing to access AdwStyleManager through property bindings or expressions.