uipanel border type problem
7 次查看(过去 30 天)
显示 更早的评论
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 个评论
Jan
2018-5-2
@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.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!