cegui Event handlers Not liking it it

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

danharibo
Just popping in
Just popping in
Posts: 12
Joined: Tue Sep 19, 2006 15:05

cegui Event handlers Not liking it it

Postby danharibo » Tue Sep 19, 2006 15:57

My code:
//Start a new game
wmgr.getWindow((CEGUI::utf8*)"Next")->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&sufApp::Setup_Physics_and_game, this));

Don't work to good,

handler
.\src\suf.cpp(140) : error C2661: 'CEGUI::SubscriberTemplate<Ret,Args>::SubscriberTemplate' : no overloaded function takes 2 arguments
with
[
Ret=bool,
Args=const CEGUI::EventArgs &
]


but just up a bit on the same file is a woring perfect event
anyhelp?

User avatar
spannerman
Home away from home
Home away from home
Posts: 330
Joined: Wed Jan 12, 2005 12:06

Postby spannerman » Tue Sep 19, 2006 17:13

Hi danharibo, please give some more details and state the problem clearly. It seems English isnt your first language, so dont worry about spelling and grammar, but your post doesnt make much sense as it is, so try answer these questions:

Don't work to good,


Please post exactly what it is your trying to do and whats happening.

handler


Did you mean to post the event handler, but forgot? This code (Setup_Physics_and_game), at least the method decleration, would be useful to see.

but just up a bit on the same file is a woring perfect event


I take it by "woring" you mean working. So are you saying here that you have another subscribed event in the same cpp file that is getting handled correctly?

danharibo
Just popping in
Just popping in
Posts: 12
Joined: Tue Sep 19, 2006 15:05

Postby danharibo » Tue Sep 19, 2006 17:26

English is my first language but my typing Sucs so here is What i meant:
I have an event handler That is supposed to Setup a button blah blah blah...
And this code here:

Code: Select all

void sufApp::setupEventHandlers2(void)
{
   CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
   //Start a new game
   wmgr.getWindow((CEGUI::utf8*)"Next")->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&sufApp::Setup_Physics_and_game, this));
 
}

Causes this error:
.\src\suf.cpp(140) : error C2661: 'CEGUI::SubscriberTemplate<Ret,Args>::SubscriberTemplate' : no overloaded function takes 2 arguments
with
[
Ret=bool,
Args=const CEGUI::EventArgs &
]

And Setup_physics_an...

Code: Select all

void sufApp::Setup_Physics_and_game()
{
   //Set the game mode
   gamemode = "IN_GAME";
   
   //Switch Mouse mode from CEGUI to OGRE
   switchMouseMode();
   
   //Destroy all GEGUI windows :)
   CEGUI::WindowManager::getSingleton().destroyAllWindows();
   
   //Player Collision blah blah blah
   player_coll = new OgreNewt::CollisionPrimitives::Capsule(mWorld ,Ogre::Real(2),Ogre::Real(4));
   player_out = new OgreNewt::Body(mWorld,player_coll);
   
   //Get CEGUI wmgr
   CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
   //create CEGUI Windows for CEGUI things
   CEGUI::Window* myRoot = wmgr.createWindow("DefaultWindow", "root");
   CEGUI::System::getSingleton().setGUISheet(myRoot);
}

That better? :)

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Tue Sep 19, 2006 17:58

Hi

As suggested by the error, this:

Code: Select all

void sufApp::Setup_Physics_and_game()


Needs to be

Code: Select all

bool sufApp::Setup_Physics_and_game(const CEGUI::EventArgs & args)


HTH

CE


Return to “Help”

Who is online

Users browsing this forum: Google [Bot] and 7 guests