beetlebug

ztk::ios::NavigationStack

Makes a navigation stack (UINavigationController): one screen at a time, with the title of the top screen in a bar and a back button.

Synopsis

ztk::ios::NavigationStack new ROOT ?-largeTitles BOOLEAN?

Arguments

Name Type Default Meaning
ROOT screen The screen at the bottom of the stack: a Screen or a ListScreen.
-largeTitles boolean 1 1 shows the title of a screen in large type under the bar while the screen is at its top. 0 shows it small, in the bar.
push SCREEN method Shows SCREEN on top, with the slide of the system.
pop method Goes back to the screen under the top one. When the animation ends, the top screen runs its method closed and is destroyed. The back button and a swipe from the left edge do the same.
screens method Gives the screens on the stack, the root first.
configure, cget, destroy method As for each object (ztk::ios). destroy also frees each screen of screens.

Return value

new gives the object. screens gives a list of screens. push and pop give an empty string.

Errors

Error When
"OBJECT" is not a screen ROOT or the argument of push is no Screen, ListScreen, or TkScreen.
unknown option "-X": must be -largeTitles Another option.

Platforms

Platform Works
Windows No
macOS No
Linux, Wayland No
Linux, X11 No
Web No
iOS Yes
Android No: ztk::android::NavigationStack
Headless No: the namespace does not exist.

Example

set home [ztk::ios::Screen new -title Home]
set nav [ztk::ios::NavigationStack new $home -largeTitles 0]
$home add button -text Next -command [list $nav push [ztk::ios::Screen new -title Next]]
ztk::ios::app root $nav

See also