HISE Logo Forum
    • Categories
    • Register
    • Login

    Assign array of components to local LAF

    Scheduled Pinned Locked Moved Scripting
    4 Posts 2 Posters 120 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.
    • toxonicT
      toxonic
      last edited by

      Hi Folks,
      I have an array containing script references for UI components which i like to assign to local LAF, called

      myUiComponents[]
      

      I now wan't to assign these Components to a local LAF function called "loclaf".

      I tried this, which doesn't seem to work:

      for (i=0;i<myUiComponents.length;i++)
      {
      
      myUiComponents[i].getId() + ".setLocalLookAndFeel(loclaf)";
      }
      

      It compiles fine, but the UI Components have the default HISE look. Any ideas? I'm a noob in scripting, so forgive me that maybe silly question. ;-)

      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @toxonic
        last edited by

        @toxonic

        for (x in myUiComponents)
            x.setLocalLookAndFeel(loclaf);
        

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

        toxonicT 1 Reply Last reply Reply Quote 2
        • toxonicT
          toxonic @d.healey
          last edited by

          @d-healey Thank you so much, that did the trick!
          After thinking about it, i asked myself, why i thought, it would work by adding a string.
          But this one is so much easier i could imagine.

          I still don't really got the syntax of the range oriented for-loop. in this case, x is a placeholder for each array element? why doesn't this kind of for-loop need a termination condition?

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @toxonic
            last edited by

            @toxonic

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

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

            58

            Online

            1.7k

            Users

            11.7k

            Topics

            102.1k

            Posts