UItree: Changing the root

4 views (last 30 days)
Günter Gsellmann
Günter Gsellmann on 8 Jun 2015
Commented: Walter Roberson on 8 Jun 2015
I created an uitree as placeholder in a gui. After choosing a "profile", different mat files should be loaded as the new root. Unfortunatly this is not working, handles.NodeD = eventData.getCurrentNode, shows always just the original root
handles = guidata(figureHandle);
root = uitreenode('v0','handles.Ex',handles.str,handles.ipath,false);
handles.tree = uitree('v0',figureHandle,'Root', root, 'ExpandFcn', @myExpfcn);
set(handles.tree, 'Units', 'normalized', 'position', [0.001 0.001 0.15 0.995])
set(handles.tree, 'NodeWillExpandCallback', @TreeNodeWillExpand);
set(handles.tree, 'NodeSelectedCallback', @TreeNodeSelected);
%%%Profiles input
function MenuTako(figureHandle,eventData)
handles = guidata(figureHandle);
handles.Ex = load('RCR11P.mat');
handles.str = fieldnames(handles.Ex);
create_struct_tree
guidata(figureHandle,handles);
end
  1 Comment
Walter Roberson
Walter Roberson on 8 Jun 2015
uitree() is an undocumented routine that has stayed undocumented since it was introduced in R14. There is therefore no way to say that it is working incorrectly. It does whatever it does.
There is nothing in the code you show that references MenuTako so there is no reason shown for it to ever be invoked.
You mention something about nested functions but you don't show one. You also don't show create_struct_tree
You do not make it easy to assist you.

Sign in to comment.

Answers (0)

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!