glib.node
Module for [Node] class
class Node
Types 1
classNode
The #GNode struct represents one node in a [n-ary tree][glib-N-ary-Trees].
Fields
GNode _cInstanceMethods
void * _cPtr()glib.node.Node next() @propertyGet `next` field. Returns: points to the node's next sibling (a sibling is another #GNode with the same parent).glib.node.Node parent() @propertyGet `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() @propertyGet `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)Gets the position of the first child of a #GNode which contains the given data.int childPosition(glib.node.Node child)Gets 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)Calls 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.uint depth()Gets the depth of a #GNode.void destroy()Removes root and its children from the tree, freeing any memory allocated.bool isAncestor(glib.node.Node descendant)Returns 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()Gets the maximum height of all branches beneath a #GNode. This is the maximum distance from the #GNode to all leaf nodes.uint nChildren()Gets the number of children of a #GNode. Returns: the number of children of nodeuint nNodes(glib.types.TraverseFlags flags)Gets the number of nodes in a tree.void reverseChildren()Reverses 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)Traverses 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...void unlink()Unlinks a #GNode from a tree, resulting in two separate trees.void popAllocator()void pushAllocator(glib.types.Allocator allocator)