Hi,
I am trying to set initial value to checkbox without sending to me back a signal event. This is happening on initializing. It is important for me this two callbacks not to be triggered
in initializing progress. Only to set the visible part of checkbox (On/Off).
Now it is ok because i am using some booleans to avoid this.
This can be prevented by adding a "SetState(bool onOff)" function without triggering any callbacks in it.
pCheckBox = GAME_MANAGER->getGuiTheme()->load("CheckBox");
pCheckBox->setPosition(GAME_MANAGER->layoutWidth(450), GAME_MANAGER->layoutHeight(280));
pCheckBox->setSize(GAME_MANAGER->layoutWidth(100), GAME_MANAGER->layoutHeight(50));
pCheckBox->connect("Checked", [=]()
{
//do something here but only when user check this
});
pCheckBox->connect("Unchecked", [=]()
{
//do something here but only when user uncheck this
});
if (MEMORY_MANAGER->readDataBool(MemoryMain::checkBoxStatus))
pCheckBox->check();
else
pCheckBox->uncheck();
Also a general callback with the name "changed" it would be a good idea.
thank you