The label component of an edit field is not showing in component browser of app designer

I am using appdesigner. I added an edit field (which includes an "edit field" and an "edit field label". I changed the name of the edit field to "Env6", and the tag of the edit field changed to "Env6EditField", but the associated label is just called "Label". I want the label to be renamed to "Env6EditFieldLabel", in concordance with my other edit fields & labels, but I can't find the label component in the appdesigners component browser.
If I debug from within a callback, I can see that there is a field of "app" called "Label" (i.e. isfield(app,'Label')==1), but it isn't editable with the appdesigner GUI and not visible in component browser.
How do I edit this?

 Réponse acceptée

Andrew
Andrew le 1 Déc 2022
Modifié(e) : Andrew le 2 Déc 2022
I figured it out! If you right click on the relevant object in "Component Browser", there is a checkbox for viewing the associated label. Here's a screenshot example for anyone having similar issues:

Plus de réponses (1)

cr
cr le 1 Déc 2022
Modifié(e) : cr le 1 Déc 2022
I don't think Label for an edit field exists as a separate object (at least not in very recent versions). It's a part of the editfield object and accessible via the editfield object's Label property. In your case the label can be accessed as app.Env6EditField.Label.

5 commentaires

The label field you describe does not exist. I believe that's how it used to be, so I'm confused now. I described precisely how the objects are organized above. For reference, this is on Matlab version R2022a.
Can you share a screenshot? What OS are you on?
See my screeshots from 17b and 22b
cr, thanks again for your comment. I have already included a screenshot and I explained the object structure as clearly as I can. It's Windows 10, Matlab R2022a. I don't know how to explain what happened any clearer. I promise you what I said is correct, the label is a different object, with a different tag, and the EditField object has no field called label, because the EditFieldLabel is a different object. There may be a setting I can change to prevent this separation, but I don't know what it is. In my screenshot - the PNG file, it shows that there's a button for including the label objects in the component browser.
You are right. Never noticed it, never needed it. Not sure what purpose it's serving since the object can be accessed using the label property.
Just to be absolutely clear for any future matlab users who see this thread- in my version of matlab, the label property you describe does not exist. Again, it does not exist.
For example, if there is a component called "EditField", then there will be an associated component called "EditFieldLabel". However, the label component that is associated with "EditField" is not a property of "EditField". in code:
isfield(app.EditField,'label')==false
the above expression evaluates as false because the label field does not exist.
I am being thorough here for 2 reasons:
  1. cr -- I don't want other users to be confused by your comment if they have the same version of matlab as me.
  2. I don't understand why the label components would ever be separated. This is silly behavior. Maybe a @MathWorks Support Team employee will see this and reunite the labels with their parent components. Pretty please?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Graphics Object Properties dans Centre d'aide et File Exchange

Produits

Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by