
GUI Files: An Overview
8-5
GUI Files: An Overview
• “M-Files and FIG-Files” on page 8-5
• “GUI M-File Structure” on page 8-6
• “Adding Callback Templates to an Existing GUI M-File” on page 8-7
M-Files and FIG-Files
By default, the first time you save or run a GUI, GUIDE stores the GUI in two
files:
• A FIG-file, with extension
.fig, that contains a complete description of the
GUI layout and the GUI components, such as push buttons, axes, panels,
menus, and so on. The FIG-file is a binary file and you cannot modify it
except by changing the layout in GUIDE. Note that a FIG-file is a kind of
MAT-file. See MAT-Files for more information.
• An M-file, with extension
.m, that initially contains initialization code and
templates for some callbacks that are needed to control GUI behavior. You
must add the callbacks you write for your GUI components to this file.
Whenever you save your GUI, GUIDE automatically opens the M-file in your
default editor.
The FIG-file and the M-file, usually reside in the same directory. They
correspond to the tasks of laying out and programming the GUI. When you lay
out the GUI in the Layout Editor, your work is stored in the FIG-file. When you
program the GUI, your work is stored in the corresponding M-file.
Note that if your GUI includes ActiveX components, GUIDE also generates a
file for each ActiveX component. See “ActiveX Control” on page 8-31 for more
information.
For more information about naming and saving a GUI, see Chapter 7, “Saving
and Running the GUI”. If you want to change the name of your GUI and its
files, see “Renaming GUIs and GUI Files” on page 7-4.
Note You can choose to save only the FIG-file for a GUI. See “Saving and
Displaying Only the GUI Layout” on page 7-12
Commentaires sur ces manuels