MATLAB Creating Graphical User Interfaces

(ff) #1
returns to the calling function. Doing this delays the figure display until after
MATLAB adds all the components. Thus, the resulting UI has a clean appearance
when it starts up.


  • The plotsine function plots the sine function inside the axes when the user clicks the
    button.


Managing the Layout in Resizable UIs


To create a resizable UI and manage the layout when the user resizes the window, set the
figure’s SizeChangedFcn property to be a handle to a callback function. Code the
callback function to manage the layout when the window size changes.

If your UI has another container, such as a uipanel or uibuttongroup, you can manage the
layout of the container’s child components in a separate callback function that you assign
to the SizeChangedFcn property.

The SizeChangedFcn callback executes only under these circumstances:

9 Lay Out a Programmatic UI

Free download pdf