Skip to content

navigator

pdwidgets.widgets.navigator

Page stack navigator.

Navigator(parent, x=0, y=0, w=None, h=None, align=None, align_to=None, fg=None, bg=None, visible=True, value=None, padding=None)

Bases: Widget

Page stack with push, pop, and replace navigation.

Stack of :class:Page children with push / pop navigation.

Only the top page is visible. Typical pattern::

nav = Navigator(screen)
home = Page(nav, title="Home")
nav.push(home)
detail = Page(nav, title="Detail", visible=False)
# later:
nav.push(detail)
nav.pop()

top property

The visible top page, or None if empty.

pop()

Hide the top page and reveal the one under it. Returns the popped page.

push(page)

Show page and hide the previous top page.

replace(page)

Replace the entire stack with a single page.