beetlebug

ztk::wasm::item

Gives the id of the canvas item that a WebAssembly app named with item-set-id.

Synopsis

ztk::wasm::item CANVAS ID

Arguments

Name Type Default Meaning
CANVAS text The name that the app gave the canvas with set-id.
ID text The name that the app gave the item with item-set-id.

The command exists after the first call of ztk::wasm::run.

Return value

The id of the item on the canvas of ztk::wasm::widget CANVAS.

Errors

Error When
key "CANVAS" not known in dictionary The app gave no widget the name CANVAS.
can't read "item_ids(PATH,ID)": no such element in array The canvas has no item of that name.
invalid command name "ztk::wasm::item" No call of ztk::wasm::run came first.

Platforms

Platform Works
Windows Yes
macOS Yes
Linux, Wayland Yes
Linux, X11 Yes
Web No: the browser build has no ztk::wasm::run.
iOS, Android Yes
Headless Yes

Example

ztk::wasm::run hello.wasm
catch {ztk::wasm::item board ball} msg
set msg

See also