Page 1 of 1

[Solved]Subscribing to Events - Compile Error

Posted: Sat Sep 02, 2006 16:35
by Das Gurke
Uuuh, this seems to be very basic ... But neither the Ogre Tutorial, the CEGUI Tutorial nor the forum search could help me :(

I tried these to versions to subscribe to an event

Code: Select all

   mButtonQuit->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GsLogin::reactButtonQuit, this));
    //-------------------
   CEGUI::WindowManager& winMgr = CEGUI::WindowManager::getSingleton();
   CEGUI::Window* window = winMgr.getWindow("Root/ButtonQuit");
   window->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GsLogin::reactButtonQuit, this));
   

The first one I found somewhere searching the forums, the second one is taken from the Ogre CeGUI Tutorials. Sadly, they both give me the following error

Code: Select all

error C2661: 'CEGUI::SubscriberTemplate<Ret,Args>::SubscriberTemplate' : no overloaded function takes 2 arguments
        with
        [
            Ret=bool,
            Args=const CEGUI::EventArgs &
        ]
And as usual, I don't see anything because I have never createad anything template based myself :(

So maybe anyone can point me out?

Some Specs
Visual Studio 8 Express Edition
Ogre 1.22 (Dagon) and the CEGUI Version shipped with that
Anything more you guys need? Just let me know =)

Posted: Sat Sep 02, 2006 19:09
by Das Gurke
Dough ... The function to be called was the error :oops: Should have been

Code: Select all

bool GsLogin::reactButtonQuit(const CEGUI::EventArgs& e)
And was

Code: Select all

void GsLogin::reactButtonQuit(const CEGUI::EventArgs& e)