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

PtWidgetFamily()

Traverse the widget hierarchy

Synopsis:

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

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, NULL, 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 );

See also PtWidgetChildBack().

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 Creating Widgets in Application Code chapter of the Photon Programmer's Guide


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