IupGetNextChild

IUP - Portable User Interface

IupGetNextChild

Returns the children of the given control.

Parameters/Return

Ihandle *IupGetNextChild(Ihandle* ih, Ihandle* child); [in C]
iup.GetNextChild(ih, child: ihandle) -> ret: ihandle [in Lua]

ih: identifier of the interface element.
child: Identifier of the last interface control returned by the function.

Notes

This function will return the children of the control in the exact same order in which they were assigned. To get the first child use child=NULL.

Example

/* Lists all children of a IupVbox */
#include <stdio.h>
#include "iup.h"

int main()
{
  Ihandle *dialog, *bt, *lb, *vbox, *tmp = NULL;

  IupOpen();

  bt = IupButton("Button", "");
  lb = IupLabel("Label");

  vbox = IupVbox(bt, lb, NULL);

  dialog = IupDialog(vbox);
  IupShow(dialog);

  while(1)
  {
    tmp = IupGetNextChild(vbox, tmp);
    if(tmp)
      printf("vbox has a child of type %s\n", IupGetType(tmp));
    else
      break;
  }

  IupMainLoop();
  IupClose();

  return 0;
}

See Also

IupGetBrother, IupGetParent, IupGetChild