Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptwidgetchildback.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptwidgetchildback.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptwidgetchildback.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptwidgetchildback.html on line 8

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


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptwidgetchildback.html on line 151

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptwidgetchildback.html on line 151