:right-sidebar: True Application =================================================================== .. currentmodule:: gi.repository.Adw .. class:: Application(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Application`, :class:`~gi.repository.Gio.Application`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gio.ActionGroup`, :class:`~gi.repository.Gio.ActionMap` A base class for Adwaita applications. ``AdwApplication`` handles library initialization by calling :obj:`~gi.repository.Adw.init` in the default :obj:`~gi.repository.Gio.Application.signals.startup` signal handler, in turn chaining up as required by :obj:`~gi.repository.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 stylesheets located in the application's resource base path (see :obj:`~gi.repository.Gio.Application.set_resource_base_path`, if they're present. They can be used to add custom styles to the application, as follows: - ``style.css`` contains styles that are always present. - ``style-dark.css`` contains styles only used when :obj:`~gi.repository.Adw.StyleManager.props.dark` is ``TRUE``. - ``style-hc.css`` contains styles used when the system high contrast preference is enabled. - ``style-hc-dark.css`` contains styles used when the system high contrast preference is enabled and :obj:`~gi.repository.Adw.StyleManager.props.dark` is ``TRUE``. Constructors ------------ .. rst-class:: interim-class .. class:: Application :no-index: .. classmethod:: new(application_id: str | None, flags: ~gi.repository.Gio.ApplicationFlags) -> ~gi.repository.Adw.Application Creates a new ``AdwApplication``. If ``application_id`` is not ``NULL``, then it must be valid. See :obj:`~gi.repository.Gio.Application.id_is_valid`. If no application ID is given then some features (most notably application uniqueness) will be disabled. :param application_id: The application ID :param flags: The application flags Methods ------- .. rst-class:: interim-class .. class:: Application :no-index: .. method:: get_style_manager() -> ~gi.repository.Adw.StyleManager Gets the style manager for ``self``. This is a convenience property allowing to access ``AdwStyleManager`` through property bindings or expressions. Properties ---------- .. rst-class:: interim-class .. class:: Application :no-index: .. attribute:: props.style_manager :type: ~gi.repository.Adw.StyleManager The style manager for this application. This is a convenience property allowing to access ``AdwStyleManager`` through property bindings or expressions. Fields ------ .. rst-class:: interim-class .. class:: Application :no-index: .. attribute:: parent_instance