how to display string's edit box and string's popup when i go back from GUI2 to GUI1
古いコメントを表示
I have created two GUI ( GUI1 and GUI2). In the first (GUI1) I have two edit text in which I insert numerical values ,two pop-up menu, and a callback function "forward" that brings me to the next GUI (GUI2) that contains two radio buttons, two list-box and two functions callback (a GUI allows you to go to the next (GUI3), the other to return to the previous GUI (GUI1)). But when I select the pushbutton 'back' in the second GUI (GUI2) (function_ pushbutton_ indietro_callback), to return to GUI1, the values contained in the edit text of the GUI1 not remain saved (empty cell,as if I had never entered the numeric value) as well as the selections made in the pop-up menu (always in gui1).However, the variables inserted and the initially selected strings are stored in the workspace. I wanted to know, kindly, as I see in the GUI1 the values entered in the edit text and the string selected in the pop-up menu when I get back from GUI2 to GUI1?
Thank you for your cooperation.
回答 (2 件)
Roberto
2014 年 5 月 19 日
All depends how your data is saved and passed between the different GUIs, start reading HERE or HERE it's a good way to start.
Or to make it simple, you can use parameters when calling a function to create the GUIs, here's a general idea of to do this!!! in this example you can share the data between two GUIs...
myGUI_1.m
function myData = myGUI_1(inputData)
if isempty(inputData)
myData = 0 ;
else
myData = inputData ;
end
hFigure = figure ;
guidata(hFigure,'myData');
end
myGUI_2.m
function myData = myGUI_2(inputData)
if isempty(inputData)
myData = 0 ;
else
myData = inputData ;
end
hFigure = figure ;
guidata(hFigure,'myData');
end
But again, it depends on what you want to do and how your app data is configured!!!
Sara
2014 年 5 月 19 日
You can write a function that sets the values in GUI1 when it is called from GUI2, i.e. something that does:
set(handles.myeditbox,'string',handles.myvalue)
カテゴリ
ヘルプ センター および File Exchange で Whos についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!