[Previous] [Contents] [Index] [Next]


Add items to a list


void PtGenListAddItems( PtWidget_t *list, 
                        PtGenListItem_t *items,
                        PtGenListItem_t *after );


This function adds items to a widget. The arguments are:

A list linked with the next field (the prev field is ignored).
If after is NULL, add the items at the beginning of the list. If after isn't NULL, it must point to an item in the widget and items will be added after that item.

In all selection modes except Pt_SELECTION_MODE_RANGE, if there's no current item in the widget and some of the added items have the Pt_LIST_ITEM_CURRENT flag set, the first of them will become the current item. In all other items, the flag will be cleared.

If no item is currently selected and the mode is set to Pt_SELECTION_MODE_SINGLE, the first of the added items having the Pt_LIST_ITEM_SELECTED flag set will become the selected item. This flag on all other items is cleared.

In Pt_SELECTION_MODE_MULTIPLE mode and Pt_SELECTION_MODE_NONE mode, all items with the Pt_LIST_ITEM_SELECTED flag will be selected.

In Pt_SELECTION_MODE_RANGE mode, the behavior depends on whether there's a selected range in the widget and how the after item is located relative to the selected range. In particular, if you remove a range of items and then reinsert them in the same place, the selected range will be restored. However, the "direction" of the range may be reversed.

If no items are selected in Pt_SELECTION_MODE_RANGE mode but a range of added items has the Pt_LIST_ITEM_SELECTED flag set, these items will become the selected range. The current item will be either the first or last item in this range, depending on the setting of the Pt_LIST_ITEM_CURRENT flag of the first selected item.



Interrupt handler No
Signal handler No
Thread No

[Previous] [Contents] [Index] [Next]