...
Scroll tablelayout | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Name | Flag arguments | Argument type | Exclusive to | Comments |
---|---|---|---|---|
selChange | 1 | string | — | Specify the script to be called when the selection state of items in the list view changes. |
checkChange | 1 | string | — | Specify the script to be called when the checked state of items in the list view changes. |
Return value
void
Examples
Code Block | ||
---|---|---|
| ||
// Demonstrate usage of a List View User Control |
...
int $windowID, $listViewID, $formID; |
...
...
// Destroy window if it already exists |
...
if( `windowExists "ListViewTesting"` == true ) |
...
{ |
...
destroyWindow "ListViewTesting"; |
...
} |
...
// Create window and list view |
...
$windowID = `createWindow "ListViewTesting"`; |
...
$listViewID = `createListView $windowID -form $formID -checkBoxes`; |
...
...
// Create the columnsstring $columns[3]; |
...
int $widths[3]; |
...
$columns[0] = "Name"; |
...
$columns[1] = "Age"; |
...
$columns[2] = "Gender"; |
...
$widths[0] = 150; |
...
$widths[1] = 50; |
...
$widths[2] = 100; |
...
setListViewColumns $listViewID $columns $widths; |
...
...
// Set the script we want to get called when the selection state of |
...
// one of the items changes |
...
setListViewHandler -selChange "MySelChangeHandler"; |
...
...
// Save the value of the list control so we can get it our handler script |
...
setGlobalVar "MyListViewID" $listViewID; |
...
// |
...
/////////////////////////////////////// |
...
// In "MySelChangeHandler. This script must exist under one |
...
// of your script directories. |
...
int $listViewID = `getGlobalIntVar "MyListViewID"`; |
...
print( `getListViewSelItems $listViewID` ); |
Additional information
Related commands
...