<h2>1.5: Why use layouts? <a href="User_guide1.html"><img src="Images/uparrow.png" border="0" align="top" alt="Go back up one level"/></a></h2>
<p>MATLAB ships with a GUI design tool called <a href="matlab:doc GUIDE"><code class="FUNCTION">GUIDE</code></a>. This
doesn't use layouts, but forces users to manually position each element. This approach
is a much faster way to build simple user-interfaces, so why would you want to
use layouts?</p>
<p>The over-riding reason for using layouts or layout managers is
to gain control of the resizing behaviour of the interface without
having to write a complex "ResizeFcn". If you simply position user-interface elements
directly (either using <a href="matlab:doc GUIDE"><code class="FUNCTION">GUIDE</code></a> or programmatically), you
have two choices about what happens when the window resizes:
</p>
<h3>For example:</h3>
<para><b>1. The user-interface components scale with the window (normalised units)</b><br/>We didn't really want the buttons to grow but everything resizes in proportion.</para>
<para><b>2. The user-interface components stay fixed and the window resize creates empty space (pixel units)</b><br/>Although the buttons don't now grow, neither does the axes, which looks very odd.</para>