HISE Logo Forum
    • Categories
    • Register
    • Login

    I'd like to show and hide a panel using a button

    Scheduled Pinned Locked Moved Scripting
    8 Posts 4 Posters 542 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.
    • P
      pgaudioworks
      last edited by

      I've figured out how to get the console to print the 1 or 0 value of a button, but I don't know how to translate that to the pop up showing or not. Should I use if else for this? How do I get the panel to show and hide?

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

        @pgaudioworks MyPanel.showControl(MyButton.getValue);

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

        P 1 Reply Last reply Reply Quote 0
        • P
          pgaudioworks @d.healey
          last edited by

          @d-healey thank you David. I'm getting this error:

          Draft 1:! Line 7, column 22: API call with undefined parameter 0 {SW50ZXJmYWNlfG9uSW5pdCgpfDE3M3w3fDIy}

          Here's what I have:

          const var Panel1Red = Content.getComponent("Panel1Red");
          
          const var Button1 = Content.getComponent("Button1");
          
          Panel1Red.showControl(Button1.getValue);
          
          CyberGenC LindonL 2 Replies Last reply Reply Quote 0
          • CyberGenC
            CyberGen @pgaudioworks
            last edited by

            @pgaudioworks try with a callback.

            inline function onButton1Control(component, value)
            {
            	Panel1Red.showControl(value);
            };
            Content.getComponent("Button1").setControlCallback(onButton1Control);
            
            P 1 Reply Last reply Reply Quote 0
            • P
              pgaudioworks @CyberGen
              last edited by

              @CyberGen That definitely worked, but I don't think I understand why.

              Is the first line creating an inline function that happens whenever the button is pressed? And the contents of the { } is the what the inline function does when it's run? I don't understand the last line at all.

              Am I close?

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

                @pgaudioworks yes, go watch my Scripting 101 video 😃

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

                P 1 Reply Last reply Reply Quote 0
                • P
                  pgaudioworks @d.healey
                  last edited by

                  @d-healey @CyberGen - I did it, I figured it out and understood it! Thanks both of you :)

                  1 Reply Last reply Reply Quote 0
                  • LindonL
                    Lindon @pgaudioworks
                    last edited by

                    @pgaudioworks said in I'd like to show and hide a panel using a button:

                    @d-healey thank you David. I'm getting this error:

                    Draft 1:! Line 7, column 22: API call with undefined parameter 0 {SW50ZXJmYWNlfG9uSW5pdCgpfDE3M3w3fDIy}

                    Here's what I have:

                    const var Panel1Red = Content.getComponent("Panel1Red");
                    
                    const var Button1 = Content.getComponent("Button1");
                    
                    Panel1Red.showControl(Button1.getValue);
                    

                    nearly...

                    Panel1Red.showControl(Button1.getValue());

                    ..see those extra ellipses at the end of getValue() ??

                    HISE Development for hire.
                    www.channelrobot.com

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

                    29

                    Online

                    1.7k

                    Users

                    11.8k

                    Topics

                    102.7k

                    Posts