Specifications

Understanding the Application M-File
4-7
Initializing the GUI
The application M-file automatically includes some useful techniques for
managing the GUI. These technique include:
Open the FIG-file.
Single/multiple instance control.
On screen placement of the GUI figure regardless of target computer screen
size and resolution.
Structure containing GUI component handles automatically created.
Automatic naming of
Tag property, generation of subfunction prototype, and
assignment of
Callback property string.
Single M-file contains code to launch GUI and execute callbacks.
Opening the FIG-File
The application M-file uses the openfig command to load the GUI figure. The
actual command is
fig = openfig(mfilename,'reuse');
It is important to note that this statement derives the name of the FIG-file from
the application M-file (the
mfilename command returns the name of the
currently executing M-file). If you are using the application M-file generated by
GUIDE, you must keep the names of the FIG-file and M-file the same. The
reuse argument specifies that there can be only a single instance of the GUI
displayed at any time (see below).
Single vs. Multiple Instance of the GUI
One of the decisions you must make when designing GUIs is whether you want
to allow multiple instances of the GUI figure to exist at one time.
If you choose to allow only a single instance of the GUI, subsequent attempts
to create another GUI figure simply bring the existing GUI to the front of other
windows.
The GUIDE Layout Editor is an example of a GUI that allows multiple
instances. This GUI enables users to have a number of layouts open
simultaneously.