One Click Button Instead of Two Clicks
-
I have created two buttons for my effects page.
However right now the buttons need to be pressed twice in order to open / close the window.
Thats because when you first click on a button it's considered 'on'. When its considered 'on' thats when the window opens up or closes. But when the user clicks again the button is considered 'off' and it dose nothing to the panel. So the user has to click again to get the button 'on' in order for the panel to close or open.
How can I make it so that the user only needs to click these buttons once to open or close instead of twice
///////////////EFFECTS WINDOW/////////// const var EFFECTS_Container = Content.addPanel("EFFECTS_Container", 0, 35); Content.setPropertiesFromJSON("EFFECTS_Container", { "width": 800, "textColour": "268435455", "borderSize": 1, "visible": false, "borderRadius": 0, }); ////EFFECTS OPENER BUTTON//// const var EFFECTS_Opener = Content.getComponent("EFFECTS_Opener"); inline function onEFFECTS_OpenerControl(component, value) { if (value) EFFECTS_Container.set("visible", true); }; Content.getComponent("EFFECTS_Opener").setControlCallback(onEFFECTS_OpenerControl); //// EFFECTS BROWSER CLOSE BUTTON /////// Content.getComponent("EFFECTS_Closer").setControlCallback(onEFFECTS_CloserControl); const var EFFECTS_Closer = Content.getComponent("EFFECTS_Closer"); inline function onEFFECTS_CloserControl(component, value) { if (value) EFFECTS_Container.set("visible", false); };
-
@kameron Make the button momentary
-
@kameron Please share a snippet instead of a chunk of code
Export -> Export as Hise Snippet
This is probably due to buttons not being set to momentary
-
@ustk ahh that's what I was doing wrong. I didn't set the buttons to isMomentary. That just fixed it. Thank you !