PtTree item structure


typedef struct Pt_tree_item {
    PtGenTreeItem_t gen;
    union {
        struct { short set, unset; } img;
        PtTreeItemAttributes_t const *ptr;
        } attr;
    void *data;
    char string[1]; 
    } PtTreeItem_t;


This data structure describes an item in a PtTree. The members include at least:

A structure that describes a generic-tree item. This structure includes state information for the item (whether or not it's selected, the current item, damaged, out of view, expandable, expanded, and so on), its size, and links to other generic-tree items. For more information, see PtGenTreeItem_t.
The index into the tree's Pt_ARG_TREE_IMAGES resource of the image that's displayed when the item is set. An item is considered set if its flags masked with the tree's Pt_ARG_TREE_IMGMASK resource give a nonzero value.
The index of the image displayed when the item isn't set.
A pointer to the item's PtTreeItemAttributes_t attribute structure.
A pointer to arbitrary user data. The widget doesn't use this member.
The string to be displayed for the item. This field is allocated the appropriate amount of space when it's set.

Use PtTreeAllocItem() or PtTreeCreateItem() to allocate and fill in this structure.

Once the tree item has been created or changed, item->gen.list.flags indicates which half of the PtTreeItem_t's attr union is valid. When this flag is Pt_TREE_ITEM_HAS_ATTRS, attr.ptr is a pointer to an attributes structure (or NULL). When this flag is clear, attr.img.set and attr.img.unset are indexes into the Pt_ARG_TREE_IMAGES array (or -1).



See also:

PtGenList, PtGenTree, PtGenTreeItem_t, PtTree, PtTreeAddAfter(), PtTreeAddFirst(), PtTreeAllItems(), PtTreeAllocItem(), PtTreeChangeItem(), PtTreeCreateItem(), PtTreeFreeItems(), PtTreeGetCurrent(), PtTreeItemAttributes_t, PtTreeItemIndex(), PtTreeModifyItem(), PtTreeModifyItemString(), PtTreeRemoveItem(), PtTreeRootItem(), PtTreeSelectedItems()