User`s guide
Add Code for Components in C allbacks
groups as well as axes and u ser interface controls such as push buttons,
sliders, pop-up menus, etc. The position of each component within a panel is
interpreted relative to the lower-left corner of the panel.
Generally, if the GUI is resized, the panel and its components are also
resized. However, you can control the size and position of the panel and its
components. You can do this by setting the GUI Resize behavior to Other
(Use ResizeFcn) and providing a
ResizeFcn callback for the panel.
Note To set Resize behavior forthefiguretoOther (Use ResizeFcn),
select GUI Options from the Layout Editor Tools menu. Also see
“Cross-Platform Com patible Units” on page 6-139 for information about the
effect of units on resize behavior.
Even when Resize behavior for the figure is Other (Use ResizeFcn),
if components use normalized
Units, they still automatically resize
proportionally unless a
ResizeFcn overrides that behavior. The following
example shows how you can use a
ResizeFcn to do more than that. The GUI
repositions components automatically. Its p anel’s
ResizeFcn proportionally
adjusts the
fontSize of a b utton’s label.
1 Create a GUI in GUIDE that contains a panel with two push buttons inside
it. In the Property Inspector, name the buttons Button 1 and Button 2.
Set the figure’s
Units to pixels and its Position to [420 520 150 190].
The GUI lo oks like this.
8-39