Middleware, development tools, realtime operating system
software and services for superior embedded design


Home
QNX Community Resources
QNX Documentation Library
PtWidgetChildBack

PtWidgetChildBack

QNX Software Systems
Developer Resources
Blogs
Board support packages
Foundry27 projects
Forums
Hardware support listing
Online video tutorials
Product documentation
Technical Articles

PtWidgetChildBack()

Get the child that's farthest back in a container

Synopsis:

PtWidget_t *PtWidgetChildBack( PtWidget_t *widget );

Library:

ph

Description:

This macro returns a pointer to the child that's farthest back in the specified container widget. If widget doesn't have any children, the macro returns NULL.

Examples:

#include <stdlib.h>
#include <Pt.h>

int main ()
{
  PtWidget_t *window, *group, *child;
  PhPoint_t pos;
  PtArg_t  argt[5];

  if (PtInit(NULL) == -1)
    exit(EXIT_FAILURE);

  if ((window = PtCreateWidget(PtWindow, Pt_NO_PARENT,
                               0, NULL)) == NULL)
    PtExit(EXIT_FAILURE);

  pos.x = pos.y = 0;
  PtSetArg( &argt[0], Pt_ARG_POS, &pos, 0 );
  PtSetArg( &argt[1], Pt_ARG_RESIZE_FLAGS, 
            Pt_TRUE, Pt_RESIZE_XY_ALWAYS );
  PtSetArg( &argt[2], Pt_ARG_GROUP_ORIENTATION, 
            Pt_GROUP_HORIZONTAL, 0 );
  group = PtCreateWidget( PtGroup, Pt_DEFAULT_PARENT,
                          3, argt );

  // Create some buttons in the group.
  PtSetArg( &argt[0], Pt_ARG_TEXT_STRING, "Child 1", 0 );
  PtCreateWidget( PtButton, Pt_DEFAULT_PARENT, 1, argt );

  PtSetArg( &argt[0], Pt_ARG_TEXT_STRING, "Child 2", 0 );
  PtCreateWidget( PtButton, Pt_DEFAULT_PARENT, 1, argt );
  PtSetArg( &argt[0], Pt_ARG_TEXT_STRING, "Child 3", 0 );
  PtCreateWidget( PtButton, Pt_DEFAULT_PARENT, 1, argt );

  //  Make the front child red, and the backmost one blue.

  child = PtWidgetChildFront( group );
  PtSetResource ( child, Pt_ARG_COLOR, Pg_RED, 0);

  child = PtWidgetChildBack( group );
  PtSetResource ( child, Pt_ARG_COLOR, Pg_BLUE, 0);
   
  PtRealizeWidget (window);

  PtMainLoop();
  return EXIT_SUCCESS;
}

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtWidgetBrotherBehind(), PtWidgetBrotherInFront(), PtWidgetChildFront(), PtWidgetInsert(), PtWidgetParent(), PtWidgetToBack(), PtWidgetToFront()

PtWindowToBack() PtWindowToFront() in the Photon Widget Reference.

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