/
setWindowHandler
setWindowHandler
Description
Sets the event handlers for the user window.
Event handlers are simply scripts to be called when certain events happen. User windows get notified about changes in the scene as well as changes to the user window itself. Each event handler flag takes as an argument a script (which must reside in your script directories).
To clear an event handler, pass the empty string, "", to the flag. If no options are specified, all handlers are reset, and the user window will not respond to any events.
Functional area
User Window
Command syntax
Syntax
setWindowHandler userWindowID [-enter string] [-size string] [-dataChange string] [-attChange string] [-selChange string] [-timeChange string] [-newScene string] [-fileLoaded string] [-markerLabeled string] [-markerUnlabeled string] |
Arguments
Name | Type | Required | Comments |
---|---|---|---|
windowId | int | yes | ID of user window to set event handlers for. |
Flags
Name | Flag arguments | Argument type | Exclusive to | Comments |
---|---|---|---|---|
enter | 1 | string | — | Specifies the script to call when the user has pressed the Enter key while a user control has the input focus. |
size | 1 | string | — | Specifies the script to call when the user window's size has changed due to manual resize, or docking/undocking. |
dataChange | 1 | string | — | Specifies the script to call when data has changed in the scene. This can include animation changes, hierarchy changes, new/deleted modules,etc. |
attChange | 1 | string | — | Specifies the script to call when a module's attribute has changed. |
selChange | 1 | string | — | Specifies the script to call when the selection in the scene changes. |
timeChange | 1 | string | — | Specifies the script to call when either the current time, play range, or animation range has changed in the scene. |
newScene | 1 | string | — | Specifies the script to call when the scene is reset. |
fileLoaded | 1 | string | — | — |
markerLabeled | 1 | string | — | — |
markerUnlabeled | 1 | string | — | — |
Return value
void
Examples
// Set the event handler for a User Window. We will set // the "enter" event handler. int $windowId; // First create a User Window to place the Controls on $windowId = `createWindow "MyWindow"`; // Save the window ID to our profile, so we can retrieve it // from the event handlers writeProfileInt "MyWindowSection" "WindowId" $windowId; // Set the -enter event handler for the User Window. When // the user hits the enter button, this script will be // executed. MyScriptEnterHandler must reside in one of // the scripts directories. setWindowHandler $windowId -enter "MyScriptEnterHandler";
Additional information
Related commands
, multiple selections available,