Is There A Way to Rename the "app" Component In appdesigner?

조회 수: 13 (최근 30일)
Michael Cappello
Michael Cappello 2019년 11월 1일
댓글: Image Analyst 2025년 1월 6일 18:46
When you start appdesigner, the canvas window contains a single UIFigure. You can access the UIFigure via syntax like "app.UIFigure..." So the main component I think is the "app" component (or main 'object', I'm not sure I have the correct phrasing). I want to rename the "app" component to "A" such that I would then access the UIFigure via syntax like "A.UIFigure...".
Is it possible to rename "app" to "A" and how is it done.
Thanks in advance.

채택된 답변

Michael Cappello
Michael Cappello 2019년 11월 1일
I called Mathworks technical support and asked them about this. Their response below.
Hello Michael,
I am writing in reference to your Technical Support Case #03859399 regarding naming of the app designer's main component.
Unfortunately, there is no way to change the name of the app's main component.
I will close this case but please let me know if you have any follow-up questions regarding this.
  댓글 수: 2
SergeyLA
SergeyLA 2025년 1월 6일 17:11
If any way to manually rename child components (like tabs, edit fields etc)???
The topic is relevant becouse after copying some components AppDesigner add _2 (_3 etc) postfixes, and if initial component is later deleted - no renumeration is done by AppDesigner in automatic ways, and so you need forever reference component with _2 postfix! (which surely is not convinient!)
Image Analyst
Image Analyst 2025년 1월 6일 18:46
@Michael Cappello, why would you want to? Just to save typing 2 letters?
@SergeyLA Yes, there is. With App Designer open, go to the "Component Browser" panel on the right hand side of the screen. Find the control you want to rename, like app.button_2. Double click on the name after the dot, like button_2, and it will be highlighted. Then just type in the name that you want and hit return, like "OpenImage" or whatever.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop uifigure-Based Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by