App designer - adding tag to objects

30 Ansichten (letzte 30 Tage)
Roohollah
Roohollah am 17 Okt. 2023
Kommentiert: Roohollah am 18 Okt. 2023
This is my first experience with MATLAB App Designer.
Since MATLAB is going to remove guide, I want to learn how to work with app designer.
Unlike guide, in app designer when I specify a tag in IDENTIFIERS section, I cannot call the object using its tag. Instead I have to use the name given by matlab. For example, when I add a text area, MATLAB gives the name TextArea by default to the obejct and I am not able to change it. If I need to add multiple text areas, then it becomes confusing to distinguish between them.
how can I fix this issue? What is the use of the tag in App Designer?

Akzeptierte Antwort

dpb
dpb am 17 Okt. 2023
Bearbeitet: dpb am 17 Okt. 2023
"..., when I add a text area, MATLAB gives the name TextArea by default to the obejct and I am not able to change it."
Ah, but you can change it (or any other control) to whatever you want. Select the control you want and use F2 and it will let you rename the control. It then becomes app.MySpecificTextArea and you're all set...
You can find out all about using App Designer in the doc tutorial, <the specific subsection> explains all about naming/labels including customizing them.
I never built a GUI using GUIDE (I don't do GUIs in general) so I don't know anything at all about how it identified its controls programmatically, but with AppDesigner, the Tag property is just that; user data associated with the particular control but has nothing to do with its name for identification programmatically.
  1 Kommentar
Roohollah
Roohollah am 18 Okt. 2023
If you right click on the name given by matlab, you can rename it to whatever you want.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Produkte


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by