OpenFrameworks/POCO 事件未被监听?
我在使用基于 POCO 的 OpenFrameworks 事件系统时遇到一些问题。
我正在使用 ofNotifyEvent(ofEvent event) 注册一个事件,并使用 ofAddListener(ofEvent event,ListenerClass instance, ListenerMethod method) 定义事件侦听器。
调用 ofNotifyEvent 时,我注册为侦听器的类永远不会被调用。我已经调试了我的应用程序,到目前为止我还没有找到为什么会发生这种情况。
如果有人有想法或有任何问题,我会详细说明。我对事件的唯一体验是使用 ActionScript 3 的事件系统。
谢谢。
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.
由于您没有发布任何代码,我只能猜测。来自
ofAddListener
的文档:可能是您的参数类型错误或者您注册的发件人不正确。我建议
你先检查一下。
Since you haven't posted any code I can only guess. From the documentation of
ofAddListener
:Maybe your parameter type is wrong or your registered sender is not correct. I suggest
that you check this first.