Next: Adding and removing list items Up: List Widgets Previous: List selection modes

List basics

To create a simple list use: XtVaCreateManagedWidget() and specify xmListWidgetClass as the widget type (or use XmCreateList().

We will usually want to create a ScrolledList. To do this use: XmCreateScrolledList().

There are a number of useful resources:

XmNitemCount
- The number of items in list.
XmNitems
- The list items. The item list is a XmStringTable data type. This is basically a 1D array of XmStrings.

XmNselectionPolicy
- How items are chosen.
XmNvisibleItemCount
- Number of items shown in list. Determines height of widget.
XmNscrollBarDisplayPolicy
- Either XmAS_NEEDED or XmSTATIC. XmSTATIC will always show (vertical) scroll even if all items are visible.
XmNlistSizePolicy
- XmCONSTANT, XmRESIZE_IF_POSSIBLE or XmVARIABLE. Controls horizontal scrolling.
XmNselectedItemCount
- The number of selected items.
XmNselectedItems
- the select items.



Dave.Marshall@cm.cf.ac.uk
Tue May 24 16:52:56 BST 1994