PtTreeAllItems()

Fill a buffer with pointers to all items

Synopsis:

PtTreeItem_t **PtTreeAllItems( 
                   PtWidget_t *widget, 
                   PtTreeItem_t **buffer );

Description:

This function fills a buffer with pointers to all items in the widget. If buffer is NULL, the function allocates a buffer using malloc(), and the buffer is NULL-terminated. If buffer isn't NULL, the function doesn't add a NULL at the end.


Note: Items that belong to collapsed subtrees aren't included in the buffer. If you need a list of all the items, traverse the father, son, and brother pointers in the PtGenTreeItem_t structure that's part of PtTreeItem_t.

Returns:

A pointer to the buffer.

Examples:

PtTreeItem_t *item, **buf;

buf = PtTreeAllItems( widget, NULL );
for ( i=0; ( item = buf[i] ) != NULL; ++i ) {
    printf( "%s\n", item->string );
}

free( buf );

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtTree, PtTreeGetCurrent(), PtTreeGetSelIndexes(), PtTreeItem_t, PtTreeSelectedItems(), PtTreeSetSelIndexes()