Opening panel with a button doesn't work
-
Hello everyone. In my plugin I have 3 buttons. One button opens up ABOUT Panel, Second one closes it:
const var Button1 = Content.getComponent("Button1");
const var Button3 = Content.getComponent("Button3");
const var Panel1 = Content.getComponent("Panel1");inline function onButton1Control(component, value)
{
Panel1.showControl(1);
};
Content.getComponent("Button1").setControlCallback(onButton1Control);inline function onButton3Control(component, value)
{
Panel1.showControl(0);
};
Content.getComponent("Button3").setControlCallback(onButton3Control);Everything works completely fine here. But I also have a third button, that bypasses the plugin and shouldshow up a panel. But I need this panel to close after second tap on the button. I scripted this but it doesn't seem to work:
const var Button0 = Content.getComponent("Button0");
const var Panel2 = Content.getComponent("Panel2");inline function onButton0Control(component, value)
{
Panel2.showControl(value);
};
Content.getComponent("Button0").setControlCallback(onButton0Control); -
@jasonswann
try thisif (value) Panel2.set("visible", 1 );
-
I'm not actually sure why that code doesn't work, on first inspection it looks like it should.
When you have issues like this it helps to post a snippet, so we can see the project as you see it. Go to Export >> Export as HISE snippet, and paste the result in your post within code tags
Here's a version that works. Select it, copy it, in HISE go to File >> Import HISE snippet, or use the shortcut Ctrl+Shift+V.
HiseSnippet 1010.3ocsVs0aaaCElx1pcx8BVA5O.09vfCPPpcWWaAJRmSrS1LZShwbVvdn.szRTwDghTPhJ0dCCX+P6y648GXK6PRcy0xcoFq5ACetxuyG44PNNV3QRRDwHKmSWDQPV21dxBtb1fYXJGMZHx5t1GgSjjXWip8WDgSRH9HKql+fRgkSKj96u998wLL2iTpBgNSP8HulFRkkZG2+UTF6PrO4TZXEueR+QdB9.ASjB3oocWTD16B74jiwJ2ZXirtwA9ToHdhDKIIHqV6K7WLYl38bi+mQSnSYDkPOzDHQF0GJX9JDqzhFLix7GmW2IHHKiKYglFV391GQ8oE5KYiuVavsLhp7gUikgWykfWupvqaE3UCjrp.oVFHcO6IdwzHYoEEdtk8HNr4DfAZuJTL9hZ72MrGH.O3xcBwWPNLFDJhnyS61caW3msdQ61O5QOvcpju2TQprMrOjHKDc20MOImSj6wXCDgQBNHmz4g4N8l23+PUdBDwtcl6R4EguUam46jPjpbDKXCvL1TXisifm6QlEHbm1TNixItAobOIUvcWwqNd4q91tWhYojsZ+ascpcYMq6YJm.a6tqaQnJj5DwYZO2IA1ixy9CxieGJ2mL+jfx0aKHpeufoLzcIUYjWlqJHJMOY7PwREBqkWLlKIl54kk7pdho1hzXtnZx8IqXxEWasj6fdCG1xKwzwBI4DdG8JCY28iMEDTqsLbwHw0ZVMmH9SEXGdZ3TRb05V4Hz7rbGo856HqNvvyT0UbTvGwoxShH70MFAkQUP2ayLTA+Sp6cuaVu69oRofin9pF27yYcQZPq5ZQeVA1qHvFW6.MGXxCrbNM5mGMDKwpQOY0ATaQjXIUQaVCIWBywMChbrGRRtPJh.5r3LA7+qUoNubQeY+EUEjj4R80O.o6p8VQoeVou2ZS+oEo+Go9jZReqqEsslz2+c8qlKGSttS9.aLmvzopscdiS0LMrZlD8oRRX9cfN23eP+ZWkgRsOVo9JzGzpeO0WNCHGq+DDlQnmOSQUVsrPnKyOZqOVU.tatNvcKE3VoN+ifOE5PWsccnC8guQqtJDV8BM3pTgeJCKW99U0iJxL.s3Kcol5hKdBUtn5iN9e6R2qKDum8XpzaV8XrQMXDZp9RfwrmpbG6CBBHdxR.1x9ve4Ky6RP+Db1kxO+HrLlBGRrONMbBrq6QfUmCmjTiXgoQpP0xcUxJFXBg6qEtB9xL1SIakYrWtQTH1KV7VOy.M0ig9JsF.Sb86.cfGjBxt8VcJVH71r254sbpVIvGuoA9saZfOYSC761z.e5lF3y1z.e9+cfpmNuWpTDZZaPniFef9VGKqC3X3Dn9zJ5eATubKJE
-
@jasonswann why you don't use 1 button to open and close?
-
This post is deleted! -
HiseSnippet 4937.3oc6c07aajjcuojaYIYOyXGOHHerHf6bHPKvXNc8Y2cVj0z5qXkwxlqnFCOACfcKxVR85lcygroj0rX.laI.AAXCxbYus.4ef7mfOlCyg.j.rWxgI4PvdXOL6gfbbSU8GrqlrIYyOkjmlFvPcWe8pW8du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