Main Content

slUpdateToolstripComponent

Reload specific custom toolstrip component

Since R2023b

    Description

    slUpdateToolstripComponent(component) reloads the custom Simulink® Toolstrip component specified by component. When you make changes to the files in the resources folder of a custom toolstrip component, to see the changes in the toolstrip, you must reload the component. Use this function to reload a specific component. To reload the entire toolstrip, use the slReloadToolstripConfig function.

    example

    Examples

    collapse all

    Open a Simulink® model.

    new_system('model')
    open_system('model')

    Create a new Simulink Toolstrip tab by entering these commands in the MATLAB® Command Window. The first command places the current folder on the MATLAB path. For more information, see slCreateToolstripComponent.

    slCreateToolstripComponent("componentName");
    slCreateToolstripTab("propertiesFileName","componentName",Title="CUSTOM TAB");

    A resources folder is created in the current folder.

    To change the tab title, open the resources folder and then the json folder.

    Open the propertiesFileName.json file and change "title": "CUSTOM TAB" to "title": "NEW".

    Save the file.

    To reload the component, enter this command.

    slUpdateToolstripComponent("componentName")

    In the toolstrip, the title of the custom tab changes to New.

    Input Arguments

    collapse all

    Custom toolstrip component, specified as a string or character vector. This value is the component name or the path of the parent folder of the resources folder that corresponds to the component.

    Example: "componentName"

    Data Types: char | string

    Version History

    Introduced in R2023b