How can I control the stacking order of objects in appdesigner?
Mostrar comentarios más antiguos
How can I control the stacking order of objects in appdesigner? It seems to be determined by the order in which the panels or axes are created. What if I want an object created later to slide underneath earlier objects?
Respuesta aceptada
Más respuestas (3)
Kevin J. Delaney
el 7 de Feb. de 2018
4 votos
Wouter
el 14 de Feb. de 2018
You could also keep a list of handles; e.g. in the variable background and than move all of these to the background.
hfig = uifigure; % create figure
hax = uiaxes(hfig); % create axis
foreground = plot(hax,rand(1,100),'r'); % create red line
hold(hax,'on');
for ind = 1:10
% this moves the foreground plot to the background...
background(ind) = plot(hax,rand(1,100),'k'); % create 10 ack lines (on top of red line)
end
% move the background lines to the background!
ch = get(hax,'children'); % get all plots from hax
[~,neworder] = sort(ismember(ch,background)); % reorder the handles to move the background lines to the background
set(hax,'children',ch(neworder)); % set the new order of all lines
Categorías
Más información sobre Develop Apps Using App Designer en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!