User`s guide

15 Examples of GUIs Created Programmatically
delete(hMainFigure);
end
The hCloseMenuite mCal lback function calls the questdlg function to create
and open the ques tion dialog box show n in the following figure.
If the user clicks the No button, the callback returns. If the user clicks the
Yes button, the callback deletes the GUI.
See “Helper Function: Plot the Plot Types” on page 15-18 for a description of
the
localUpdatePlot function.
Helper Function: Plot the Plot Types
The example defines the localUpdatePlot function at the same level as the
callback functions. Because of this,
localUpdatePlot has access to the same
data and component handles.
function localU pdat ePlot
% Helper function for plott ing the selected pl ot type
mPlotTypes{get(hPlotsPopupmenu, 'Value'), 2}(hPlotAxes );
end
The localUpdatePlot function uses the pop-up menu Value property to
identify the selected menu item from the first column of the
mPlotTypes
5-by-2 cell array, then calls the corresponding anonymous function from
column two of the cell array to create the plot in the axes.
15-18