uitree cannot expand subdirectories when trailing filesep is missing.
Afficher commentaires plus anciens
I know that uitree is unsupported, but I thought it would be good to let you guys know about this bug anyways.
I have found a workaround already, so this is not really a question but a source of information for others. If this is not rhe right place for such a thing, please move it where it belongs.
Problem:
uitree cannot expand subdirectories when trailing filesep is missing.
I am using matlab version 2014b
Example (on a mac):
Folder tree:
/Users/foo/
bar/
subbar1/
subbar2/
bas/
Matlab code to reproduce problem:
mtree=uitree('v0','root','/Users/foo');
node=mtree.Root.getChildAt(0);
mtree.expand(node);
node.getChildCount
ans = 0
The reason can be seen with
node.getValue
ans =
/Users/foobar/
Note that the slash between foo and bar is missing (the path has been f* up beyond all recognition ;-).
Workaround:
If I call uitree with a trailing slash in the path, everything works fine:
mtree=uitree('v0','root','/Users/foo/');
node=mtree.Root.getChildAt(0);
mtree.expand(node);
node.getChildCount
ans = 2
node.getValue
ans =
/Users/foo/bar/
Réponses (0)
Catégories
En savoir plus sur Shifting and Sorting Matrices dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!