MATLAB: Making GUI with sub-elements resizable in a quick way

guiguideresize

When developing a GUI in guide, there is a global GUIDE option that let's you make the GUI resizable in a way that all sub-elements resize proprtionately with the figure.
However, I am given a programmatically generated GUI and I would like to modify the mfile so that it is resizable in the same way. Is there a quick way to do this, i.e., by modifying a single property of the parent figure, or do I have to write a ResizeFcn callback that manually alters the size/position of the sub-elements one by one?

Best Answer

Add this line at the end of the code, which defines the GUI
set( findall( fig_handle, '-property', 'Units' ), 'Units', 'Normalized' )