Checkbox AutoComplete: Value has small red A

If you are writing code for a checkbox, there are many autocomplete suggestions that will appear (example: FontName, Visible etc.). One of the autocomplete suggestions is Value.

There is a little red A that appears, associated with Value. This is not seen with the other choices.

What does it mean? I can not find it in the Documentation. These red things (usually so small that I have a hard time actually reading them) often are associated with deprecations. But I do not see in the Documentation that the Value property of a checkbox is deprecated.

What is it trying to say?

Iā€™m sorry, no idea, just wanted to add a screenshot:
image

1 Like

The little red A means thereā€™s attributes. Iā€™m not sure how to view attributes for framework classes other than introspection. Documentation for Attributes

Edit: Using introspection, Iā€™ve found that the attribute flag is RuntimeOnly. It looks like this flag prevents the property from showing up in the Inspector at design time.

4 Likes

Attributes are compile-time properties. They can be added to project items and code items such as method and properties. An attribute consists of its Name and its Value.

It is interesting to read about Attributes. But there are things that are confusing for me. Personally, I have used Attributes only to deprecate my own properties in some Module or Class. That puts a tiny red thing over the property in the IDE. Until this discussion I did not realize that the tiny red thing is the letter D in that circumstance. I just thought that the presence of a red blob meant Deprecated. Now I see that it does not necessarily mean that. Your eyes have to be good enough to recognize the specific capital letter.

CleanShot 2024-04-12 at 10.36.10@2x

The documentation that you pointed me to refers to the user creating Attributes. But it does not discuss intrinsically ā€œexistingā€ Attributes. Why would the property Value of Checkbox have an Attribute? The IDE with AutoComplete brings this to your attention which seems to imply that it is conveying important information, but I donā€™t know what the Attribute is nor do I understand why I should care.

Using Introspection, I do not know how I would access the Attribute which is a property of a all Checkboxes: Value.

I have learned something from Timā€™s contribution, but it does not completely answer my original question.

What is it trying to say?

Just what Tim said, it has an attribute that makes Value not available using the IDE as ā€˜Visual Stateā€™ may be the prefered way to use/change the checkbox state.

If you use Web, you can see that Value is available using the IDE (no red A in autocomplete).

Just what Tim said, it has an attribute that makes Value not available using the IDE as ā€˜Visual Stateā€™ may be the preferred way to use/change the checkbox state.

I donā€™t know what you mean saying ā€œmakes Value not available using IDEā€. It is an Autocomplete suggestion. It works perfectly fine.

I had wondered whether it was to nudge you toward using Visual State but the documentation itself does not disparage Value.

For DesktopCheckbox, you canā€™t change the Value using the IDE, there is no option for that on the Inspector:
image

For WebCheckbox you can see/change the Value option there:
image

Ah, I see what you mean. Value cannot be specified in the IDE directly. But reading the documentation makes this understandable.

The Value property is not independent of the ValueState: They are strictly linked. The Value is True if the state is Checked or Intermediate and False if Unchecked. So there is no point in having a way to change the Value in the IDE independent of the more specific ValueState.

as ā€˜Visual Stateā€™ may be the preferred way to use/change the checkbox state.

Interestingly, there is no event linked specifically to the ValueState changing. The only event to be captured is a change in the Value. In this sense, Value seems more endowed than ValueState.

I appreciate your and Timā€™s feedback. I have learned stuff. Stubbornly, I still cannot see why putting a small red A on the Value property conveys much in the way of specific information to the user.

The D of deprecated conveys fairly specific information. A for attribute seems a little obscure in terms of why the coder using the IDE would care or understand.

This scarlet letter does not carry any obvious mark of shame.

Perhaps it should be RO instead of A. Then it would mean RuntimeOnly as Tim sussed out.

Anyway, I think Iā€™ll just give credit to Tim as a Solution. One could argue that perhaps the Documentation should specifically what is going on here since it is a visual sign that the developer, in my experience, just stumbles upon.

RO would be very confusing. It could also mean Read Only.

1 Like

Just fired up Xojo2019r1.1, as I still do some things with that version, and the Value has no red A in autocomplete. Value is not available on the Inspector either.

1 Like