beetlebug▾
/

ztk::wasm::view

Gives the object of the native view that a WebAssembly app named with set-id of the interface native.

Synopsis

ztk::wasm::view ID

Arguments

Name Type Default Description
ID text The name that the app gave the view with set-id.

The command exists after the first call of ztk::wasm::run. The object is one of the classes of ztk::ios or ztk::android, so a check script drives it with the methods of the class, such as invoke.

Return value

The name of the TclOO object of the view.

Errors

Error When
key "ID" not known in dictionary The app gave no view that name.
no view with the handle N The view is free: a closed screen or a destroyed view.
invalid command name "ztk::wasm::view" No call of ztk::wasm::run came first.

Platforms

Platform Works
Windows No: the app makes no native view.
macOS No: the app makes no native view.
Linux, Wayland No: the app makes no native view.
Linux, X11 No: the app makes no native view.
Web No: the browser build has no ztk::wasm::run.
iOS, Android Yes
Headless Only in the unit tests, with the fake native views.

Example

ztk::wasm::run native.wasm
if {[namespace exists ztk::ios]} {
    [ztk::wasm::view plants] invoke 0 1
    [ztk::wasm::view save] invoke
}

See also