Harmonized TreeNode._set_parent() with Component._set_parent().