Unselect unselects this node (if selected). You must use this method to update global selection list.
()
| 688 | // Unselect unselects this node (if selected). |
| 689 | // You must use this method to update global selection list. |
| 690 | func (tr *Tree) Unselect() { |
| 691 | if tr.StateIs(states.Selected) { |
| 692 | tr.SetSelected(false) |
| 693 | tr.Style() |
| 694 | sl := tr.GetSelectedNodes() |
| 695 | sz := len(sl) |
| 696 | for i := 0; i < sz; i++ { |
| 697 | if sl[i] == tr { |
| 698 | sl = append(sl[:i], sl[i+1:]...) |
| 699 | break |
| 700 | } |
| 701 | } |
| 702 | tr.SetSelectedNodes(sl) |
| 703 | tr.NeedsRender() |
| 704 | } |
| 705 | } |
| 706 | |
| 707 | // UnselectAll unselects all selected items in the tree. |
| 708 | func (tr *Tree) UnselectAll() { |
no test coverage detected