|
|
# Get handle of list widgetset mainform [ keylget cbs dialog ] set listWidget [ VxGetVar $mainform list ]
# Query list to get selected item
set selProcList [VtListGetSelectedItem $psList -byItemList]
# Get pid from selected list item
set pid [lindex [lindex $selProcList 0] 0]
These steps obtain the PID of the process the user selected.
First, obtain the handle of the list widget to access the process the user selected. To do this:
Finally,
lindex(1tcl)
retrieves the actual process ID from the
selected list and stores it in the variable pid.
The lindex command retrieves individual
elements from a list.