Vicon Shogun banner

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

NameTypeRequiredComments
windowIdintyesID of user window to set event handlers for.

Flags

NameFlag argumentsArgument typeExclusive toComments
enter1stringSpecifies the script to call when the user has pressed the Enter key while a user control has the input focus.
size1stringSpecifies the script to call when the user window's size has changed due to manual resize, or docking/undocking.
dataChange1stringSpecifies the script to call when data has changed in the scene. This can include animation changes, hierarchy changes, new/deleted modules,etc.
attChange1stringSpecifies the script to call when a module's attribute has changed.
selChange1stringSpecifies the script to call when the selection in the scene changes.
timeChange1stringSpecifies the script to call when either the current time, play range, or animation range has changed in the scene.
newScene1stringSpecifies the script to call when the scene is reset.
fileLoaded1string
markerLabeled1string
markerUnlabeled1string

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