Hot to change the settings of multiple gui components at the same time
이전 댓글 표시
Hello,
I have a programmatically written gui. Their units are in pixels. After writing everything in pixels, I wanted to set all the units to normalized. I don't want to do it one by one. Do you know how I can set to normalized for multiple handles at the same time?
Thank you,
Emre
채택된 답변
추가 답변 (2개)
Matt Fig
2012년 8월 10일
Pass in a vector of the handles:
u(1) = uicontrol;
u(2) = uicontrol;
u(3) = uicontrol;
set(u,'units','norm')
댓글 수: 5
Seyhan Emre Gorucu
2012년 8월 10일
Matt Fig
2012년 8월 10일
In that case, something like this would be easiest of all!
set(findall(gcf,'units','pix'),'units','norm')
Seyhan Emre Gorucu
2012년 8월 10일
Addy
2018년 5월 9일
In that case, something like this would be easiest of all!
set(findall(gcf,'units','pix'),'units','norm')
OMG. Thank you very much for this. I finally found this gold after 5 hours of madness :^)
Kevin Phung
2019년 3월 25일
편집: Kevin Phung
2019년 3월 25일
ditto that!! That's one beautiful line. Thanks @Loginatorist
카테고리
도움말 센터 및 File Exchange에서 Function Creation에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!