[SOLVED] Problem subscribing to events

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

User avatar
sipickles
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Fri Feb 24, 2006 19:41
Location: Enfield, UK

[SOLVED] Problem subscribing to events

Postby sipickles » Sun Jul 13, 2008 15:26

Hello,

I have two questions. Firstly, a weird error. I cannot see anything wrong with this code:

Code: Select all

void CGUI::Bind( const std::string& name )
{
      CEGUI::Window* w = m_windowManager->getWindow( name );
      w->subscribeEvent( CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&CGUI::SendGUIEvent, this));
}



but it gives me this error:

Code: Select all

error C2661: 'CEGUI::SubscriberSlot::SubscriberSlot' : no overloaded function takes 2 arguments



Secondly, assuming I can get this working, how can I send arguments with the event?

Maybe an ID of the triggering window?

Thanks

Simon

EDIT -- I've tried it with the BIND_CEGUI_EVENT macro too, same problem.

EDIT -- I thought I had found the prob when I noticed my callback function didn't have CEGUI::EventArgs as its arguments. No change in the compile problem, although I guess that answers my second question a little


-------

SOLVED

I forgot I hadn't matched the function signature exactly. My callback (SendGUIEvent) was void(EventArgs*) not bool(EventArgs*)

oops!

:hammer:

Return to “Help”

Who is online

Users browsing this forum: No registered users and 3 guests