Traverses a tree starting at the given root Node.
It calls the given function for each node visited. The traversal can be halted at any point by returning true
func must not do anything that would modify the structure of the tree.
the root Node of the tree to traverse
the order in which nodes are visited - g_in_order, g_pre_order, g_post_order, or g_level_order.
which types of children are to be visited, one of g_traverse_all, g_traverse_leaves and g_traverse_non_leaves
the maximum depth of the traversal. Nodes below this depth will not be visited. If max_depth is -1 all nodes in the tree are visited. If depth is 1, only the root is visited. If depth is 2, the root and its children are visited. And so on.
the function to call for each visited Node
user data to pass to the function