Creating Graphical User Interfaces | ![]() ![]() |
Application Allows Only One Instance to Run
This option allows you to select between two behaviors for the GUI figure:
If you allow only one instance, MATLAB reuses the existing GUI figure whenever the command to launch the GUI is issued. If a GUI already exists, MATLAB brings it to the foreground rather than creating a new figure.
If you uncheck this option, MATLAB creates a new GUI figure whenever the command to launch the GUI is issued.
Code in the Application M-File
GUIDE implements this feature by generating code in the application M-file that uses the openfig
command. The reuse
or new
string specifies one instance or multiple instances of the GUI figure.
fig = openfig(mfilename
,'reuse');
fig = openfig(mfilename
,'new');
Note
Ensure that you have only one occurrence of openfig in your
application M-file, including in commented lines.
|
![]() | Generating Callback Function Prototypes | Using the System Background Colors | ![]() |