DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Creating an SCO Visual Tcl program -- an overview

Getting the process ID (PID)

# Get handle of list widget

set 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:

  1. Use keylget(1tcl) to get the handle of the form dialog, which is in this cbs keyed list, and store this in the variable mainform.

  2. Use VxGetVar(1vtcl) to get the handle of the list attached to it, and store this in the variable listWidget.
Next, VtListGetSelectedItem(1vtcl) returns a list of lists and stores this in the variable selProcList

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.


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004