Ok. Breaking down your code
Code:
//This is a switch statement, which means that it runs which ever bit of code matches the Widget name.
//If it doesnt find one that matches, it runs the default code;
switch(WidgetName)
{
case ('SecretBaseButton'):
SecretBaseButton = GFxClikWidget(Widget);
SecretBaseButton.AddEventListener('CLIK_press', OnSecretBasebuttonPress);
break;
default:
break;
}
// This line exits the function - THIS IS YOUR PROBLEM
return true;
//This is a switch statement, which means that it runs which ever bit of code matches the Widget name.
//If it doesnt find one that matches, it runs the default code;
switch(WidgetName)
{
case ('ExitButton'):
ExitButton = GFxClikWidget(Widget);
ExitButton.AddEventListener('CLIK_press', OnExitButtonPress);
break;
default:
break;
}
// This line exits the function
return true;
Hopefully you can see now that the reason your code only runs the map loading command (because you have a return true command after the first switch).
Removing it will make your code run correctly, but you've still missed the point of the switch statement. Heres how it should be written -
Code:
//This is a switch statement, which means that it runs which ever bit of code matches the Widget name.
//If it doesnt find one that matches, it runs the default code;
switch(WidgetName)
{
case ('SecretBaseButton'):
SecretBaseButton = GFxClikWidget(Widget);
SecretBaseButton.AddEventListener('CLIK_press', OnSecretBasebuttonPress);
break;
case ('ExitButton'):
ExitButton = GFxClikWidget(Widget);
ExitButton.AddEventListener('CLIK_press', OnExitButtonPress);
break;
default:
break;
}
// This line exits the function
return true;
Bookmarks