subscribeEvent error in compiling

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

darko
Just popping in
Just popping in
Posts: 4
Joined: Fri Feb 24, 2006 13:52
Contact:

subscribeEvent error in compiling

Postby darko » Fri Mar 24, 2006 22:49

Hi there,

I'm having a problem here:


Code: Select all

void Gui::setupEventHandlers()
{
CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
wmgr.getWindow((CEGUI::utf8*)"MenuLogin/Login")
         ->subscribeEvent(
            CEGUI::PushButton::EventClicked,
            CEGUI::Event::Subscriber(&Gui::doLogin, this));
}

void Gui::doLogin()
{
    System::log("Click!");
}


I got this error:

Code: Select all

src\Gui.cpp: In member function `void Gui::setupEventHandlers()':
src\Gui.cpp:71: error: no matching function for call to `CEGUI::SubscriberTemplate<bool, const CEGUI::EventArgs&>::SubscriberTemplate(void (Gui::*)(), Gui* const)'
c:/OgreSDK/include/CEGUI/CEGUIEvent.h:166: note: candidates are: CEGUI::SubscriberTemplate<Ret, Args>::SubscriberTemplate(const CEGUI::SubscriberTemplate<Ret, Args>&) [with Ret = bool, Args = const CEGUI::EventArgs&]
c:/OgreSDK/include/CEGUI/CEGUIEvent.h:163: note:                 CEGUI::SubscriberTemplate<Ret, Args>::SubscriberTemplate(CEGUI::SubscriberInterface<Ret, Args>*) [with Ret = bool, Args = const CEGUI::EventArgs&]
c:/OgreSDK/include/CEGUI/CEGUIEvent.h:140: note:                 CEGUI::SubscriberTemplate<Ret, Args>::SubscriberTemplate(Ret (*)(Args)) [with Ret = bool, Args = const CEGUI::EventArgs&]
Process terminated with status 1 (0 minutes, 12 seconds)


I'm not that monster of C++ and I don't know the templates objects, so... I really can't understand what's wrong with my code...

any idea? tnx

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Sat Mar 25, 2006 01:19

A callback function must currently be like this:

bool callback(const CEGUI::EventArgs&)

darko
Just popping in
Just popping in
Posts: 4
Joined: Fri Feb 24, 2006 13:52
Contact:

Postby darko » Sat Mar 25, 2006 10:07

:roll: what a shame... sorry, I was focusing on that function, without thinking at the called one. many thanks.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 19 guests