PtTreeChangeItem()

Create a tree item with attributes

Synopsis:

PtTreeItem_t *PtTreeChangeItem(
  PtWidget_t *tree,
  PtTreeItem_t *item,
  const char *string,
  PtTreeItemAttributes_t const *attr
  );

Arguments:

tree
A pointer to the PtTree widget which contains the item you want to change.
item
A pointer to the PtTreeItem_t you wish to change.
string
The tree item text string. Set to NULL to leave the item's text string unchanged.
attr
A pointer to the new PtTreeItemAttributes_t structure you want to set for this item. Set to NULL to display no images, and use the widget-defined font and colors. The Pt_TREE_ITEM_HAS_ATTRS flag bit is still set for the item.

Description:

This function changes an existing tree item, created with PtTreeCreateItem() or PtTreeAllocItem(). The string and attr parameters will override the existing item text string and attributes.

Returns:

A pointer to a PtTreeItem_t
Success.
NULL
Error

Note: PtTreeChangeItem() can return a pointer to a new item that your application must maintain. Your code should look like this:
new_item = PtTreeChangeItem(tree, item, newname, NULL);
if( new_item != null ) {
    item = new_item;
} else {
    // Handle this error!
    ...
}

Examples:

See Allocating items and building a tree in the description of PtTree.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtTree, PtTreeAddAfter(), PtTreeAllocItem(), PtTreeCreateItem(), PtTreeFreeAllItems(), PtTreeFreeItems(), PtTreeItem_t, PtTreeItemAttributes_t, PtTreeRootItem()