Adw.NavigationPage¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)
|
|
|
|
|
|
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when the navigation view transition has been completed and the page is fully hidden. |
|
Emitted when the page starts hiding at the beginning of the navigation view transition. |
|
Emitted when the page shows at the beginning of the navigation view transition. |
|
Emitted when the navigation view transition has been completed and the page is fully shown. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Adw.NavigationPage(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A page within [class`NavigationView`] or [class`NavigationSplitView`].
Each page has a child widget, a title and optionally a tag.
The [signal`NavigationPage`:py:func:::showing<Adw.NavigationPage.signals.showing>], [signal`NavigationPage`:py:func:::shown<Adw.NavigationPage.signals.shown>], [signal`NavigationPage`:py:func:::hiding<Adw.NavigationPage.signals.hiding>] and [signal`NavigationPage`:py:func:::hidden<Adw.NavigationPage.signals.hidden>] signals can be used to track the page’s visibility within its
AdwNavigationView
.- Header Bar Integration
When placed inside
AdwNavigationPage
, [class`HeaderBar`] will display the page title instead of window title.When used together with [class`NavigationView`], it will also display a back button that can be used to go back to the previous page. Set [property`HeaderBar`:py:data::show-back-button<Adw.NavigationPage.props.show_back_button>] to
FALSE
to disable that behavior if it’s unwanted.- CSS Nodes
AdwNavigationPage
has a single CSS node with namenavigation-view-page
.- Accessibility
AdwNavigationPage
uses theGTK_ACCESSIBLE_ROLE_GROUP
role.New in version 1.4.
- classmethod new(child, title)¶
- Parameters:
child (
Gtk.Widget
) – the child widgettitle (
str
) – the page title
- Returns:
the new created
AdwNavigationPage
- Return type:
Creates a new
AdwNavigationPage
.New in version 1.4.
- classmethod new_with_tag(child, title, tag)¶
- Parameters:
child (
Gtk.Widget
) – the child widgettitle (
str
) – the page titletag (
str
) – the page tag
- Returns:
the new created
AdwNavigationPage
- Return type:
Creates a new
AdwNavigationPage
with provided tag.New in version 1.4.
- get_can_pop()¶
- Returns:
whether the page can be popped from navigation stack
- Return type:
Gets whether self can be popped from navigation stack.
New in version 1.4.
- get_child()¶
- Returns:
the child widget of self
- Return type:
Gtk.Widget
orNone
Gets the child widget of self.
New in version 1.4.
- get_title()¶
- Returns:
the title of self
- Return type:
Gets the title of self.
New in version 1.4.
- set_can_pop(can_pop)¶
- Parameters:
can_pop (
bool
) – whether the page can be popped from navigation stack
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 [class`HeaderBar`].Manually calling [method`NavigationView`.pop] or using the
navigation.pop
action will still work.See [property`HeaderBar`:py:data::show-back-button<Adw.NavigationPage.props.show_back_button>] for removing only the back button, but not shortcuts.
New in version 1.4.
- set_child(child)¶
- Parameters:
child (
Gtk.Widget
orNone
) – the child widget
Sets the child widget of self.
New in version 1.4.
- set_tag(tag)¶
-
Sets the tag for self.
The tag can be used to retrieve the page with [method`NavigationView`.find_page], as well as with [method`NavigationView`.push_by_tag], [method`NavigationView`.pop_to_tag] or [method`NavigationView`.replace_with_tags].
Tags must be unique within each [class`NavigationView`].
The tag also must be set to use the
navigation.push
action.New in version 1.4.
- set_title(title)¶
- Parameters:
title (
str
) – the title
Sets the title of self.
It’s displayed in [class`HeaderBar`] instead of the window title, and used as the tooltip on the next page’s back button, as well as by screen reader.
New in version 1.4.
- do_hidden() virtual¶
Called when the navigation view transition has been completed and the page is fully hidden.
New in version 1.4.
- do_hiding() virtual¶
Called when the page starts hiding at the beginning of the navigation view transition.
New in version 1.4.
- do_showing() virtual¶
Called when the page shows at the beginning of the navigation view transition.
New in version 1.4.
- do_shown() virtual¶
Called when the navigation view transition has been completed and the page is fully shown.
New in version 1.4.
Signal Details¶
- Adw.NavigationPage.signals.hidden(navigation_page)¶
- Signal Name:
hidden
- Flags:
- Parameters:
navigation_page (
Adw.NavigationPage
) – The object which received the signal
Emitted when the navigation view transition has been completed and the page is fully hidden.
It will always be preceded by [signal`NavigationPage`:py:func:::hiding<Adw.NavigationPage.signals.hiding>] or [signal`NavigationPage`:py:func:::showing<Adw.NavigationPage.signals.showing>].
New in version 1.4.
- Adw.NavigationPage.signals.hiding(navigation_page)¶
- Signal Name:
hiding
- Flags:
- Parameters:
navigation_page (
Adw.NavigationPage
) – The object which received the signal
Emitted when the page starts hiding at the beginning of the navigation view transition.
It will always be followed by [signal`NavigationPage`:py:func:::hidden<Adw.NavigationPage.signals.hidden>] or [signal`NavigationPage`:py:func:::shown<Adw.NavigationPage.signals.shown>].
New in version 1.4.
- Adw.NavigationPage.signals.showing(navigation_page)¶
- Signal Name:
showing
- Flags:
- Parameters:
navigation_page (
Adw.NavigationPage
) – The object which received the signal
Emitted when the page shows at the beginning of the navigation view transition.
It will always be followed by [signal`NavigationPage`:py:func:::shown<Adw.NavigationPage.signals.shown>] or [signal`NavigationPage`:py:func:::hidden<Adw.NavigationPage.signals.hidden>].
New in version 1.4.
- Adw.NavigationPage.signals.shown(navigation_page)¶
- Signal Name:
shown
- Flags:
- Parameters:
navigation_page (
Adw.NavigationPage
) – The object which received the signal
Emitted when the navigation view transition has been completed and the page is fully shown.
It will always be preceded by [signal`NavigationPage`:py:func:::showing<Adw.NavigationPage.signals.showing>] or [signal`NavigationPage`:py:func:::hiding<Adw.NavigationPage.signals.hiding>].
New in version 1.4.
Property Details¶
- Adw.NavigationPage.props.can_pop¶
- Name:
can-pop
- Type:
- Default Value:
- Flags:
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 from [class`HeaderBar`].Manually calling [method`NavigationView`.pop] or using the
navigation.pop
action will still work.See [property`HeaderBar`:py:data::show-back-button<Adw.NavigationPage.props.show_back_button>] for removing only the back button, but not shortcuts.
New in version 1.4.
- Adw.NavigationPage.props.child¶
- Name:
child
- Type:
- Default Value:
- Flags:
The child widget.
New in version 1.4.
- Adw.NavigationPage.props.tag¶
- Name:
tag
- Type:
- Default Value:
- Flags:
The page tag.
The tag can be used to retrieve the page with [method`NavigationView`.find_page], as well as with [method`NavigationView`.push_by_tag], [method`NavigationView`.pop_to_tag] or [method`NavigationView`.replace_with_tags].
Tags must be unique within each [class`NavigationView`].
The tag also must be set to use the
navigation.push
action.New in version 1.4.
- Adw.NavigationPage.props.title¶
- Name:
title
- Type:
- Default Value:
''
- Flags:
The page title.
It’s displayed in [class`HeaderBar`] instead of the window title, and used as the tooltip on the next page’s back button, as well as by screen reader.
New in version 1.4.