57) How can I tell the position of selected items in a list?

[Last modified: Oct 92]

Answer: From  W. Scott Meeks:

1) All XmList selection callbacks get an XmListCallbackStruct which includes
the item selected and its position.  In addition, the multiple and extended
selection callbacks also get a list of the selected items.  This approach
requires that your application saves this information if you need it outside
of the immediate callback.

2) At any time you can XtGetValues the XmNselectedItems and
XmNselectedItemCount resources.  The problem with this approach is that
identical items may or may not show up in multiple times in this list and the
position in the selectedItems list may not relate directly to the position in
the items list.

3) You can call XmListGetSelectedPos on the list widget.  This will return a
list of the positions of all selected items.
Go Back Up

Go To Previous

Go To Next