Remove removes the specified child from the tree or any of its children nodes.
(child IPanel)
| 110 | // Remove removes the specified child from the tree or any |
| 111 | // of its children nodes. |
| 112 | func (t *Tree) Remove(child IPanel) { |
| 113 | |
| 114 | for idx := 0; idx < t.List.Len(); idx++ { |
| 115 | curr := t.List.ItemAt(idx) |
| 116 | if curr == child { |
| 117 | node, ok := curr.(*TreeNode) |
| 118 | if ok { |
| 119 | node.remove() |
| 120 | } else { |
| 121 | t.List.Remove(child) |
| 122 | } |
| 123 | return |
| 124 | } |
| 125 | node, ok := curr.(*TreeNode) |
| 126 | if ok { |
| 127 | node.Remove(child) |
| 128 | } |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | // Selected returns the currently selected element or nil |
| 133 | func (t *Tree) Selected() IPanel { |