GUI

2 ビュー (過去 30 日間)
Pan
Pan 2012 年 3 月 6 日
回答済み: Abhay Aradhya 2017 年 6 月 9 日
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.

回答 (1 件)

Abhay Aradhya
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.

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by