Caution: This version of this document is no longer maintained. For the latest documentation, see


Remove items from a list


PtGenListItem_t *PtGenListRemoveItems( 
                     PtWidget_t *list, 
                     PtGenListItem_t *first,
                     PtGenListItem_t *last );


This function removes the given sublist list from the PtGenList widget. If first or last is NULL, the first or last item of the entire list is used. Both arguments may point to the same item, but last must not precede first in the list.

The function returns the first removed item (or NULL if the list was empty). The function inserts NULL in the next field of the last removed item and the prev field of the first removed item. This ensures the returned value (if not NULL) always points to the first item of a NULL-terminated, double-linked list. No other fields in any of the removed items are modified.

If the current item is removed, there won't be a current item in the list unless the selection mode is Pt_SELECTION_MODE_RANGE and only part of the selected range is removed. In this case, the current item is set to the first or last of the remaining selected items (see Current item in the description of PtGenList).


The first removed item, or NULL if the list was empty.



Interrupt handler No
Signal handler No
Thread No

See also:

PtGenList, PtGenListItem_t