Pass GUI information to another GUI depending on a condition
Show older comments
I have a GUI (built in GUIDE), lets call it GUI 1, that opens another GUI, lets call it GUI 2, when the users selects a check box. GUI 2 asks the user to select three different file locations using press buttons. Then, the user is supposed to hit a button called "Submit File Names" when they are done selecting the three file locations. The "Submit File Names Button" is supposed to send the file names back to GUI 1 and to prompt GUI 1 to complete its next series of tasks. I cannot figure out how to get GUI 2 to send the file locations back into GUI 1 without adding an additional button in GUI 1.
Here is the check box code from GUI 1:
%Check box code from GUI 1:
function checkBox_Callback(hObject,eventdata,handles)
% hObject handle to checkBox (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data
button_state = get(hObject,'Value');
if button_state == 1
GUI2();
% This is where I get stuck. How do I pause this section of code while
% the user selects their files in GUI2 and then pick up here when they
% press the "Submit File Names" button? This is what a pseudo code
% would look like:
%Pause GUI1 here until GUI2 is finished
%Recieve three variables from GUI2
%Restart GUI1 code
else
%Not important to the question.
end
Here is the push button code for "Submit File Names"
%Submit File Name code from GUI2:
% --- Executes on button press in submit
function submit_Callback(hObject,eventdata,handles)
% hObject handle to submit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data
% This is the other place I get stuck. How do I get this button press to
% continue with the GUI1 code up above after it sends the three variable
% back to GUI1? This is what a pseudo code would look like:
%Send three variables to GUI 1 at the point where it was paused
end
Accepted Answer
More Answers (0)
Categories
Find more on Scope Variables and Generate Names 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!