Change order of custom menu (context menu) in Simulink

4 次查看(过去 30 天)
I successfully created a custom context menu in Simulink using sl_customization function. However, each custom menu is added at the end of context menu list. Is there anyway to put it in first or any other place in this list ?
  2 个评论
Arthur Roué
Arthur Roué 2021-2-10
Yes ! Instead of
cCustomMenuFcns = cm.getCustomMenuFcns('Simulink:ContextMenu');
cm.addCustomMenuFcn('Simulink:ContextMenu', @myMenu);
use
cCustomMenuFcns = cm.getCustomMenuFcns('Simulink:PreContextMenu');
cm.addCustomMenuFcn('Simulink:PreContextMenu', @myMenu);
You need to replace ContextMenu with PreContextMenu

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Environment Customization 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by