dariosaquetti Posted April 16, 2023 Share Posted April 16, 2023 (edited) Hello All I am trying to create 3 toggles, A,B,C and when A is on it turns the others off. B on the rest off, C on the rest off. I wrote this code, but somehow it isn't working fully. Just works when I click on A, it deactivates the rest, but not on B or C. Not sure why it isn't working . I'd be grateful if you can help. I am far of being the best coder. Thanks! int toggleA = chi("ToggleA"); int toggleB = chi("ToggleB"); int toggleC = chi("ToggleC"); if (toggleA == 1) { toggleB = 0; toggleC = 0; } else if (toggleB == 1) { toggleA = 0; toggleC = 0; } else if (toggleC == 1) { toggleA = 0; toggleB = 0; } setattrib(0,"detail","toggleA", 0, 0, toggleA ); setattrib(0,"detail","toggleB", 0, 0, toggleB ); setattrib(0,"detail","toggleC", 0, 0, toggleC ); Edited April 16, 2023 by dariosaquetti Quote Link to comment Share on other sites More sharing options...
Alain2131 Posted April 16, 2023 Share Posted April 16, 2023 (edited) Hey, what you want is a mutually exclusive button strip. https://www.sidefx.com/docs/houdini/ref/windows/optype.html#parmtypes If you really need separate buttons for your UI, that would still be possible. I would try using the Callback Script to disable the other buttons. Edited April 16, 2023 by Alain2131 1 Quote Link to comment Share on other sites More sharing options...
dariosaquetti Posted April 16, 2023 Author Share Posted April 16, 2023 Thanks. I think the button strip would be sufficient for now, using a switcher. I'd probably implement a more elegant solution, with a call back script if I could. Cheers! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.