There is another new routine in Motif 1.2 that allows you to replace items in a List based upon position. The
XmListReplacePositions() routine takes the following form:
void
XmListReplacePositions(list_w, pos_list, new_items, item_count)
Widget list_w;
int *pos_list;
XmString *new_items;
int item_count;
This routine replaces the item at each position specified in pos_list with the corresponding item in new_items
until item_count has been reached.
13.3.4 Deleting Items
You can delete items from a List widget in many ways. First, to delete a single item, you can use either
XmListDeleteItem() or XmListDeletePos(). These functions take the following form:
void
XmListDeleteItem(list_w, item)
Widget list_w;
XmString item;
void
XmListDeletePos(list_w, position)
Widget list_w;
int position;
XmListDeleteItem() finds the given item and deletes it from the list, while XmListDeletePos() removes
an item directly from the given position. If you know the position of an item, you can avoid creating a compound
string and use XmListDeletePos(). After an item is deleted, the items following it are moved up one position.
You can delete multiple items using either XmListDeleteItems(), XmListDeleteItemsPos(), or
XmListDeletePositions(). These routines take the following form:
void
XmListDeleteItems(list_w, items, item_count)
Widget list_w;
XmString *items;
int item_count;
XmListDeleteItemsPos(list_w, item_count, position)
Widget list_w;
int item_count;
int position;
XmListDeletePositions(list_w, pos_list, ...