views:

18

answers:

1

Hello all,

I'm having some problems with OpenFrameworks Event system, which is based on POCO's.

I'm registering an event with ofNotifyEvent(ofEvent event) and definining the event listener with ofAddListener(ofEvent event,ListenerClass instance, ListenerMethod method)

The class I'm registering as listener is never called when ofNotifyEvent is called. I've debugged my application and so far I have not found why this is happening.

If someone has an idea or any question I will elaborate. My only experience with Events is with ActionScript 3's event system.

Thanks.

A: 

Since you haven't posted any code I can only guess. From the documentation of ofAddListener:

The listener method can have one of this two signatures:

void listenerMethod(type & parameter);

void listenerMethod(const void * sender, type parameter);

Where type must be the same as that of the event it listens to, and sender will be a pointer to the notifying class.

Maybe your parameter type is wrong or your registered sender is not correct. I suggest that you check this first.

razong
It was the registered sender. Thanks for your help.
dornad