int item_position;
XmString *selected_items;
int selected_item_count;
int *selected_item_positions;
char selection_type;
} XmListCallbackStruct;
The reason field specifies the reason that the callback was invoked, which corresponds to the type of action
performed by the user. The possible values for this field are:
XmCR_BROWSE_SELECT
XmCR_DEFAULT_ACTION
XmCR_EXTENDED_SELECT
XmCR_MULTIPLE_SELECT
XmCR_SINGLE_SELECT
The reason field is important with List callbacks because not all of the fields in the callback structure are valid for
every reason. For the browse and single selection policies, the reason, event, item, item_length, and
item_position fields are valid. For the default action, all of the fields are valid. List items are stored as compound
strings in the callback structure, so to print an item using printf(), we must convert the string with the compound
string function XmStringGetLtoR().
13.5.3 Multiple Selection Callback
When XmNselectionPolicy is set to XmMULTIPLE_SELECT, multiple items can be selected in the List widget.
When the user selects an item, its selection state is toggled. Each time the user selects an item, the callback routine
associated with the XmNmultipleSelectionCallback is invoked. the source code shows the
sel_callback() routine that could be used with a multiple selection List. XmFONTLIST_DEFAULT_TAG
replaces XmSTRING_DEFAULT_CHARSET in Motif 1.2.
void
sel_callback(list_w, client_data, call_data)
Widget list_w;
XtPointer client_data;
XtPointer call_data;
{ ...