setPropertiesFromJSON()



  • This function works when using Content.function like this

    Content.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.


  • administrators

    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.


Log in to reply
 

0
Online

306
Users

848
Topics

5.5k
Posts

Looks like your connection to Forum was lost, please wait while we try to reconnect.