147 views
in GUI Development by
If I create a variant of a class and add a property/object to that variant which is not in the original class, how can I access that variant of the class (and its properties) from another components Chora methods/slots? As of now, variant only properties do not appear in the editor.

1 Answer

0 votes
by
Hello,

members, which are existing within a variant are not visible nor accessible from outside of this variant. The concept of variants includes the possibility of switching on/off the variants (either at the code generation or later at the runtime). Dependencies to members existing within a variant can therefore not be dissolved forehand.

In other words, the property/object you added to variant are existing only when the variant is active. The interface of the original class would need to change dynamically when the variant is activated. This is not possible because of the static nature of Chora programming language with all expressions and dependencies between members being evaluated and verified at the code generation time.

What can you?

If you want to enhance the interface of a class, you will need to derive a new class from it, add the property/object to this new class and use this new class wherever you planed to use the original class.

I hope it helps you further.

Best regards

Paul Banach

Embedded Wizard Website | Privacy Policy | Imprint

...