% Is the callback supposed to be nested? function EZmultiDayGui %global Exp global exDlst xPos=0.05; btnWid=0.10; btnHt=0.05; spacing=0.02;% Spacing between the button and the next command's label % The ADD Groups button btnNumber=1; yPos=0.85-(btnNumber-1)*(btnHt+spacing); btnPos=[xPos yPos-spacing btnWid btnHt]; %fhImParm=gcf; exFolder=uigetdir exDirs=dir(exFolder) exFs={exDirs.name} f=figure('Menubar','none','Position',[1000 100 640 750],'Name','Select Exp Folders' ); hListbox=uicontrol(... 'Style', 'listbox',... 'String',sort(exFs),... 'value',[],... 'max',1000,... 'min',1,... 'Units','normalized',... 'Position', [.70 .40 .6 .60],... 'callback',{@load_listbox}); % 'uiresume(gcbf)'); 'Position', [5 100 60 20]) function load_listbox(source,eventdata) % global CSrchRng % global CSrearchRange userIndx=(get(source,'value')) userStr=(get(source,'string')) % scLstIndx=str2num(char(strrep(userStr(userIndx), 'Scan', ''))) user_entry=userStr(userIndx) exDlst=user_entry end exFs btnNumber=10; yPos=0.85-(btnNumber-1)*(btnHt+spacing); btnPos=[xPos yPos-spacing btnWid btnHt]; hedit8=uicontrol(... 'Style', 'pushbutton',... 'String',{'Continue'},... 'Units','normalized',... 'Position', btnPos,... 'callback','uiresume(gcbf)'); uiwait(gcf); close(f) end % EZmultiDay