Create a tree item with attributes
PtTreeItem_t *PtTreeCreateItem( PtWidget_t const *tree, const char *string, PtTreeItemAttributes_t const *attr );
This function creates a new tree item. The item's string is copied from string.
Attributes are set with a PtTreeItemAttributes_t structure, passed as attr. The item's Pt_TREE_ITEM_HAS_ATTRS is set whether attr is passed as a pointer or NULL.
Both PtTreeAllocItem() and PtTreeCreateItem() create a tree item. PtTreeCreateItem() lets you specify set and unset images that are not already present in the widget's Pt_ARG_TREE_IMAGES array. In general, if you want to use images in this array, you should use PtTreeAllocItem().
An item created with PtTreeCreateItem(widget,string,NULL) behaves identically to an item created with PtTreeAllocItem(widgetmstring,-1,-1), except it has the Pt_TREE_ITEM_HAS_ATTRS flag set, whereas the latter does not. |
Using PtTreeCreateItem() you can also specify text and fill color attributes for selected and unselected items.
Use PtTreeAddFirst() and PtTreeAddAfter() to add the new item to a tree structure. |
See “Allocating items and building a tree” in the description of PtTree.
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PtTree, PtTreeAddAfter(), PtTreeAllocItem(), PtTreeChangeItem(), PtTreeFreeAllItems(), PtTreeFreeItems(), PtTreeItem_t, PtTreeItemAttributes_t, PtTreeRootItem()