Possible to set custom property with setValue?

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
3 posts • Page 1 of 1
v3gard
Posts:9
Joined: Tue Aug 23, 2016 7:27 am

Possible to set custom property with setValue?

Post by v3gard »

The subject really says it all. I have a panel called P, with a property called "eventReference". In GEDI, I can add a panel reference to panel P, and set the property manually in the property window, which works as intended. I can also change it in control (e.g. in the root panel's initialize function) by running P.setEventReference("someValue");

Example which works:

Code: Select all

P.setEventReference("someValue");
However, I would like to run the "setEventReference" function dynamically using setValue in the root panel (where the panel reference is). I am running this:

Code: Select all

int retVal = setValue("P", "setEventReference", "someValue");
DebugN("Return value: " + retVal);
This fails however and retVal returns -1. Is this intentional?

What does work however, is if I get a pointer to the panel reference first with getShape():

Code: Select all

shape pShape = getShape("P");
pShape.setEventReference("someValue");

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Possible to set custom property with setValue?

Post by mkoller »

You can't. User defined properties can only be changed by calling the user defined setter functions.

v3gard
Posts:9
Joined: Tue Aug 23, 2016 7:27 am

Re: Possible to set custom property with setValue?

Post by v3gard »

No problem. I can live with the shape pShape = getShape("P"); workaround.

3 posts • Page 1 of 1