InsertAt inserts a child panel at the specified position in this node If the position is invalid, the function panics
(pos int, child IPanel)
| 258 | // InsertAt inserts a child panel at the specified position in this node |
| 259 | // If the position is invalid, the function panics |
| 260 | func (n *TreeNode) InsertAt(pos int, child IPanel) { |
| 261 | |
| 262 | if pos < 0 || pos > len(n.items) { |
| 263 | panic("TreeNode.InsertAt(): Invalid position") |
| 264 | } |
| 265 | // Insert item in the items array |
| 266 | n.items = append(n.items, nil) |
| 267 | copy(n.items[pos+1:], n.items[pos:]) |
| 268 | n.items[pos] = child |
| 269 | if n.expanded { |
| 270 | n.updateItems() |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | // Add adds a child panel to this node |
| 275 | func (n *TreeNode) Add(child IPanel) { |