PtGenTree item structure
typedef struct Pt_gentree_item { PtGenListItem_t list; struct Pt_gentree_item *father, *son, *brother; PhDim_t dim; } PtGenTreeItem_t;
This data structure describes an item in a PtGenTree widget.
Applications should view this as a read-only structure; subclasses usually define ways to modify PtGenTreeItem_t members. |
The members include at least:
The PtGenTree class defines some new flags that can be set in item->list.flags:
The setting of this flag is preserved when the item is added to a widget. This flag is usually set in the parent item automatically when you add a branch to an item.
This flag isn't cleared when all the child items are deleted. You can clear this flag in your code, but:
If the Pt_TREE_ITEM_EXPANDABLE flag is set when the item is added to a widget, the setting of Pt_TREE_ITEM_EXPANDED flag is preserved; if Pt_TREE_ITEM_EXPANDABLE isn't set, this flag is cleared.
Once the item is in a widget, don't set or clear this flag; use the convenience functions instead.
When an item is added to the widget, the widget calculates item->list.size based on the size specified in item->dim, the minimum height of the item, and the item's position in the tree. The height of an item in a tree widget is always an even number of pixels - if you specify an odd number for the height in the dim field, a gap of at least one pixel will be displayed between the current item and any other item directly below.
Photon
PtGenList, PtGenListItem_t, PtGenTree, PtTreeItem_t