RemoveAll removes all children.
(recurs bool)
| 451 | |
| 452 | // RemoveAll removes all children. |
| 453 | func (n *Node) RemoveAll(recurs bool) { |
| 454 | |
| 455 | for pos, ichild := range n.children { |
| 456 | n.children[pos] = nil |
| 457 | ichild.GetNode().parent = nil |
| 458 | if recurs { |
| 459 | ichild.GetNode().RemoveAll(recurs) |
| 460 | } |
| 461 | } |
| 462 | n.children = n.children[0:0] |
| 463 | } |
| 464 | |
| 465 | // DisposeChildren removes and disposes of all children. |
| 466 | // If 'recurs' is true, call DisposeChildren on each child recursively. |