Skip to content

Instantly share code, notes, and snippets.

@therocode
Last active August 29, 2015 14:20
Show Gist options
  • Save therocode/f9e97fb0e1962e6f106a to your computer and use it in GitHub Desktop.
Save therocode/f9e97fb0e1962e6f106a to your computer and use it in GitHub Desktop.
GimGui tree traversal
gim::Element element(/* some initialization*/);
//returns a pointer to the direct parent - nullptr if no parent is present
element.parent();
//returns a list of all direct child elements
element.children();
//returns a list of pointers to all direct children with
//the supplied labels
element.findChildren({"label1", "label2", "label3"});
//does the same as the above, except recursively
element.recursiveFindChildren({"label1", "label2", "label3"});
//returns a list of pointers to any direct or indirect parent
//with the supplied labels
element.findParents({"label1", "label2", "label3"});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment