ztk::wasm::widget
Gives the path of the widget that a WebAssembly app named with its id option.
Synopsis
ztk::wasm::widget ID
Arguments
| Name | Type | Default | Meaning |
|---|---|---|---|
ID |
text | The name that the app gave the widget with set-id. |
The command exists after the first call of ztk::wasm::run.
Return value
The path of the widget, such as .w2.
Errors
| Error | When |
|---|---|
key "ID" not known in dictionary |
The app gave no widget that name. |
invalid command name "ztk::wasm::widget" |
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
winfo class [ztk::wasm::widget greet]