Main Content

mw.desktop.quickAccess Extension Point (Beta)

Add items to quick access toolbar

Since R2024b

Note

Extension points are available only as part of the new desktop for MATLAB®. The new desktop for MATLAB is in beta development and should not be used for development or production activities. For more information, see Get Started with the New Desktop for MATLAB (Beta).

You can add items to the quick access toolbar using the mw.desktop.quickAccess extension point.

To add items to the quick access toolbar:

  1. Create a JSON-formatted file named extensions.json and place it in a folder named resources.

  2. Add a set of JSON declarations to extensions.json that defines one or more toolbar items. Define custom items in an "items" array within the extension point.

  3. Add the folder containing the resources folder to the MATLAB path. To add the folder to the path, use the addpath function or right-click the folder in the Files panel and select Add to Path > Selected Folders and Subfolders.

This JSON code shows the basic structure of the mw.desktop.quickAccess extension point.

{
    "mw.desktop.quickAccess": {
        "items": [
        {
            "name": "Unique identifier",
            "type": "PushButton",
            "text": "Button label",
            "description": "Button description",
            "icon": "./icons/Open_16.png",
            "command": "myFunction"
        }]
    }
}

When you add items to the quick access toolbar, they appear to the right of the Search box.

Toolstrip with a new push button in the quick access toolbar

For more information about using extension points, see Extend MATLAB Using Extension Points (Beta)

Properties

expand all

Required Properties

Name of item to add, specified as a JSON string.

Type of item to add, specified as one of these values:

  • "PushButton" — Toolbar item that runs a specified command when clicked.

User-defined MATLAB function to run when you click the toolbar item, specified as a JSON string. For more information on defining the MATLAB function, see Create-User Defined MATLAB Function.

Optional Properties

Item label, specified as a JSON string.

Item tooltip, specified as a JSON string.

Item icon, specified as a JSON string. Specify icon as the path to a PNG, SVG, or JPG icon. The path must be relative to extensions.json.

Example: "icon": "./myicon.svg"

More About

expand all

Version History

Introduced in R2024b