I have two guis and when i call gui2 from gui1 using a continue button, gui2 does not work. However, gui2 works on its own when opened using guide. I have included the code below, please help!
Show older comments
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% get the handle of Gui1
h = findobj('Tag','Gui1');
% if exists (not empty)
if ~isempty(h)
% get handles and other user-defined data associated to Gui1
g1data = guidata(h);
% maybe you want to set the text in Gui2 with that from Gui1
set(handles.text1,'String',get(g1data.edit1,'String'));
end
open page1.fig
close(Opening_Page)
4 Comments
B.k Sumedha
on 11 Mar 2016
Edited: B.k Sumedha
on 11 Mar 2016
If you just call the name of the second gui its enough.No need to mention the '.fig'.Remove open also.Just page1 is sufficient to call the gui. If you still find the problem have a look at this Link
Geoff Hayes
on 13 Mar 2016
B.k. - please post our comment as a solution.
Note that GUI fig files are not meant to be run from the command line or to be double-clicked form within a file browser. They contain layout information and show what the GUI looks like. Any sort of initializations that is expected for the GUI would not occur when trying to "run" the figure file. It is the m file that we use to launch the GUI.
Preethi Thomas
on 14 Mar 2016
Preethi Thomas
on 14 Mar 2016
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB 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!