I would like to increase the counter "test" by 1 each time I press the GUIButton, but the code below doesn't seem to work. Please help me fix this one, thank you in advance.
// control IDs
idMyButton = 2;
rc = GuiButton( "MyButton", idMyButton, 10, 20, 100, 20, notifyClicked );
test = 0;
code = GuiGetEvent(0, 0);
if (code == idMyButton){
test ++;
}
_TRACE(NumToStr(test, 1.0));
For example, when I clicked the button once, I got 1, if I click the button a second time, I want to see the counter test increase to 2, click one more time, I want to see the counter increase to 3, etc. Thanks.