Main Content

GUIDE Preferences

Note

The GUIDE environment will be removed in a future release. After GUIDE is removed, existing GUIDE apps will continue to run in MATLAB® but they will not be editable in GUIDE.

To continue editing an existing GUIDE app, see GUIDE Migration Strategies for information on how to help maintain compatibility of the app with future MATLAB releases. To create new apps interactively, Develop Apps Using App Designer instead.

Set Preferences

You can set preferences for GUIDE. From the MATLAB Home tab, in the Environment section, click Preferences. These preferences apply to GUIDE and to all UIs you create.

The preferences are in different locations within the Preferences dialog box:

Confirmation Preferences

GUIDE provides two confirmation preferences. You can choose whether you want to display a confirmation dialog box when you:

  • Activate a UI from GUIDE.

  • Export a UI from GUIDE.

  • Change a callback signature generated by GUIDE.

In the Preferences dialog box, click MATLAB > General > Confirmation Dialogs to access the GUIDE confirmation preferences. Look for the word GUIDE in the Tool column.

Prompt to Save on Activate

When you activate a UI from the Layout Editor by clicking the Run button , a dialog box informs you of the impending save and lets you choose whether or not you want to continue.

Prompt to Save on Export

From the Layout Editor, when you select File > Export to MATLAB-file, a dialog box informs you of the impending save and lets you choose whether or not you want to continue.

Backward Compatibility Preference

MATLAB Version 5 or Later Compatibility

UI FIG-files created or modified with MATLAB 7.0 or a later version are not automatically compatible with Version 6.5 and earlier versions. GUIDE automatically generates FIG-files, which are binary files that contain the UI layout information.

To make a FIG-file backward compatible, from the Layout Editor, select File > Preferences > General > MAT-Files, and then select MATLAB Version 5 or later (save -v6).

Note

The -v6 option discussed in this section is obsolete and will be removed in a future version of MATLAB.

All Other Preferences

GUIDE provides other preferences, for the Layout Editor interface and for inserting code comments. In the Preferences dialog box, click GUIDE to access these preferences.

The following topics describe the preferences in this dialog:

Show Names in Component Palette

Displays both icons and names in the component palette, as shown below. When unchecked, the icons alone are displayed in two columns, with tooltips.

Show File Extension in Window Title

Displays the FIG-file file name with its file extension, .fig, in the Layout Editor window title. If unchecked, only the file name is displayed.

Show File Path in Window Title

Displays the full file path in the Layout Editor window title. If unchecked, the file path is not displayed.

Add Comments for Newly Generated Callback Functions

Callbacks are blocks of code that execute in response to actions by the user, such as clicking buttons or manipulating sliders. By default, GUIDE sets up templates that declare callbacks as functions and adds comments at the beginning of each one. Most of the comments are similar to the following.

% --- Executes during object deletion, before destroying properties.
function figure1_DeleteFcn(hObject, eventdata, handles)
% hObject    handle to figure1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

Some callbacks are added automatically because their associated components are part of the original GUIDE template that you chose. Other commonly used callbacks are added automatically when you add components. You can also add callbacks explicitly by selecting them from View > View Callbacks menu or on the component's context menu.

If you clear this preference, GUIDE includes comments only for callbacks that are automatically included to support the original GUIDE template. GUIDE does not include comments for callbacks subsequently added to the code.

See Write Callbacks in GUIDE for more information about callbacks and about the arguments described in the preceding comments.

Related Topics