Effacer les filtres
Effacer les filtres

GUI

3 vues (au cours des 30 derniers jours)
Pan
Pan le 6 Mar 2012
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.

Réponses (1)

Abhay Aradhya
Abhay Aradhya le 9 Juin 2017
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.

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by