NavigationPage
Added in version 1.4.
Superclasses: Widget
, InitiallyUnowned
, Object
Implemented Interfaces: Accessible
, Buildable
, ConstraintTarget
A page within NavigationView
or NavigationSplitView
.
Each page has a child widget, a title and optionally a tag.
The showing
, shown
,
hiding
and hidden
signals
can be used to track the page’s visibility within its AdwNavigationView
.
Header Bar Integration
When placed inside AdwNavigationPage
, HeaderBar
will display the
page title instead of window title.
When used together with NavigationView
, it will also display a back
button that can be used to go back to the previous page. Set
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
- class NavigationPage
- classmethod new(child: Widget, title: str) → NavigationPage
Creates a new
AdwNavigationPage
.Added in version 1.4.
- Parameters:
child – the child widget
title – the page title
- classmethod new_with_tag(child: Widget, title: str, tag: str) → NavigationPage
Creates a new
AdwNavigationPage
with provided tag.Added in version 1.4.
- Parameters:
child – the child widget
title – the page title
tag – the page tag
Methods
- class NavigationPage
-
- 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 fromHeaderBar
.Manually calling
pop
or using thenavigation.pop
action will still work.See
show_back_button
for removing only the back button, but not shortcuts.Added in version 1.4.
- Parameters:
can_pop – whether the page can be popped from navigation stack
- set_child(child: Widget | None = None) → None
Sets the child widget of
self
.Added in version 1.4.
- Parameters:
child – the child widget
- set_tag(tag: str | None = None) → None
Sets the tag for
self
.The tag can be used to retrieve the page with
find_page
, as well as withpush_by_tag
,pop_to_tag
orreplace_with_tags
.Tags must be unique within each
NavigationView
.The tag also must be set to use the
navigation.push
action.Added in version 1.4.
- Parameters:
tag – the page tag
Properties
- class NavigationPage
- props.can_pop: bool
Whether the page can be popped from navigation stack.
Set it to
FALSE
to disable shortcuts and gestures, as well as remove the back button fromHeaderBar
.Manually calling
pop
or using thenavigation.pop
action will still work.See
show_back_button
for removing only the back button, but not shortcuts.Added in version 1.4.
- props.tag: str
The page tag.
The tag can be used to retrieve the page with
find_page
, as well as withpush_by_tag
,pop_to_tag
orreplace_with_tags
.Tags must be unique within each
NavigationView
.The tag also must be set to use the
navigation.push
action.Added in version 1.4.
Signals
- class NavigationPage.signals
- hidden() → None
Emitted when the navigation view transition has been completed and the page is fully hidden.
It will always be preceded by
hiding
orshowing
.Added in version 1.4.
- hiding() → None
Emitted when the page starts hiding at the beginning of the navigation view transition.
It will always be followed by
hidden
orshown
.Added in version 1.4.
Virtual Methods
- class NavigationPage
- do_hidden() → None
Called when the navigation view transition has been completed and the page is fully hidden.
Added in version 1.4.
- do_hiding() → None
Called when the page starts hiding at the beginning of the navigation view transition.
Added in version 1.4.
Fields
- class NavigationPage
- parent_instance