Forum
    • Categories
    • Register
    • Login

    Click callbacks on panels and labels?

    Scheduled Pinned Locked Moved Solved General Questions
    3 Posts 2 Posters 66 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.
    • dannytaurusD
      dannytaurus
      last edited by

      Do we have click callbacks on panels and labels?

      I'm trying to show/hide my preset browser when the user clicks the preset name label, or the underlying panel.

      Or do I just have to use a transparent button for this?

      Meat Beats: https://meatbeats.com
      Klippr Video: https://klippr.video

      David HealeyD 1 Reply Last reply Reply Quote 0
      • David HealeyD
        David Healey @dannytaurus
        last edited by

        @dannytaurus

        Panels yes - mouse callback
        Other controls yes, use a mouse broadcaster

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        1 Reply Last reply Reply Quote 1
        • dannytaurusD
          dannytaurus
          last edited by

          For my future self, or anyone else who finds it - I ended up doing this with a button instead of a label or panel.

          const btnPresetBrowser = Content.getComponent("btnPresetBrowser");
          const pnlPresetBrowser = Content.getComponent("pnlPresetBrowser");
          
          // Show/hide panel containing preset browser floating tile
          inline function btnPresetBrowserControl(component, value) {
              pnlPresetBrowser.showControl(value);
          }
          btnPresetBrowser.setControlCallback(btnPresetBrowserControl);
          
          // Update button text when new preset is loaded from preset browser
          const UserPresetHandler = Engine.createUserPresetHandler();
          UserPresetHandler.setPostCallback(function(presetFile)
          {
          	btnPresetBrowser.set("text", Engine.getCurrentUserPresetName());
          });
          

          Meat Beats: https://meatbeats.com
          Klippr Video: https://klippr.video

          1 Reply Last reply Reply Quote 1
          • dannytaurusD dannytaurus marked this topic as a question
          • dannytaurusD dannytaurus has marked this topic as solved
          • First post
            Last post

          17

          Online

          2.1k

          Users

          13.1k

          Topics

          113.8k

          Posts