Application#
- class Application(*args, **kwargs)#
Superclasses: Application, Application, Object
Implemented Interfaces: ActionGroup, ActionMap
A base class for Adwaita applications.
AdwApplication handles library initialization by calling init in the
default startup signal handler, in turn chaining up
as required by 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
set_resource_base_path, if they’re present.
Shortcuts Dialog#
If there’s a resource located at shortcuts-dialog.ui which defines an
ShortcutsDialog with the ID shortcuts_dialog, AdwApplication
will set up an app.shortcuts action that creates and presents this dialog,
as well as a Ctrl<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.csswhendarkisTRUE.style-hc.csswhen the system high contrast preference is enabled.style-hc-dark.csswhen the system high contrast preference is enabled anddarkisTRUE.
- :::warning
These resources are deprecated since 1.9.
Use style.css with the following media queries instead:
prefers-color-scheme: darkfor styles used only for dark appearance.prefers-contrast: morefor styles used only when the system high contrast preference is enabled.
Constructors#
- class Application
- classmethod new(application_id: str | None, flags: ApplicationFlags) Application#
Creates a new
AdwApplication.If
application_idis notNULL, then it must be valid. Seeid_is_valid.If no application ID is given then some features (most notably application uniqueness) will be disabled.
- Parameters:
application_id – The application ID
flags – The application flags
Methods#
- class Application
- get_style_manager() StyleManager#
Gets the style manager for
self.This is a convenience property allowing to access
AdwStyleManagerthrough property bindings or expressions.
Properties#
- class Application
- props.style_manager: StyleManager#
The style manager for this application.
This is a convenience property allowing to access
AdwStyleManagerthrough property bindings or expressions.
Fields#
- class Application
- parent_instance#