A List component presents a list of items for selection. Motif provides List components that allow you to select single items, multiple items, or discontiguous ranges of items. An application can use Lists to handle different types of selections; the purpose of the List within the application determines the number of items that you can select. A List can also provide vertical and horizontal ScrollBars when the contents of the List are larger than its window. The selected item(s) in a List are highlighted (see Figure 3-15).
Figure 23. A Single-Selection List.
View figure. |
To select a single item from a List:
A single-selection style List may also support browse-style selection. Browse-style selection allows you to select an item by pressing Button 1 on an item, dragging the pointer through the List, and releasing Button 1 on the item that you want to select.
To select a contiguous group of items from a List:
You can also select a group of items by selecting a single item, moving the pointer to the last item in the group, and pressing Shift as you click Button 1. All of the items between the first and the last items will be selected.
To add a discontiguous group of items to a selection:
If a List has the input focus, you can navigate through the items in the List and make selections using the keyboard. List components use a location cursor to indicate which item in the List has the input focus. The location cursor is shown by a box around a List item. Use the up and down arrow keys to move the location cursor through the items in the List. Depending on the type of List you are using, the selection may move with the location cursor. If the selection does not move with the location cursor, you can select an item by pressing Select or Space.
The List component allows you to make all of the different types of selections from the keyboard. For more information on keyboard-based selection, see the Motif Style Guide.
In a List that allows you to select multiple items, you can select all of the items in the List by pressing Ctrl /. You can deselect all of the items in the List by pressing Ctrl \.
You can cancel an in-progress drag-based selection operation by pressing Cancel at any time during the operation.