/
setListBoxHandler
setListBoxHandler
Description
Sets the event handler for the list box user control that is specified by userControlID
.
Event handlers are simply scripts to be called when certain events happen. User controls get notified about changes in state when users interact with them.
Each event handler flag takes as an argument a script (which must reside in your script directories).
To clear a event handler, pass the empty string, "", to the flag. If no options are specified, all handlers are reset, and the user control will not respond to any events.
Functional area
User Window
Command syntax
Syntax
setListBoxHandler userControlID [-selChange string] [-dblClick string] |
Arguments
Name | Type | Required | Comments |
---|---|---|---|
userControlId | int | yes | ID of user control to set event handler for. |
Flags
Name | Flag arguments | Argument type | Exclusive to | Comments |
---|---|---|---|---|
selChange | 1 | string | — | Specifies the script to call when the user double clicks on a list box Item. |
dblClick | 1 | string | — | — |
Return value
void
Examples
// Set the event handler for the User List Box.int $windowId;int $controlId; // First create a User Window to place the Control on $windowId = `createWindow "MyWindow"`; // Create the User Control on the Window. $controlId = `createListBox $windowId "1" "2"`; // Save the control ID to our profile, so we can retrieve it // from the event handler writeProfileInt "MyWindowSection" "ListBoxId" $controlId; // Set the -dblClick event handler for the list box. When // the user double-clicks on a list box item, this script will be // executed. ListBoxDblClickHandler must reside in one of // the script's directories. setListBoxHandler $controlId -dblClick "ListBoxDblClickHandler";
Additional information
Related commands
, multiple selections available,
Related content
getListBoxItem
getListBoxItem
More like this
getListBoxSelItems
getListBoxSelItems
More like this
setStaticBoxHandler
setStaticBoxHandler
More like this
createListBox
createListBox
More like this
setCheckBoxHandler
setCheckBoxHandler
More like this
addListBoxItem
addListBoxItem
More like this