beetlebug

ztk::ios::TkScreen

Makes a screen of the Tk window of the app, so a navigation stack or a tab screen holds the Tk widgets as one of its screens.

Light Dark
A Tk canvas with a bar chart and a Tk button Show the numbers, under the large title Chart of a native navigation bar of iOS The same screen in the dark mode of iOS

The pictures show examples/ios-tkscreen.tcl: a chart on a Tk canvas under a native navigation bar.

Synopsis

ztk::ios::TkScreen new ?-title TEXT?

Arguments

Name Type Default Meaning
-title text empty The title in the navigation bar, and the text of the back button of the screen above it.
push SCREEN method Shows a native screen over the Tk window, on the navigation stack of the Tk screen.
pop, navigationStack, closed method As for a screen.
configure, cget, destroy method As for each object (ztk::ios).

The app has one Tk window, so it has one Tk screen at a time. The bar of the navigation stack is in the insets of the window, so a Tk app that keeps its widgets inside tk insets stays clear of it. destroy of a Tk screen keeps the Tk window, and ztk::ios::app root with no object shows it again alone.

Return value

new gives the object.

Errors

Error When
the Tk window is in a Tk screen already A second new while a Tk screen exists.
unknown option "-X": must be ... Another option.

Platforms

Platform Works
Windows No
macOS No
Linux, Wayland No
Linux, X11 No
Web No
iOS Yes
Android No: the class exists, and the backend of Android gives bad kind "tkscreen".
Headless No: the namespace does not exist.

Example

canvas .chart -background white
pack .chart -fill both -expand 1
set screen [ztk::ios::TkScreen new -title Chart]
ztk::ios::app root [ztk::ios::NavigationStack new $screen]

See also