How to resize all children automatically when creating a uifigure with uibuttons etc?

조회 수: 5 (최근 30일)
Z.P.
Z.P. 2018년 10월 19일
댓글: Z.P. 2018년 10월 23일
Hello dear MATLAB folks,
I want to create a GUI with the uifigure command.
uifg1=uifigure;
Then I place a button
uibt1=uibutton('parent',uifg1);
I also check that
uifg1.AutoResizeChildren = 'on'
but when i resize the uifg1 with my mouse it does not resize the button.
I can't use GUIDE, because the GUI must be modular expandable.
  댓글 수: 10
Rik
Rik 2018년 10월 22일
The toolbox is not one by Mathworks, but it is on the FEX, so you can just use it. I can't really tell if it is simply a design tool, or if it is required to run it, but you may be allowed to package this with you GUI.
Adam
Adam 2018년 10월 22일
You can package any components that are needed into an executable. They are just .m files.

댓글을 달려면 로그인하십시오.

답변 (1개)

Z.P.
Z.P. 2018년 10월 23일
I solved it with a "scale button". I wrote a function that finds all children of a GUI and then scales them child by child.
  댓글 수: 2
Adam
Adam 2018년 10월 23일
Was it not possible to do the same code you put under that button in the SizeChangedFcn of the figure so that it happens automatically?
Z.P.
Z.P. 2018년 10월 23일
Well this could be possible but it was easier for me now to click on a button instead of doing some resizing with the mouse.
I really wanted to make this happen when the GUI is being moved somewhere, but this nice super duper "scale button" is exactly what I want to have.
But to come back to your question: It should be possible but it would just be trigered if you really resize it by the mouse. And that was not really i wanted.
Thank you anyway ;)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by