HISE Logo Forum
    • Categories
    • Register
    • Login

    setPropertiesFromJSON()

    Scheduled Pinned Locked Moved Scripting
    2 Posts 2 Posters 518 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • d.healeyD
      d.healey
      last edited by

      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.

      Libre Wave - Freedom respecting instruments and effects
      My Patreon - HISE tutorials
      YouTube Channel - Public HISE tutorials

      1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart
        last edited by

        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.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post

        28

        Online

        1.7k

        Users

        11.9k

        Topics

        103.7k

        Posts