Home |
Obtaining a Pointer to PegPresentationManager Finding an Object's Children Determining the Position of an Object |
Finding an Object's ChildrenThe first child of any object can be found using the function First(). This returns a pointer to the head of a linked-list of child objects. The linked list can be traversed using the Next() function. For example, an object could count the number of siblings (i.e. object's with the same parent) it has using the following code sequence: PegThing * pTest = Parent()->First(); // first child of my parent int iSiblings = 0; while (pTest) { if (pTest != this) iSiblings++; pTest = pTest->Next(); }
|