HISE Logo Forum
    • Categories
    • Register
    • Login

    Add Widgets & Panels at runtime

    Scheduled Pinned Locked Moved Scripting
    5 Posts 4 Posters 1.2k 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
      paul
      last edited by

      Hi, as you might see from my questions I am new to HISE ...

      1. I tried adding widgets like ScriptButtons, etc. to a ScriptPanel or ScriptFloatingTile but did not succeed so far.
      2. After adding those I want to switch the panels on or off at runtime. :-)
        Making them invisible only would also be acceptable in the worst case and I know how to do that.

      As I cannot find something about this here or elsewhere I guess it's not possible?
      Or does that mean it's trivial?
      Thx!

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

        You can't add controls at run-time, at least not without some C++. But you can control their visibility. The command you need is .showControl();.

        I have a video on my Patreon page about making a tabbed interface, it uses this method.

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

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

          @paul

          • create your panel
          • select your panel
          • create your button

          The button will be inside the script panel

          turn (any widget) on or off like this:

          myPanel.showControl(false)
          

          -- Doing Dave Healeys scripting videos is a recommended early step...

          HISE Development for hire.
          www.channelrobot.com

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

            Dave is right, every UI control has to be declared at the beginning. The reason for this is that the UI controls also act as data model and for the sake of preset consistency you need to have every slot defined (see https://docs.hise.audio/working-with-hise/project-management/user-presets/index.html)

            With C++ you can easily decouple this connection and build up a separate data model which the UI controls act upon (which is what I am doing in PercX).

            1 Reply Last reply Reply Quote 1
            • P
              paul
              last edited by

              Thanks to all of you!!! I understand ...

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

              54

              Online

              1.7k

              Users

              11.7k

              Topics

              101.8k

              Posts