Creating Graphical User Interfaces |
 |
Running the GUI
To run the GUI you design in the Layout Editor, select Run in the Tools menu or click the Run icon
on the toolbar.
When you run a GUI, the following occurs:
- GUIDE first prompts you to save both the M-file and FIG-file with the dialog shown in the following figure.

- If you click Yes and you have not saved the GUI previously, GUIDE opens a Save As dialog box so you can select a name for both the FIG-file and the M-file GUIDE generates.
- When you click Save in the Save As dialog box, GUIDE saves the FIG-file with the same name as the M-file, but with a
.fig
extension.
- If an M-file with the same name exists, GUIDE prompts you to replace or append to the existing code in the M-file.

Replace -- writes over the existing file.
Append -- inserts new callbacks for components added since the last save and make changes to the code based on change made from the Application Options dialog.
- If the directory in which you saved the GUI is not on the MATLAB path, GUIDE opens a dialog box with three options, as shown in the following figure.

Change MATLAB current directory -- changes the MATLAB current directory to the directory where you saved the GUI.
Add directory to the top of the MATLAB path -- adds the directory where you saved the GUI to the top of the MATLAB path.
Add directory to the bottom of the MATLAB path -- adds the directory where you saved the GUI to the bottom of the MATLAB path.
- MATLAB executes the M-file to display the GUI. The options specified in the Application Options dialog are functional in the GUI.
Note
GUIDE automatically saves both the M-file and the FIG-file when you run the GUI.
|
| Working with Components in the Layout Area | | Saving the Layout |  |
© 1994-2005 The MathWorks, Inc.