()
| 474 | } |
| 475 | |
| 476 | func (tr *Tree) OnAdd() { |
| 477 | tr.WidgetBase.OnAdd() |
| 478 | tr.Text = tr.Name |
| 479 | if ptv := AsTree(tr.Parent); ptv != nil { |
| 480 | tr.root = ptv.root |
| 481 | tr.IconOpen = ptv.IconOpen |
| 482 | tr.IconClosed = ptv.IconClosed |
| 483 | tr.IconLeaf = ptv.IconLeaf |
| 484 | } else { |
| 485 | tr.root = tr |
| 486 | } |
| 487 | if tr.root.TreeInit != nil { |
| 488 | tr.root.TreeInit(tr) |
| 489 | } |
| 490 | } |
| 491 | |
| 492 | // rootIsReadOnly returns the ReadOnly status of the root node, |
| 493 | // which is what controls the functional inactivity of the tree |