GUI
2 ビュー (過去 30 日間)
古いコメントを表示
How to creat a hierarchical window ,detail that pushing one button can go to another window that have some buttons can be chose, and can go back original window.
0 件のコメント
回答 (1 件)
Abhay Aradhya
2017 年 6 月 9 日
You could do this using the callbacks of the button property
ax = figure('Name','First GUI');
selectButton1 = uicontrol('Parent',ax,'Style','pushbutton','String',"Select",...
'Units','normalized',...
'Position',[.325 .25 .05 .5],...
'Callback', @(h,e)firstCallback(ax));
function firstCallback(ax)
ay = figure('Name','Second GUI');
selectButton2 = uicontrol('Parent',ay,'Style','pushbutton','String',"Select",...
'Units','normalized',...
'Position',[.325 .25 .05 .5],...
'Callback', @(h,e)secondCallback(ax));
end
function secondCallback(ax)
close(ax);
end
Here the first GUI has a button(selectButton1), upon clicking opens 2nd GUI with another button(selectButton2). On clicking of selectButton2 the first GUI closes.
You can go on nesting them like the example above.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!