Hello,
So there is my question: I want to put all ofxToggle at false except the one with the name I send.
The toggles are stored in a group and I keep all the name of the toggle in a vector to iterate on them after:
ofxPanel *gui;
ofParameterGroup toggles;
std::string groupName;
std::vector<std::string> names;
void toggle(std::string name)
{
for (std::string _name : names)
{
std::cout << _name << " " << name << std::endl;
if (_name != name)
{
gui->getGroup(groupName).getToggle(name) = false;
}
}
}
And I call this from an Event function that is trigerred when a value from the group changed:
void changeState(ofAbstractParameter &e)
{
ofParameter<bool> toggle = e.cast<bool>();
if (toggle == true)
{
toggle(toggle.getName());
}
else
{
toggle = true;
}
}
But the problem is that no changes are done…
If you could please help me understand what I’m doing wrong here…