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

3 visualizaciones (últimos 30 días)
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 comentarios
Rik
Rik el 22 de Oct. de 2018
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 el 22 de Oct. de 2018
You can package any components that are needed into an executable. They are just .m files.

Iniciar sesión para comentar.

Respuestas (1)

Z.P.
Z.P. el 23 de Oct. de 2018
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 comentarios
Adam
Adam el 23 de Oct. de 2018
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. el 23 de Oct. de 2018
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 ;)

Iniciar sesión para comentar.

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by