: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` :Constructors: :: Banner(**properties) new(title:str) -> Gtk.Widget 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 label to show on the button. 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 .. attribute:: props.revealed :type: bool Whether the banner is currently revealed. .. versionadded:: 1.3 .. attribute:: props.title :type: str The title for this banner. See also: :obj:`~gi.repository.Adw.Banner.props.use_markup`. .. versionadded:: 1.3 .. attribute:: props.use_markup :type: bool Whether to use Pango markup for the banner title. See also :obj:`~gi.repository.Pango.parse_markup`. .. versionadded:: 1.3 Signals ------- .. rst-class:: interim-class .. class:: Banner.signals :no-index: .. method:: button_clicked() -> None This signal is emitted after the action button has been clicked. It can be used as an alternative to setting an action. .. versionadded:: 1.3