Hello,
I have trouble in passing GUI data and variable data between two GUI.
I have two separate GUIs, GUI1 GUI2. In GUI 1, I call GUI 2 and set multiple radio buttons and also load some text files. In GUI 2, I put a code that save data of GUI 2 to the root as following setappdata(0,'popupex',handles);
After I close GUI 2, I recall GUI 2 from GUI 1. In this GUI 2 opening moment, I want to load the savedappdate at the root and override the stored GUI and variable data into GUI 2 but I have been failed.
What I was trying is put the following code at the OpeningFcn of GUI 2. I was hoping as soon as prevGUI is stored in hObject, It can recall all the GUI data and variable data I had before I close first GUI2 and override them into 2nd opened GUI 2.
prevGUI=getappdata(0,'popupex');
if(isempty(prevGUI)==0) % when there is prev. GUI data from popupex
guidata(hObject,prevGUI)
end
Please give me some advice to get this done. Thank you

댓글 수: 2

Kyoungchoul - are you using GUIDE to create your GUIs? If so, wouldn't the
guidata(hObject,prevGUI)
overwrite any of the handles to the controls on the new GUI? (So not just data that you may have saved yourself but the handles to the controls too.) Is this the problem or is prevGUI empty?
Kyoungchoul Koo
Kyoungchoul Koo 2016년 11월 17일
Hi Geoff,
Thank you for the response. I created these GUI with GUIDE.
I found that when I close the GUI2 after I store all the data of GUI2 using setappdata to the root, all the handles in the stored setappdata are also delete and become an empty variable.
Could you give me an advice about alternative ways to impelement 1. Save all data including GUI data in my GUI 2 2. Close GUI 2 and open GUI 2 again from GUI 2 3. Overwrite the saved GUI and data into new GUI 2
Thanks, Kyoungchoul

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 App Building에 대해 자세히 알아보기

태그

질문:

2016년 11월 17일

댓글:

2016년 11월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by