uipanel border type problem
Afficher commentaires plus anciens
I am designing a GUI where I want to nest 2 or 3 panels in such a way they are perfectly aligned. If I run the following code to nest 100 panels (just an extreme example) inside each other:
a = figure
b=uipanel(a, 'units', 'pixels', 'position', [10, 10, 200, 200]);
for i=1:99
b = uipanel(b, 'units', 'pixels', 'BorderType', 'etchedout','OuterPosition', [1, 1, 200, 200]);
b.Position(1:2) = b.Position(1:2)-b.BorderWidth;
end
I get this:

I corrected the border width offset, but still the panels are not properly aligned. This problem doesn't happen if I use a border of type 'line'. Is there any way to perfectly align all the nested panels for any border type?
In addition, for a 'BorderWidth' of 1, a border of type 'line' has still a different width than a border of type 'etchedout'. It also should be '0' when border type is 'none', but is still '1'. How to find the true border width?
Regards
5 commentaires
Geoff Hayes
le 2 Mai 2018
Andre - why do you have (or need) 100 panels?
Jan
le 2 Mai 2018
100 nested uipanels? I cannot imagine that there is any need to do this. So maybe the solution is not to solve the problem, but to find a better method to do, what you need.
Jan
le 2 Mai 2018
@André: Please post the code, which creates the shown figure and which reproduces the problem. This is more useful than posting some other code, which creates 100 nested panel, which you do not need at all. I'm not sure, which detail the actual problem is.
Réponses (0)
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

