主要内容

slUIDeveloperMode

Get extension point, action, and icon names of widgets in Simulink Toolstrip and context menu

Since R2026a

    Description

    initialStatus = slUIDeveloperMode(desiredStatus) enters or exits developer mode. Enter developer mode to get the names of extension points, actions, and icons of widgets in the Simulink® Toolstrip and context menu. In developer mode, pause your pointer on a toolstrip or context-menu widget and press Ctrl (command ⌘ on macOS). The MATLAB® Command Window displays the names.

    Use the names to customize the toolstrip and context menu. For information about customizing the Simulink Toolstrip, see Create Custom Simulink Toolstrip Tabs. For information about customizing Simulink Context Menu, see Customize Simulink Context Menu Using Extension Points.

    Note

    If you open a context menu that contains customizations with developer mode turned on, the software outputs error messages and warnings pertaining to the JSON files that define the customizations in the MATLAB Command Window.

    example

    Examples

    collapse all

    Get the action and icon names of the Model Settings button on the Modeling tab of the toolstrip.

    Enter developer mode.

    initialStatus = slUIDeveloperMode("on");

    In Simulink, in the toolstrip, open the Modeling tab.

    Pause on Model Settings and press Ctrl (command ⌘ on macOS). The command window displays the name of the button action and icon.

    Reusable Action: openModelConfigParamAction
    Reusable Icon: settings
    -------------------

    Exit developer mode.

    initialStatus = slUIDeveloperMode("off");

    Get the action and icon names of the Block Parameters button in the Constant block context menu.

    Enter developer mode.

    initialStatus = slUIDeveloperMode("on");

    In Simulink, right-click a Constant block.

    Pause on the Block Parameters button and press Ctrl (command ⌘ on macOS). The command window outputs the name of the button action and icon.

    Reusable PushButton Action: #mw.simulink.editor.parametersAction
    Reusable PushButton Icon: mw.simulink.editor.icons.blockParameters
    -------------------

    Exit developer mode.

    initialStatus = slUIDeveloperMode("off");

    Get the names of the extension points of the RichMenu container. The RichMenu container is the container that houses the context menu.

    Enter developer mode.

    initialStatus = slUIDeveloperMode("on");

    In Simulink, right-click the model canvas or any model element such as a block, signal line, or annotation.

    Pause on any part of the main body of the menu not covered by a widget and press Ctrl (command ⌘ on macOS). The command window outputs the name of the button action and icon. The command window outputs the extension point names.

    RichMenu Extension Point: mw.simulink.editor.contextMenu.preFocusMenu:after
    RichMenu Extension Point: mw.simulink.editor.contextMenu.focusMenu:after
    RichMenu Extension Point: mw.simulink.editor.contextMenu.postFocusMenu:after
    -------------------

    Exit developer mode.

    initialStatus = slUIDeveloperMode("off");

    Input Arguments

    collapse all

    Status indicating whether to enter or exit developer mode, specified as one of:

    • "on", true, or 1 — Enter developer mode.

    • "off", false, or 0 — Exit developer mode.

    Output Arguments

    collapse all

    Status indicating whether the software was in developer mode before the function ran, specified as one of:

    • 1 — Software was in developer mode before the function ran.

    • 0 — Software was not in developer mode before the function ran.

    Version History

    Introduced in R2026a