The Shoes Manual
Traversing the Page
You may find yourself needing to loop through the elements inside a slot. Or maybe you need to climb the page, looking for a stack that is the parent of an element.
On any element, you may call the parent
method to get the slot directly above it. And on slots, you can call the contents
method to get all of the children. (Some elements, such as text blocks, also have a contents
method for getting their children.)
contents() » an array of elements
Lists all elements in a slot.
parent() » a Shoes::Stack or Shoes::Flow
Gets the object for this element's container.
Next: Elements