How to move from one gui page to another by clicking push button?
古いコメントを表示
hi,I am new to matlab.I have a problem.I have created a simple gui page in matlab, it has a next button. Now I want to go to the next gui page by clicking on this button, such that first gui closes and next appears. What should I code in the callback? Do I need to use uicontrol? What exactly in the uicontrol?
something like this:
uicontrol('style','push','call','figure(''s.fig'',''new Figure'') close(gcbf)');
however this doe not seem to work..:(
採用された回答
その他の回答 (3 件)
Matt Tearle
2011 年 4 月 21 日
I do this for things like help windows:
- Set the 'Tag' property in each window
- In the callback, use findobj to find the handle to the desired tag
- Check to see that it actually exists
- If so, use figure to make it active
Sample callback:
function showhelp(hObject,eventdata)
h_help = findobj('Tag','RCChelp');
if (isempty(h_help))
% Do something here -- window doesn't currently exist
else
figure(h_help);
end
end
You could simplify all this to figure(findobj('Tag','xxxx')), if you wanted to inline it.
1 件のコメント
Paulo Silva
2011 年 4 月 21 日
+1 vote, that's a good example on how it should be done :)
Image Analyst
2015 年 1 月 11 日
0 投票
With R2014b you now have tabbed panels: http://www.mathworks.com/products/matlab/matlab-graphics/ : "Create user interfaces with tab panels with uitabgroup and uitab functions."
Savannah Morrissey Martin
2018 年 5 月 11 日
0 投票
Could you tell me how you set up your next button? I am trying to do something similar.
カテゴリ
ヘルプ センター および File Exchange で Creating, Deleting, and Querying Graphics Objects についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!