Changeset 664 for trunk/src/fill_GUI.m
- Timestamp:
- Jul 11, 2013, 11:56:47 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/fill_GUI.m
r607 r664 7 7 % INPUT: 8 8 % Param: matlab structure containing the information to display in the GUI 9 % handles: Matlab structure containing the handles of the GUI elements9 % GUI_handle: handle of the GUI to be filled 10 10 % 11 11 % see also the reverse function read_GUI.m … … 14 14 %------------------------------------------------------------------------ 15 15 errormsg=''; 16 %handles=guidata(GUI_handle); 17 children=get(GUI_handle,'children'); 18 handles=[]; 19 for ichild=1:numel(children) 20 handles.(get(children(ichild),'tag'))=children(ichild); 21 end 16 if ~isstruct(Param) 17 errormsg='first input parmaeter of fill_GUI must be a structure'; 18 return 19 end 20 children=get(GUI_handle,'children'); 21 handles=[]; 22 for ichild=1:numel(children) 23 handles.(get(children(ichild),'tag'))=children(ichild); 24 end 22 25 UserData=get(GUI_handle,'UserData'); 23 26 fields=fieldnames(Param);%list of fields in Param … … 28 31 if isfield(handles,fields{ifield}) 29 32 set(handles.(fields{ifield}),'Visible','on') 30 % children=get(handles.(fields{ifield}),'children');31 % for ichild=1:numel(children)32 % hchild.(get(children(ichild),'tag'))=children(ichild);33 % end34 % errormsg=fill_GUI(Param.(fields{ifield}),hchild);% apply the function to the substructure35 33 errormsg=fill_GUI(Param.(fields{ifield}),handles.(fields{ifield}));% apply the function to the substructure 36 % if the input sub-structure fits with a tag name of the GUI and a37 % substructure of UserData38 34 elseif isfield(UserData,fields{ifield})&& isfield(handles,fields{ifield})&&isfield(Param.(fields{ifield}),'Name') 39 35 UserData.(fields{ifield})=Param.(fields{ifield}); … … 115 111 end 116 112 end 117
Note: See TracChangeset
for help on using the changeset viewer.