:right-sidebar: True Banner =================================================================== .. currentmodule:: gi.repository.Adw .. versionadded:: 1.3 .. class:: Banner(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Actionable`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` A bar with contextual information. .. image:: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/banner.png Banners are hidden by default, use :obj:`~gi.repository.Adw.Banner.props.revealed` to show them. Banners have a title, set with :obj:`~gi.repository.Adw.Banner.props.title`\. Titles can be marked up with Pango markup, use :obj:`~gi.repository.Adw.Banner.props.use_markup` to enable it. The title will be shown centered or left-aligned depending on available space. Banners can optionally have a button with text on it, set through :obj:`~gi.repository.Adw.Banner.props.button_label`\. The button can be used with a ``GAction``\, or with the :obj:`~gi.repository.Adw.Banner.signals.button_clicked` signal. CSS nodes -------------------------------------------------------------------------------- ``AdwBanner`` has a main CSS node with the name ``banner``\. Constructors ------------ .. rst-class:: interim-class .. class:: Banner :no-index: .. classmethod:: new(title: str) -> ~gi.repository.Gtk.Widget Creates a new ``AdwBanner``\. .. versionadded:: 1.3 :param title: the banner title Methods ------- .. rst-class:: interim-class .. class:: Banner :no-index: .. method:: get_button_label() -> str | None Gets the button label for ``self``\. .. versionadded:: 1.3 .. method:: get_revealed() -> bool Gets if a banner is revealed .. versionadded:: 1.3 .. method:: get_title() -> str Gets the title for ``self``\. .. versionadded:: 1.3 .. method:: get_use_markup() -> bool Gets whether to use Pango markup for the banner title. .. versionadded:: 1.3 .. method:: set_button_label(label: str | None = None) -> None Sets the button label for ``self``\. If set to ``""`` or ``NULL``\, the button won't be shown. The button can be used with a ``GAction``\, or with the :obj:`~gi.repository.Adw.Banner.signals.button_clicked` signal. .. versionadded:: 1.3 :param label: the label .. method:: set_revealed(revealed: bool) -> None Sets whether a banner should be revealed .. versionadded:: 1.3 :param revealed: whether a banner should be revealed .. method:: set_title(title: str) -> None Sets the title for this banner. See also: :obj:`~gi.repository.Adw.Banner.props.use_markup`\. .. versionadded:: 1.3 :param title: the title .. method:: set_use_markup(use_markup: bool) -> None Sets whether to use Pango markup for the banner title. See also :obj:`~gi.repository.Pango.parse_markup`\. .. versionadded:: 1.3 :param use_markup: whether to use markup Properties ---------- .. rst-class:: interim-class .. class:: Banner :no-index: .. attribute:: props.button_label :type: str The type of the None singleton. .. versionadded:: 1.3 .. attribute:: props.revealed :type: bool The type of the None singleton. .. versionadded:: 1.3 .. attribute:: props.title :type: str The type of the None singleton. .. versionadded:: 1.3 .. attribute:: props.use_markup :type: bool The type of the None singleton. .. versionadded:: 1.3 Signals ------- .. rst-class:: interim-class .. class:: Banner.signals :no-index: .. method:: button_clicked() -> None The type of the None singleton. .. versionadded:: 1.3