Toggle buttons

Following this tutorial to implement toggle buttons,
https://docs.juce.com/master/tutorial_radio_buttons_checkboxes.html

Only situation I’m not able to achieve is when both Sport and Art are selected and then have condition for that status.
but when checking on button status to add a function there, it’s never sport and Art button status is true , in other words, never satisfying the condition (sportStatus == true && artStatus == true)
how to achieve this?

Any suggestion/ help is appreciated! TIA!

@daniel back. Lost the server while updating

Sorry, I deleted my message, since I didn’t really check the context…

But in general to check the toggle state, use getToggleState(). Don’t get confused with getState(), which is more about representation (hover etc).

Buttons will only toggle, if you set setClickingTogglesState(true).

The tutorial does also some manual things which are rather confusing than helping IMHO.

@daniel That’s right, I’m checking the button set by getToggleState(), but when sport is selected and then you select art, (sportStatus == true && artStatus == true) this condition should be satisfied right?
that doesn’t. or it needs to have both buttons selected at once…?

I am weary of the updateState() lambda. I would get rid of it. It should work better without (unless I misunderstand the intention of the tutorial).

@daniel not sure if I’m following, I guess the condition or situation I mentioned is not in the tutorial, but that something similar I’m looking to implement

Could you share the actual code you’ve written that’s not working for you? There’s 1000 things that could lead to incorrect behaviour without actually seeing the code.