User`s guide

15 Examples of GUIs Created Programmatically
See the Axes Properties reference page for information about axes properties
and their default values.
The Pop-Up Menu
The following statement creates the pop-up menu.
hPlotsPopupmenu = uicontrol(... % List of available types of plot
'Parent', hMainFigu re, ...
'Units','normalized',...
'Position',[0.11 0. 85 0.45 0.1],...
'HandleVisibility','callback', ...
'String',mPlotTypes(:,1),...
'Style','popupmenu');
The uicontrol function creates various user interface controls based on the
value of the
Style property. Here the Style property is set to popupmenu.
For a pop-up menu, the
String property defines the list of items in the
menu. Here it is defined as a 5-by-1 cell array of strings derived from the
cell array
mPlotTypes.
See the Uicontrol Properties reference page for information about properties
of
uicontrol objects and their default values.
The Update Push Button
This statement creates the Update push button as a uicontrol object.
hUpdateButton = uicontrol(... % Button for updating selected plot
'Parent', hMainFigure , ...
'Units','normalized',...
'HandleVisibility','callback', ...
'Position',[0.6 0.85 0.3 0.1],...
'String','Update',...
'Callback', @hUpdateB uttonCallback);
The uicontrol function creates various user interface controls based on
the value of the
Style property. This statement does not set the Style
property because its default is pushbutton.
15-10