Allocate a new item
PtTreeItem_t *PtTreeAllocItem(
PtWidget_t const *tree,
const char *string,
short set_img,
short unset_img );
This function allocates a new item. The item's string is copied from string.
The set_img argument is the index of the image that's displayed when the item is set, and unset_img is the image displayed when it isn't set. An item is considered set if its flags masked with the Pt_ARG_TREE_IMGMASK resource of the widget give a nonzero value.
The image must be already present in the widget: if an index given to the PtTreeAllocItem() function isn't smaller than the current image count, it's changed to -1. A value of -1 means "no image."
![]() |
Use the PtTreeAddFirst() and PtTreeAddAfter() functions to add the new item to a tree structure. |
Photon
| Safety: | |
|---|---|
| Interrupt handler | No |
| Signal handler | No |
| Thread | No |
PtTree, PtTreeAddAfter(), PtTreeAddFirst(), PtTreeAddImages(), PtTreeFreeAllItems(), PtTreeFreeItems(), PtTreeItem_t, PtTreeModifyItem()