Problems with programmatically adding 'TabName' property value in mask.

조회 수: 1(최근 30일)
Bryan 2015년 6월 5일
댓글: Bryan 2015년 6월 8일
I attempted to programmatically add a 'TabName' parameter in my mask interface using the following commands:
mask_obj = Simulink.Mask.get('PRL/array_concat1'); mask_obj.addParameter('Type','popup','TypeOptions',{'Red' 'Blue' 'Green'},'Evaluate','off','TabName','Properties');
However, it doesn't set the tabname and sends the following warning.
Warning: 'TabName' cannot be set for 'PRL/array_concat1' as it will be removed in a future release. Use tab dialog controls to add parameters to tabs
I am currently using version 2014a and the current documentation (<>) explicitely states that it is possible to set the TabName property and there is no mention of this feature being disabled. This capability is very important to me since I have to programmatically create mask interfaces for hundreds of blocks as part of my library development. To add in the tab functionality manually is too painful. Does anyone know a workaround? Why was this feature removed and why does the documentation claim it is still supported? Thanks in advance for your help on this.

채택된 답변

Drew Davis
Drew Davis 2015년 6월 8일
Try setting the tab names with the following commands:
mask = Simulink.Mask.get('blockpath');
tab = mask.getDialogControl('currentTabName');
tab.Name = 'newTabName'
tab.Prompt = 'My tab'
See the following documentation page for more information regarding creating tabs programmatically
  댓글 수: 1
Bryan 2015년 6월 8일
Drew, this works perfectly. Thank you for the link to the documentation as well.

댓글을 달려면 로그인하십시오.

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by