Merge pull request #442 from pezipink/tree-clear-fix

tree.clear() fixed
This commit is contained in:
Vadim Lopatin 2017-09-18 09:10:11 +03:00 committed by GitHub
commit f92d83c624
1 changed files with 6 additions and 0 deletions

View File

@ -139,7 +139,13 @@ class TreeItem {
} }
void clear() { void clear() {
foreach(c; _children) {
c.parent = null;
if(c is root.selectedItem)
root.selectItem(null);
}
_children.clear(); _children.clear();
root.onUpdate(this);
} }
@property TreeItem parent() { return _parent; } @property TreeItem parent() { return _parent; }