[Previous] [Contents] [Index] [Next]

PtWidgetTree()

Walk the widget tree from front to back

Synopsis:

int PtWidgetTree( PtWidget_t *root, 
                  PtWidget_t **cur, 
                  int D );

Description:

This function walks the widget tree pointed to by root from front to back. The cur argument is the address of a pointer to the current widget in the tree. The D argument is the direction control.


Note: This function performs a simple traversal of the widget tree. If you need more control over how the tree is traversed (for example, specifying the direction, or skipping certain branches), use PtWidgetTreeTraverse().

To start the traversal, set cur to be the address of a pointer to the root widget, and set D to Pt_TRAVERSE_START. Use the result returned by PtWidgetTree() as the value of D for the next call.

The traversal is done when PtWidgetTree() returns Pt_TRAVERSE_DONE.

Returns:

Pt_TRAVERSE_DONE
All the widgets in the tree have been traversed.
Any other value
Pass this value as D in the next call.

Examples:

PtWidget_t *cur, *window;
int d;
...
cur=window
d=Pt_TRAVERSE_START;
while( ( d=PtWidgetTree( window, &cur, d ) ) != Pt_TRAVERSE_DONE)
     PtSetResources( cur, 1, argt );
...

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtNextTopLevelWidget(), PtValidParent(), PtWidgetBrotherBehind(), PtWidgetBrotherInFront(), PtWidgetChildBack(), PtWidgetChildFront(), PtWidgetFamily(), PtWidgetParent(), PtWidgetSkip(), PtWidgetTreeTraverse()

"Ordering widgets" in the Creating Widgets in Application Code chapter of the Photon Programmer's Guide


[Previous] [Contents] [Index] [Next]