Changeset 591 for trunk/src/fill_GUI.m


Ignore:
Timestamp:
Mar 25, 2013, 5:43:18 PM (11 years ago)
Author:
sommeria
Message:

various updates, in particular modification of series to do calculations in the cluster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/fill_GUI.m

    r569 r591  
    11%'fill_GUI': fill a GUI with a set of parameters from a Matlab structure
    22% -----------------------------------------------------------------------
    3 % function errormsg=fill_GUI(Param,handles)
     3% function errormsg=fill_GUI(Param,GUI_handle)
    44% OUPUT:
    55% errormsg: error message, ='' by default
     
    1111% see also the reverse function read_GUI.m
    1212%
    13 function errormsg=fill_GUI(Param,handles)
     13function errormsg=fill_GUI(Param,GUI_handle)
    1414%------------------------------------------------------------------------
    1515errormsg='';
     16handles=guidata(GUI_handle);
     17UserData=get(GUI_handle,'UserData');
    1618fields=fieldnames(Param);%list of fields in Param
    1719% loop on the elements of the input structure Param
     
    2123        if isfield(handles,fields{ifield})
    2224            set(handles.(fields{ifield}),'Visible','on')
    23             children=get(handles.(fields{ifield}),'children');
    24             for ichild=1:numel(children)
    25                 hchild.(get(children(ichild),'tag'))=children(ichild);
    26             end
    27             errormsg=fill_GUI(Param.(fields{ifield}),hchild);% apply the function to the substructure
     25%             children=get(handles.(fields{ifield}),'children');
     26%             for ichild=1:numel(children)
     27%                 hchild.(get(children(ichild),'tag'))=children(ichild);
     28%             end
     29         %   errormsg=fill_GUI(Param.(fields{ifield}),hchild);% apply the function to the substructure
     30         errormsg=fill_GUI(Param.(fields{ifield}),handles.(fields{ifield}));% apply the function to the substructure
     31           % if the input sub-structure fits with a tag name of the GUI and a
     32         % substructure of UserData
     33        elseif isfield(UserData,fields{ifield})&& isfield(handles,fields{ifield})&&isfield(Param.(fields{ifield}),'Name')
     34            UserData.(fields{ifield})=Param.(fields{ifield});
     35            set(handles.(fields{ifield}),'String',Param.(fields{ifield}).Name)
    2836        end
    2937    % case of an element
Note: See TracChangeset for help on using the changeset viewer.