HISE Logo Forum
    • Categories
    • Register
    • Login

    How to change Label text ComboBox Selected Items

    Scheduled Pinned Locked Moved General Questions
    9 Posts 4 Posters 528 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.
    • Tania GhoshT
      Tania Ghosh
      last edited by

      How to change Label text with ComboBox Items ?

      Any help please?

      HiseSnippet 882.3ocsV0tSaCCE0tTyng0IPZO.QUZREIFJcC1lzzz5ZKcpZ7Q0JCw+PtItTKbr6RbXTgPZOx6AXRaWmj1jBEFTok9md+3by4Ze70oafxkEFpBP3RGMdDCgeJo2XodXygTtD0oEB+Lx9zPMKvNwUiwinggLODFuzmMNvkJhhe90GaPEToKKyEBcrh6x1i6y0Yd6V+KbgnM0icD2OW1aWuiqR1TITQ.eVh3fFQcOmdF6.pIsBDDd4c83ZUPOMUyBgbZn7F2an5Gxj7OlGx6KXFiZndPgRbiZNjK75NoWCQHbwtYc9RIc9yI6y83S8msBrVb.6LD4WCvElkREmgR0tKJ0VI7LE3NnGNG8JlPu0I8bC3izYQLbaURGIr4LfBK64oURtnB+FSZpfLj5s7omyZG.FSQTcGGmMs21wYi2W1prEr3GpsufBa0J+9pFpKqY+A6IvOioA2iTRvnZkoYT4lX2i1mItafIgSQY9wkBtjYOHR5p4JosQAjVaSEBThptSfuI7FDQrMJacUYKa.rM7b+umsBYfklcotxlUhesWG+p+mskAXJAZREh9fTr5s4lof4n9AJM6PY0Mrtxpj00V12LzfAyMVZwDrf4F1bLI39.VUF42mELY4YRhf1YVw4pOLwoaxZStDUxNRt9vQrT6L4qIVRWOIpCZZyl2UVOl2abqMmzxbc6SGnz8N3eeqSKplZNvj5CxaDKPyMcKtE6BX5SxwmRjVrvy0pQvfjoa3HLQGGsb5gqXUChCc1JjDED5xoCn942qONaZ090Mhp3wRnbE7IIEbszBNQuDWyUISkO4JK7LN+TTtl4Cr+EjtbpTY0VDoY1VMBfy1V8zAb4YgVcodgVsOwB4SgBQvKCHCoWv5H6Fv.gqYD.51yPfIYJuHAUO63Myb7z.frZl4HlYExPtdFF9Hl44L2Yd0l2t5CjtqCqKZ2gymuElCeA0w+a9ldCRYxtCFvb0YjsHo8IK50EOBp7UUjFzE6SA4gQObPjeO3RTWFvDojIBMZjBlSNI1NFayJSOlzK13OvSZvZFabZvZSBBJM2.0otIGOM2QsRrGfSx3qmKAem.XaWCEODBvQb1xA4CWcdpqqYo3k.2mOlWs.Xd8BfY6E.yNK.l2r.Xd6Bf4c2KFyWs7oHsxO4XB3n6twiKw3ckTPkEqHQ+EPWrh6b
      

      Tania Ghosh

      ? ulrikU 2 Replies Last reply Reply Quote 0
      • ?
        A Former User @Tania Ghosh
        last edited by

        @Tania-Ghosh Use Switch Case

        e.g

        inline function onComboBox1Control(component, value)
        {
           switch (value)
            {
                case 1:
         Content.getComponent("Label1").set("text","Piano");
                    
                case 2: 
         Content.getComponent("Label1").set("text","Flute");
            }
           
        };
        
        1 Reply Last reply Reply Quote 0
        • ?
          A Former User
          last edited by

          @Tania-Ghosh How did you forget basic things? You are not studying well anymore !!

          1 Reply Last reply Reply Quote 1
          • Tania GhoshT
            Tania Ghosh
            last edited by

            @Rudra-Ghosh Oooops !! Sorry :anxious_face_with_sweat:

            Tania Ghosh

            1 Reply Last reply Reply Quote 1
            • ulrikU
              ulrik @Tania Ghosh
              last edited by

              @Tania-Ghosh I would do it like this:

              inline function onComboBox1Control(component, value)
              {
               
                  Content.getComponent("Label1").set("text", component.getItemText());
              };
              
              Content.getComponent("ComboBox1").setControlCallback(onComboBox1Control);
              

              Hise Develop branch
              MacOs 15.3.1, Xcode 16.2
              http://musikboden.se

              Tania GhoshT 1 Reply Last reply Reply Quote 1
              • Tania GhoshT
                Tania Ghosh @ulrik
                last edited by Tania Ghosh

                @ulrik (y) Easier... Thank you :)

                Then how would I customize the Label Text. example:

                ComboBox
                Piano
                Flute
                etc

                Selected Label Text will be : " Yamaha C7 Grand"
                " Indian Native Flute"
                .........

                How?

                Tania Ghosh

                ulrikU 1 Reply Last reply Reply Quote 0
                • NatanN
                  Natan
                  last edited by Natan

                  @Rudra-Ghosh
                  Give the names in combo boxs property 🙃

                  1 Reply Last reply Reply Quote 0
                  • ulrikU
                    ulrik @Tania Ghosh
                    last edited by ulrik

                    @Tania-Ghosh are you saying that in the Combobox you will have like:
                    "piano" but you want the label to display "Yamaha C7 Grand"?

                    in that case I would use @Rudra-Ghosh switch example

                    like:

                    inline function onComboBox1Control(component, value)
                    {
                       switch (value)
                        {
                            case 1:
                     Content.getComponent("Label1").set("text"," Yamaha C7 Grand");
                                
                            case 2: 
                     Content.getComponent("Label1").set("text","Indian Native Flute");
                        }
                       etc...
                    };
                    

                    Hise Develop branch
                    MacOs 15.3.1, Xcode 16.2
                    http://musikboden.se

                    Tania GhoshT 1 Reply Last reply Reply Quote 1
                    • Tania GhoshT
                      Tania Ghosh @ulrik
                      last edited by

                      @ulrik Yeah.. That's what I want. (y)

                      Tania Ghosh

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

                      49

                      Online

                      1.7k

                      Users

                      11.7k

                      Topics

                      101.9k

                      Posts