Skip to Main Content
Volume 6A: Motif Programming Manual
book

Volume 6A: Motif Programming Manual

by David Brennan, Dan Heller, Paula Ferguson
September 1993
Intermediate to advanced content levelIntermediate to advanced
1014 pages
28h 26m
English
O'Reilly Media, Inc.
Content preview from Volume 6A: Motif Programming Manual
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. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Volume 7A: XView Programming Manual

Volume 7A: XView Programming Manual

Dan Heller

Publisher Resources

ISBN: 9780596000431