imgui_set_callback
Set declarative callback actions that fire automatically on widget events such as clicks, changes, or hovers. Trigger visibility toggles, value updates, or scene switches without polling round-trips.
Instructions
Set a declarative callback action that fires automatically when a widget event occurs. Actions: toggle_visibility, set_visibility, set_value, switch_scene. No polling round-trip needed.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"window": "<window>",
"trigger_widget": "<trigger_widget>",
"action": "<action>"
},
"name": "imgui_set_callback"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action to perform | |
| params | No | Action parameters. toggle_visibility/set_visibility: {"widget": "id", "visible": true}. set_value: {"widget": "id", "value": 0.5}. switch_scene: {"scene": "name"}. | |
| window | Yes | Window containing the trigger widget | |
| trigger_event | No | Event that fires the action (default: clicked) | |
| trigger_widget | Yes | Widget id that triggers the action |