Specifications
Resize Behavior
2-11
This approach works well with simple GUI tools and dialog boxes that apply
settings without closing. Users may want to resize these windows to better fit
them on the screen, but the precise layout of the GUI is not critical to its
function.
Property Settings
GUIDE sets the following properties to create proportional resizing GUIs:
•
Units properties of the axes and uicontrols should be set to normalized so
the these components resize and reposition as the figure window changes
size.
•
Units property of the figure should be set to characters so the GUI displays
at the correct size at runtime.
•
Resize figure property set to on (the default).
•
ResizeFcn figure property does not require a callback routine.
User-Specified Resize Operation
You can create GUIs that accommodate resizing, while at the same time
maintain the appearance and usability of your original design by programming
the figure
ResizeFcn callback routine. This callback routine essentially
recalculates the size and position of each component based on the new figure
size.
This approach to handling figure resizing is used most typically in GUI-based
applications that require user interaction on an ongoing basis. Such an
application might contain axes for displaying data and various components
whose position and size are critical to the successful use of the interface.
Property Settings
GUIDE sets the following properties to implement this style of GUI:
•
Units properties of the figure, axes, and uicontrols should generally be set to
characters so the GUI displays at the correct size at runtime.
•
Resize figure property set to on (the default).
•
ResizeFcn figure property requires a callback routine to handle resizing.
See The Address Book Resize Function for an example of a user-written resize
function.