:right-sidebar: True NavigationPage =================================================================== .. currentmodule:: gi.repository.Adw .. versionadded:: 1.4 .. class:: NavigationPage(**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.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` A page within :obj:`~gi.repository.Adw.NavigationView` or :obj:`~gi.repository.Adw.NavigationSplitView`\. Each page has a child widget, a title and optionally a tag. The :obj:`~gi.repository.Adw.NavigationPage.signals.showing`\, :obj:`~gi.repository.Adw.NavigationPage.signals.shown`\, :obj:`~gi.repository.Adw.NavigationPage.signals.hiding` and :obj:`~gi.repository.Adw.NavigationPage.signals.hidden` signals can be used to track the page's visibility within its ``AdwNavigationView``\. Header Bar Integration -------------------------------------------------------------------------------- When placed inside ``AdwNavigationPage``\, :obj:`~gi.repository.Adw.HeaderBar` will display the page title instead of window title. When used together with :obj:`~gi.repository.Adw.NavigationView`\, it will also display a back button that can be used to go back to the previous page. Set :obj:`~gi.repository.Adw.HeaderBar.props.show_back_button` to ``FALSE`` to disable that behavior if it's unwanted. CSS Nodes -------------------------------------------------------------------------------- ``AdwNavigationPage`` has a single CSS node with name ``navigation-view-page``\. Accessibility -------------------------------------------------------------------------------- ``AdwNavigationPage`` uses the ``GTK_ACCESSIBLE_ROLE_GROUP`` role. Constructors ------------ .. rst-class:: interim-class .. class:: NavigationPage :no-index: .. classmethod:: new(child: ~gi.repository.Gtk.Widget, title: str) -> ~gi.repository.Adw.NavigationPage Creates a new ``AdwNavigationPage``\. .. versionadded:: 1.4 :param child: the child widget :param title: the page title .. classmethod:: new_with_tag(child: ~gi.repository.Gtk.Widget, title: str, tag: str) -> ~gi.repository.Adw.NavigationPage Creates a new ``AdwNavigationPage`` with provided tag. .. versionadded:: 1.4 :param child: the child widget :param title: the page title :param tag: the page tag Methods ------- .. rst-class:: interim-class .. class:: NavigationPage :no-index: .. method:: do_hidden(self) -> None .. method:: do_hiding(self) -> None .. method:: do_showing(self) -> None .. method:: do_shown(self) -> None .. method:: get_can_pop() -> bool Gets whether ``self`` can be popped from navigation stack. .. versionadded:: 1.4 .. method:: get_child() -> ~gi.repository.Gtk.Widget | None Gets the child widget of ``self``\. .. versionadded:: 1.4 .. method:: get_tag() -> str | None Gets the tag of ``self``\. .. versionadded:: 1.4 .. method:: get_title() -> str Gets the title of ``self``\. .. versionadded:: 1.4 .. method:: set_can_pop(can_pop: bool) -> None Sets whether ``self`` can be popped from navigation stack. Set it to ``FALSE`` to disable shortcuts and gestures, as well as remove the back button from :obj:`~gi.repository.Adw.HeaderBar`\. Manually calling :obj:`~gi.repository.NavigationView.pop` or using the ``navigation.pop`` action will still work. See :obj:`~gi.repository.Adw.HeaderBar.props.show_back_button` for removing only the back button, but not shortcuts. .. versionadded:: 1.4 :param can_pop: whether the page can be popped from navigation stack .. method:: set_child(child: ~gi.repository.Gtk.Widget | None = None) -> None Sets the child widget of ``self``\. .. versionadded:: 1.4 :param child: the child widget .. method:: set_tag(tag: str | None = None) -> None Sets the tag for ``self``\. The tag can be used to retrieve the page with :obj:`~gi.repository.NavigationView.find_page`\, as well as with :obj:`~gi.repository.NavigationView.push_by_tag`\, :obj:`~gi.repository.NavigationView.pop_to_tag` or :obj:`~gi.repository.NavigationView.replace_with_tags`\. Tags must be unique within each :obj:`~gi.repository.Adw.NavigationView`\. The tag also must be set to use the ``navigation.push`` action. .. versionadded:: 1.4 :param tag: the page tag .. method:: set_title(title: str) -> None Sets the title of ``self``\. It's displayed in :obj:`~gi.repository.Adw.HeaderBar` instead of the window title, and used as the tooltip on the next page's back button, as well as by screen reader. .. versionadded:: 1.4 :param title: the title Properties ---------- .. rst-class:: interim-class .. class:: NavigationPage :no-index: .. attribute:: props.can_pop :type: bool The type of the None singleton. .. versionadded:: 1.4 .. attribute:: props.child :type: ~gi.repository.Gtk.Widget The type of the None singleton. .. versionadded:: 1.4 .. attribute:: props.tag :type: str The type of the None singleton. .. versionadded:: 1.4 .. attribute:: props.title :type: str The type of the None singleton. .. versionadded:: 1.4 Signals ------- .. rst-class:: interim-class .. class:: NavigationPage.signals :no-index: .. method:: hidden() -> None The type of the None singleton. .. versionadded:: 1.4 .. method:: hiding() -> None The type of the None singleton. .. versionadded:: 1.4 .. method:: showing() -> None The type of the None singleton. .. versionadded:: 1.4 .. method:: shown() -> None The type of the None singleton. .. versionadded:: 1.4 Virtual Methods --------------- .. rst-class:: interim-class .. class:: NavigationPage :no-index: .. method:: do_hidden() -> None The type of the None singleton. .. versionadded:: 1.4 .. method:: do_hiding() -> None The type of the None singleton. .. versionadded:: 1.4 .. method:: do_showing() -> None The type of the None singleton. .. versionadded:: 1.4 .. method:: do_shown() -> None The type of the None singleton. .. versionadded:: 1.4 Fields ------ .. rst-class:: interim-class .. class:: NavigationPage :no-index: .. attribute:: parent_instance