ztk::android::NavigationStack
Makes a navigation stack: a Toolbar with the title of the top screen and a back arrow, and the top screen under it.
Synopsis
ztk::android::NavigationStack new ROOT ?-largeTitles BOOLEAN?
Arguments
| Name |
Type |
Default |
Meaning |
ROOT |
screen |
|
The screen at the bottom of the stack. |
-largeTitles |
boolean |
1 |
Android has no large title: the option keeps its value and has no effect. |
push SCREEN |
method |
|
Shows SCREEN on top, with no slide. |
pop |
method |
|
Goes back to the screen under the top one. The top screen runs its method closed and is destroyed, as after Back or a tap on the arrow. |
screens |
method |
|
Gives the screens of the stack and of each push, the root first. |
destroy |
method |
|
Frees the stack and each screen of screens. |
Return value
new gives the object. screens gives a list. push and pop give an empty string.
Errors
| Error |
When |
"OBJECT" is not a screen |
ROOT or the argument of push is no screen. |
| Platform |
Works |
| Windows |
No |
| macOS |
No |
| Linux, Wayland |
No |
| Linux, X11 |
No |
| Web |
No |
| iOS |
No: ztk::ios::NavigationStack |
| Android |
Yes |
| Headless |
No: the namespace does not exist. |
Example
set first [ztk::android::Screen new -title Settings]
set nav [ztk::android::NavigationStack new $first]
ztk::android::app root $nav
$nav push [ztk::android::Screen new -title About]
See also