operations, such as adding items to the List, removing items, and locating items.
13.3.1 Adding Items
The entire list of choices may not always be available at the time the List is created. In fact, it is not uncommon to
have no items available for a new list. In these situations, items can be added to the list dynamically using the
following functions XmListAddItem(), XmListAddItemUnselected(), XmListAddItems(), and
XmListAddItemsUnselected(). XmListAddItemsUnselected() is a new routine in Motif 1.2. These
functions take the following form:
void
XmListAddItem(list_w, item, position)
Widget list_w;
XmString item;
int position;
void
XmListAddItemUnselected(list_w, item, position)
Widget list_w;
XmString item;
int position;
void
XmListAddItems(list_w, items, item_count, position)
Widget list_w;
XmString *items;
int item_count;
int position;
void
XmListAddItemsUnselected(list_w, items, item_count, position)
Widget list_w;
XmString *items;
int item_count;
int position;
These routines allow you to add one or more items to a List widget at a specified position. Remember that list
positions start at 1, not 0. The position 0 indicates the last position in the List; specifying this position appends the
item or items to the end of the list. If the new item(s) are added to the list in between existing items, the rest of the
items are moved down the list.
The difference between XmListAddItem() and XmListAddItemUnselected() is that
XmListAddItem() compares each new item to each of the existing items. ...