14 Examples of UIs Created Programmatically
Program List Master
The List Master UI code file contains 22 functions, organized into five groups, which are
described below.List Master Main ProgramThe main function, listmaster, opens a figure window. Then, listmaster calls the
local function, lm_make_file_menu, to create the File menu. The following table
describes the menu items and lists their callbacks.Menu Item How Used Callback
Open... Opens an existing List Master figure lmopen
New... Creates a List Master by adding controls
to the initial UI or to a new figure if the
existing one already contains a listlmnewImport
list...Loads list data from a workspace cell array lmwsimportExport
list...Creates a cell array or text file containing the
current listlmwsexport,
lmfileexport
Save Saves current List Master and its contents as
a FIG-filelmsaveSave as... Saves current List Master to a different FIG-
filelmsaveasQuit Exits List Master, with option to save first lmquitAfter creating a blank UI with a File menu, the listmaster function exits.The main function sets up the figure as follows:fh = figure('MenuBar','none', ...
'NumberTitle','off', ...
'Name','ListMaster', ...
'Tag','lmfigtag', ...
'CloseRequestFcn', @lmquit, ...
'Units','pixels', ...
'Position', pos);
Turning off the MenuBar eliminates the default figure window menus, which the
program later replaces with its own File menu. NumberTitle is turned off to eliminate a
figure number in its title bar.