setPropertiesFromJSON()
-
This function works when using
Content.function
like thisContent.setPropertiesFromJSON("cmbPreset", {itemColour:Theme.CONTROL1, textColour:Theme.COMBO_TEXT, items:presetNames.join("\n")});
But not when applying it to a constant variable with a stored reference component like this:
cmbPreset.setPropertiesFromJSON({itemColour:Theme.CONTROL1, textColour:Theme.COMBO_TEXT, items:presetNames.join("\n")});
Although the API doc indicates that either method should work.
-
I think it's a mistake in the API doc - it's created automatically by using the inheritance hierarchy of the C++ classes and this one might slipped in to the wrong place.
Content.setPropertiesFromJSON()
is definitely the go-to option.However, the missing link might be a method like
Control.getName()
so you can call it without having to store the String name somewhere.