Selective AutoResize Children?

I'm working on a class that adds a component to an app figure and I don't want the component to change size when the figure resizes. Obviously, I could turn AutoResizeChildren off for the figure, but I don't want to do that as I don't know if whomever created the figure wants to keep that behavior. I know if I put the component in a container like a panel,tab, etc it will shield it from resizing, but that doesn't really work in my scenario either. Has anyone figured out a workaround in this situation?

Réponses (1)

Image Analyst
Image Analyst le 27 Mai 2022

0 votes

Calling your code will place a widget on the figure window of an app the user built with App Designer I presume? Or are you using GUIDE? Can you set the Units properties to 'characters' instead of normalized? Then your widget won't scale if the user resizes their app's window.

4 commentaires

Austin Decker
Austin Decker le 27 Mai 2022
You're correct. I'm assuming non-guide apps.
Image Analyst
Image Analyst le 27 Mai 2022
OK, so is there a units property? Did you try what I said?
Austin Decker
Austin Decker le 27 Mai 2022
Modifié(e) : Austin Decker le 27 Mai 2022
I will give it a shot!
Austin Decker
Austin Decker le 27 Mai 2022
Right, so uipanel doesn't have 'character' units if it is created inside uifigure. Only in figure.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Develop Apps Programmatically dans Centre d'aide et File Exchange

Produits

Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by