/
getDropListItem

getDropListItem

Description

Gets the string of an item in the drop list user control that is specified by userControlID.

If an invalid index is specified, the command fails.

Functional area

User Window

Command syntax

Syntax

getDropListItem userControlID itemIndex

Arguments

NameTypeRequiredComments
indexintyesIndex of the drop list item to get.
userControlIdintyesID of user control to operate on.

Flags

None

Return value

string

Examples

// Get the string of an item in the Drop List User Control 
int $windowId;
int $controlId;
int $i, $numItems;
string $itemStr;
 
// First create a User Window to place the Control on
$windowId = `createWindow "MyWindow"`;
 
// Create the User Control on the Window. 
$controlId = `createDropList $windowId`;
 
// Add some items to the Drop List.
addDropListItem $controlId "Item 1";
addDropListItem $controlId "Item 2";
addDropListItem $controlId "Item 3";
 
// Get the number of items.
$numItems = `getNumDropListItems $controlId`;
 
// Iterate through the list of items.
for( $i = 0; 
  $i < $numItems; 
  $i += 1 )
     { 
        $itemStr = `getDropListItem $controlId $i`; 
        print $itemStr;
}

Additional information

Related commands


© Copyright Vicon Motion Systems. All rights reserved.

Vicon trademarks