glib.node
Module for [Node] class
class Node
Types 1
classNode
The #GNode struct represents one node in a n-ary tree.
Fields
GNode _cInstanceMethods
void * _cPtr() nothrowglib.node.Node next() @property nothrowGet `next` field. Returns: points to the node's next sibling (a sibling is another #GNode with the same parent).glib.node.Node prev() @property nothrowGet `prev` field. Returns: points to the node's previous sibling.glib.node.Node parent() @property nothrowGet `parent` field. Returns: points to the parent of the #GNode, or is null if the #GNode is the root of the tree.glib.node.Node children() @property nothrowGet `children` field. Returns: points to the first child of the #GNode. The other children are accessed by using the @next pointer of each child.int childIndex(void * data = null) nothrowGets the position of the first child of a #GNode which contains the given data.int childPosition(glib.node.Node child) nothrowGets the position of a #GNode with respect to its siblings. child must be a child of node. The first child is numbered 0, the second 1, and so on.void childrenForeach(glib.types.TraverseFlags flags, glib.types.NodeForeachFunc func) nothrowCalls a function for each of the children of a #GNode. Note that it doesn't descend beneath the child nodes. func must not do anything that would modify the structure of the tree.bool isAncestor(glib.node.Node descendant) nothrowReturns true if node is an ancestor of descendant. This is true if node is the parent of descendant, or if node is the grandparent of descendant etc.uint maxHeight() nothrowGets the maximum height of all branches beneath a #GNode. This is the maximum distance from the #GNode to all leaf nodes.uint nChildren() nothrowGets the number of children of a #GNode. Returns: the number of children of nodevoid reverseChildren() nothrowReverses the order of the children of a #GNode. (It doesn't change the order of the grandchildren.)void traverse(glib.types.TraverseType order, glib.types.TraverseFlags flags, int maxDepth, glib.types.NodeTraverseFunc func) nothrowTraverses a tree starting at the given root #GNode. It calls the given function for each node visited. The traversal can be halted at any point by returning true from func. func must not do anythin...