Next: <AdwNavigationSplitView>, Previous: <AdwMultiLayoutView>, Up: Classes   [Index]


1.34 <AdwNavigationPage> ¶

Class: <AdwNavigationPage> ¶

It derives from <GtkWidget>.

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 HeaderBar: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.AccessibleRole.group role.

Fields ¶

parent-instance

Properties ¶

Property: navigation-page:can-pop self ¶

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 HeaderBar.

Manually calling NavigationView.pop or using the navigation.pop action will still work.

See HeaderBar:show-back-button for removing only the back button, but not shortcuts.

Its value is a boolean.

Set it with (set! (navigation-page:can-pop self) value).

Property: navigation-page:child self ¶

The child widget.

Its value is a <GtkWidget>, or #f.

Set it with (set! (navigation-page:child self) value).

Property: navigation-page:tag self ¶

The page tag.

The tag can be used to retrieve the page with NavigationView.find_page, as well as with NavigationView.push_by_tag, NavigationView.pop_to_tag or NavigationView.replace_with_tags.

Tags must be unique within each NavigationView.

The tag also must be set to use the navigation.push action.

Its value is a string, or #f.

Set it with (set! (navigation-page:tag self) value).

Property: navigation-page:title self ¶

The page title.

It’s displayed in HeaderBar instead of the window title, and used as the tooltip on the next page’s back button, as well as by screen reader.

Its value is a string, or #f.

Set it with (set! (navigation-page:title self) value).

Procedures ¶

Method: navigation-page:get-can-pop? self ⇒ %return ¶
Method: get-can-pop? self ⇒ %return ¶

Gets whether self can be popped from navigation stack.

self

Passed: a <AdwNavigationPage>.

a navigation page

%return

Returned: a boolean.

whether the page can be popped from navigation stack

Method: navigation-page:get-child self ⇒ %return ¶
Method: get-child self ⇒ %return ¶

Gets the child widget of self.

self

Passed: a <AdwNavigationPage>.

a navigation page

%return

Returned: a <GtkWidget>, or #f.

the child widget of self

Method: navigation-page:get-tag self ⇒ %return ¶
Method: get-tag self ⇒ %return ¶

Gets the tag of self.

self

Passed: a <AdwNavigationPage>.

a navigation page

%return

Returned: a string, or #f.

the page tag

Method: navigation-page:get-title self ⇒ %return ¶
Method: get-title self ⇒ %return ¶

Gets the title of self.

self

Passed: a <AdwNavigationPage>.

a navigation page

%return

Returned: a string.

the title of self

Procedure: navigation-page:new child title ⇒ %return ¶

Creates a new <AdwNavigationPage>.

child

Passed: a <GtkWidget>.

the child widget

title

Passed: a string.

the page title

%return

Returned: a <AdwNavigationPage>.

the new created <AdwNavigationPage>

Procedure: navigation-page:new-with-tag child title tag ⇒ %return ¶

Creates a new <AdwNavigationPage> with provided tag.

child

Passed: a <GtkWidget>.

the child widget

title

Passed: a string.

the page title

tag

Passed: a string.

the page tag

%return

Returned: a <AdwNavigationPage>.

the new created <AdwNavigationPage>

Method: navigation-page:set-can-pop self can-pop ¶
Method: set-can-pop self can-pop ¶

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 HeaderBar.

Manually calling NavigationView.pop or using the navigation.pop action will still work.

See HeaderBar:show-back-button for removing only the back button, but not shortcuts.

self

Passed: a <AdwNavigationPage>.

a navigation page

can-pop

Passed: a boolean.

whether the page can be popped from navigation stack

Method: navigation-page:set-child self [child] ¶
Method: set-child self [child] ¶

Sets the child widget of self.

self

Passed: a <AdwNavigationPage>.

a navigation page

child

Passed, or left out: a <GtkWidget>, or #f.

the child widget

Method: navigation-page:set-tag self [tag] ¶
Method: set-tag self [tag] ¶

Sets the tag for self.

The tag can be used to retrieve the page with NavigationView.find_page, as well as with NavigationView.push_by_tag, NavigationView.pop_to_tag or NavigationView.replace_with_tags.

Tags must be unique within each NavigationView.

The tag also must be set to use the navigation.push action.

self

Passed: a <AdwNavigationPage>.

a navigation page

tag

Passed, or left out: a string, or #f.

the page tag

Method: navigation-page:set-title self title ¶
Method: set-title self title ¶

Sets the title of self.

It’s displayed in HeaderBar instead of the window title, and used as the tooltip on the next page’s back button, as well as by screen reader.

self

Passed: a <AdwNavigationPage>.

a navigation page

title

Passed: a string.

the title

Signals ¶

Signal: navigation-page:hidden ¶

Connect a handler with (connect object navigation-page:hidden handler). It is called as (handler self).

Emitted when the navigation view transition has been completed and the page is fully hidden.

It will always be preceded by "hiding" or "showing".

self

Passed: a <AdwNavigationPage>.

Signal: navigation-page:hiding ¶

Connect a handler with (connect object navigation-page:hiding handler). It is called as (handler self).

Emitted when the page starts hiding at the beginning of the navigation view transition.

It will always be followed by "hidden" or "shown".

self

Passed: a <AdwNavigationPage>.

Signal: navigation-page:showing ¶

Connect a handler with (connect object navigation-page:showing handler). It is called as (handler self).

Emitted when the page shows at the beginning of the navigation view transition.

It will always be followed by "shown" or "hidden".

self

Passed: a <AdwNavigationPage>.

Signal: navigation-page:shown ¶

Connect a handler with (connect object navigation-page:shown handler). It is called as (handler self).

Emitted when the navigation view transition has been completed and the page is fully shown.

It will always be preceded by "showing" or "hiding".

self

Passed: a <AdwNavigationPage>.

Virtual methods ¶

Virtual method: navigation-page:do-hidden implementor self ¶

Called when the navigation view transition has been completed and the page is fully hidden.

To override it in a new class, give register-type #:vfuncs `((hidden . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: <AdwNavigationPage>, or a class that derives from it, or its GType number.

self

Passed: a <AdwNavigationPage>.

a navigation page

Virtual method: navigation-page:do-hiding implementor self ¶

Called when the page starts hiding at the beginning of the navigation view transition.

To override it in a new class, give register-type #:vfuncs `((hiding . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: <AdwNavigationPage>, or a class that derives from it, or its GType number.

self

Passed: a <AdwNavigationPage>.

a navigation page

Virtual method: navigation-page:do-showing implementor self ¶

Called when the page shows at the beginning of the navigation view transition.

To override it in a new class, give register-type #:vfuncs `((showing . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: <AdwNavigationPage>, or a class that derives from it, or its GType number.

self

Passed: a <AdwNavigationPage>.

a navigation page

Virtual method: navigation-page:do-shown implementor self ¶

Called when the navigation view transition has been completed and the page is fully shown.

To override it in a new class, give register-type #:vfuncs `((shown . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: <AdwNavigationPage>, or a class that derives from it, or its GType number.

self

Passed: a <AdwNavigationPage>.

a navigation page


Next: <AdwNavigationSplitView>, Previous: <AdwMultiLayoutView>, Up: Classes   [Index]