When you press button zero, you get an event from that button. The button stays pressed, though, and when you try to click it again, no event is fired.
So, click button one. You get an event from each button. One from button one because you pressed it, and one from button zero because it just became un-pressed. Now, one is pressed and you get no event from that one when clicking it. (some snippets of code below)
Any ideas?
Code: Select all
btnCancelMain = guienv->addButton(rect<s32>(x,y,x+w,y+h),
0,//parent
BTN_CANCEL_MAIN_MENU,//id
L"cancel");//text
//...
btnSave = guienv->addButton(rect<s32>(x,y,x+w,y+h),
0,//parent
BTN_SAVE_MAP,//id
L"save map");//text
Code: Select all
//from my event receiver
switch(id)
{
case Game::BTN_CANCEL_MAIN_MENU:
{
printf("close window\n");
game->showWindow(Game::WIN_MAIN_MENU,false);
game->btnCancelMain->setPressed(false);
break;
}
case Game::BTN_SAVE_MAP:
{
printf("save map\n");
game->btnSave->setPressed(false);
break;
}
}