HISE Logo Forum
    • Categories
    • Register
    • Login

    Combo Box values in Script Processor

    Scheduled Pinned Locked Moved General Questions
    7 Posts 3 Posters 372 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.
    • LindonL
      Lindon
      last edited by

      OK I'm using a number of script processors (attached to Synthesiser Groups but thats not an issue)

      Here's some of the code

      const var myNote1 = Content.addComboBox("myCombo1", 300,10);
      myNote1.addItem("C");
      myNote1.addItem("C#");
      myNote1.addItem("D");
      myNote1.addItem("D#");
      myNote1.addItem("E");
      myNote1.addItem("F");
      myNote1.addItem("F#");
      myNote1.addItem("G");
      myNote1.addItem("G#");
      myNote1.addItem("A");
      myNote1.addItem("A#");
      myNote1.addItem("B");
      

      So pretty simple really, but....everytime I compile it adds these 12 values to the existing contents of the combo box, so how do I make it just do this once?

      HISE Development for hire.
      www.channelrobot.com

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

        @Lindon Just write them straight into the list items in the interface designer.

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

        LindonL 1 Reply Last reply Reply Quote 0
        • LindonL
          Lindon @d.healey
          last edited by

          @d-healey yeah I have quite a few to do - I'd like to do it programmatically if I can.

          HISE Development for hire.
          www.channelrobot.com

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

            @Lindon Do it once then delete the code. It should add it in the interface designer if I remember correctly. If you want to leave it in the code you can use myNote1.set("items", "A", "B", "C", etc.);

            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 Christoph Hart

              You can clear the list before adding the items by passing an empty string:

              const var myNote1 = Content.addComboBox("myCombo1", 300,10);
              myNote1.set("items", "");
              myNote1.addItem("C");
              myNote1.addItem("C#");
              myNote1.addItem("D");
              myNote1.addItem("D#");
              myNote1.addItem("E");
              myNote1.addItem("F");
              myNote1.addItem("F#");
              myNote1.addItem("G");
              myNote1.addItem("G#");
              myNote1.addItem("A");
              myNote1.addItem("A#");
              myNote1.addItem("B");
              
              LindonL 1 Reply Last reply Reply Quote 1
              • LindonL
                Lindon @Christoph Hart
                last edited by

                @Christoph-Hart OK thanks

                HISE Development for hire.
                www.channelrobot.com

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

                  Slightly related query

                  ViewportList.set("items", ""); Doesn't behave as expected. It's like the component needs to be repainted/refreshed.

                  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

                  45

                  Online

                  1.7k

                  Users

                  11.7k

                  Topics

                  101.8k

                  Posts