PtWidgetFamily()

Traverse the widget hierarchy from back to front

Synopsis:

PtWidget_t *PtWidgetFamily( PtWidget_t *root,
                            PtWidget_t *current );

Library:

ph

Description:

This function walks the depth of the widget hierarchy, starting from the top widget.

Returns:

A pointer to the next widget below root in the widget hierarchy. When the hierarchy has been fully traversed, the function returns NULL.

Examples:

PtWidget_t *mycontainer;
PtWidget_t *root;
PtWidget_t *current;
int n;
…
mycontainer = PtCreateWidget( PtContainer, Pt_DEFAULT_PARENT,
                              n, args );
…
/*
 * Set and highlight all PtLabel widgets
 * within "mycontainer" 
 */
root = current = mycontainer;
PtSetArg( &arg, Pt_ARG_FLAGS, Pt_TRUE, 
          Pt_HIGHLIGHTED|Pt_SET);
while( current = PtWidgetFamily( root, current ) )
      if( PtWidgetIsClass( current, PtLabel) )
          PtSetResources( current, 1, &arg );
PtRealizeWidget( mycontainer );

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtWidgetBrotherBehind(), PtWidgetBrotherInFront(), PtWidgetChildBack(), PtWidgetChildFront(), PtWidgetParent(), PtWidgetSkip(), PtWidgetToBack(), PtWidgetToFront(), PtWidgetTree(), PtWidgetTreeTraverse()

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