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(TCL) 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(VTCL) to get the handle of the list attached to it, and store this in the variable listWidget.
Next, VtListGetSelectedItem(VTCL) returns a list of lists and stores this in the variable selProcList

Finally, lindex(TCL) 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.


Next topic: About question dialogs
Previous topic: About keyed lists and the callback structure (cbs)

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003