I'm new here, new to CEGUI and also kinda new to programming as well. I know I should be starting with more basic stuff, but I've gotten my way around a few of the things I want to do with my project so I want to keep on doing it.
anyway, I got my gui on screen and now I want to have an event handler so that my buttons actually do something. therefore I need to create a new function, and here's where the problem kicks in.
the tutorial/snippet/whatever says I should add a new function by adding something like the following code:
Code: Select all
bool ButtonHandler(const CEGUI::EventArgs& e)
{
//Code you want Button1 to do
return true;
}
now if I do it that way then my function is isolated from everything else in my app, which means I have to make the function part of the app class, just like calling-the-mainmenu's function, which is
Code: Select all
void EliumApp::setupCEGUI()
{
... blah blah cegui init code ...
}
instead of just
Code: Select all
void setupCEGUI()
{
... blah blah cegui init code ...
}
(yes, EliumApp is my app)
therefore my new ButtonHandler function must start with:
Code: Select all
bool EliumApp::ButtonHandler(const CEGUI::EventArgs& e)
and as such, I must go back to the EliumApp class definition to add the definition of "ButtonHandler" on it
now here's where the real problem kicks in.
my SetupCEGUI function is defined like this:
Code: Select all
void setupCEGUI();
so I thought I could define ButtonHandler like that, but since it's got all that "const CEGUI::EventArgs& e" stuff on it, the definition won't work like:
Code: Select all
bool ButtonHandler();
so, anyone that can tell me the correct way to define my function?
I know this is just basic stuff I should know but I don't


thanks!