A generic superclass for tree widgets
PtWidget --> PtBasic --> PtContainer --> PtCompound --> PtGenList --> PtGenTree
For more information, see the diagram of the widget hierarchy.
None - not normally instantiated.
<photon/PtGenTree.h>
The PtGenTree widget displays a tree of items. When the user expands an item, another list of items drops down from it. Additional items can be added to an expandable item when it's about to be expanded. Expanded items can be collapsed, which results in the exclusion of items from the displayed list.
The tree can actually be a "forest" - the widget can contain multiple items at the root level. The root items are always visible (included on the displayed list) because they don't have a parent that could be collapsed.
You can build a tree (or a "forest") that isn't linked to any widget and then add the whole tree to a widget as a root or subtree. Alternatively, you can add each item to the widget tree separately, but once the widget is realized, you'll have to use PtHold() and PtUpdate() to avoid multiple redraws.
PtGenTreeItem_t is the data structure used for the items. For more information about this class, see Building Custom Widgets.
Resource | C type | Pt type | Default |
---|---|---|---|
Pt_ARG_TREE_FLAGS | unsigned int | Flag | Pt_TREE_HAS_BUTTONS | Pt_TREE_HAS_LINES | Pt_TREE_ROOT_LINES |
Pt_CB_GEN_TREE_INPUT | PtCallback_t * | Link | NULL |
C type | Pt type | Default |
---|---|---|
unsigned int | Flag | Pt_TREE_HAS_BUTTONS | Pt_TREE_HAS_LINES | Pt_TREE_ROOT_LINES |
Possible values are:
The PtTree subclass defines some additional flags. |
C type | Pt type | Default |
---|---|---|
PtCallback_t * | Link | NULL |
A list of callbacks invoked on mouse and key events. Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:
These callbacks should return Pt_CONTINUE.
If the widget modifies an inherited resource, the "Default override" column indicates the new value. This modification affects any subclasses of the widget.
PtGenTree's convenience functions are useful only if you're creating a custom tree widget; they're described in the Creating a Tree Widget chapter of the Building Custom Widget manual.
PtGenTree defines the following data structure: