global functions
ofAddListener(...)
void ofAddListener(EventType &event, void (*)(const void *, ArgumentsType &) listenerFunction, int prio)
ofAddListener(...)
void ofAddListener(EventType &event, bool (*)(const void *, ArgumentsType &) listenerFunction, int prio)
ofAddListener(...)
void ofAddListener(EventType &event, ListenerClass *listener, bool (ListenerClass::*)(const void *, ArgumentsType &) listenerMethod, int prio)
Allows you to add a listener method to an event, use it whenever you want a class to be notified about an event.
This is a templated function so the types of the parameters are not predefined types but can be any type as long as the method is one of the listener class' and it has a particular signature.
The signature of the listener method depends on the event type. Every event is defined as:
ofEvent<type> event;
where type is the type of the parameter that is going to be passed when the event is notified. 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.
For instance, borrowing from the examples/events/SimpleEventsExample, if we make a class that will broadcast an event:
class SimpleEventNotifier {
ofEvent<float> notify; // will send an event with a float
void sendEvent() {
ofNotifyEvent(notify, ofGetElapsedTimef(), this);
}
};
We can listen for that in our ofApp:
SimpleEventNotifier notifier;
void ofApp::setup() {
ofAddListener(notifier.notify, this, &ofApp::haveBeenNotified);
}
void ofApp::haveBeenNotified(float &f){
ofLog() << " event at " << f << endl;
}
The general pattern is:
A notifying class that will notify defines an ofEvent. A listening class that will listen for that ofEvent calls ofAddListener() using the name of the event, the "this" keyword to refer to itself, and a pointer to the method that you want called when the event occurs The notifying class calls ofNotifyEvent() when it's time to send the event. The listening class has its notification method called with the parameters of the ofEvent passed to it.
This version of the method allows you to use the prio to set whether the event should be called before the application events (mouse and key events, for example) with OF_EVENT_ORDER_BEFORE_APP or after with OF_EVENT_ORDER_AFTER_APP.
ofAddListener(...)
void ofAddListener(EventType &event, ListenerClass *listener, void (ListenerClass::*)(const void *, ArgumentsType &) listenerMethod, int prio)
Allows you to add a listener method to an event, use it whenever you want a class to be notified about an event.
This is a templated function so the types of the parameters are not predefined types but can be any type as long as the method is one of the listener class' and it has a particular signature.
The signature of the listener method depends on the event type. Every event is defined as:
ofEvent<type> event;
where type is the type of the parameter that is going to be passed when the event is notified. 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.
For instance, borrowing from the examples/events/SimpleEventsExample, if we make a class that will broadcast an event:
class SimpleEventNotifier {
ofEvent<float> notify; // will send an event with a float
void sendEvent() {
ofNotifyEvent(notify, ofGetElapsedTimef(), this);
}
};
We can listen for that in our ofApp:
SimpleEventNotifier notifier;
void ofApp::setup() {
ofAddListener(notifier.notify, this, &ofApp::haveBeenNotified);
}
void ofApp::haveBeenNotified(float &f){
ofLog() << " event at " << f << endl;
}
The general pattern is:
A notifying class that will notify defines an ofEvent. A listening class that will listen for that ofEvent calls ofAddListener() using the name of the event, the "this" keyword to refer to itself, and a pointer to the method that you want called when the event occurs The notifying class calls ofNotifyEvent() when it's time to send the event. The listening class has its notification method called with the parameters of the ofEvent passed to it.
This version of the method allows you to use the prio to set whether the event should be called before the application events (mouse and key events, for example) with OF_EVENT_ORDER_BEFORE_APP or after with OF_EVENT_ORDER_AFTER_APP.
Documentation from code comments
register any method of any class to an event.
the method must provide one of the following signatures: void method(ArgumentsType & args) void method(const void * sender, ArgumentsType &args) ie: ofAddListener(addon.newIntEvent, this, &Class::method)
ofAddListener(...)
void ofAddListener(ofEvent< void > &event, ListenerClass *listener, bool (ListenerClass::*)() listenerMethod, int prio)
Allows you to add a listener method to an event, use it whenever you want a class to be notified about an event.
This is a templated function so the types of the parameters are not predefined types but can be any type as long as the method is one of the listener class' and it has a particular signature.
The signature of the listener method depends on the event type. Every event is defined as:
ofEvent<type> event;
where type is the type of the parameter that is going to be passed when the event is notified. 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.
For instance, borrowing from the examples/events/SimpleEventsExample, if we make a class that will broadcast an event:
class SimpleEventNotifier {
ofEvent<float> notify; // will send an event with a float
void sendEvent() {
ofNotifyEvent(notify, ofGetElapsedTimef(), this);
}
};
We can listen for that in our ofApp:
SimpleEventNotifier notifier;
void ofApp::setup() {
ofAddListener(notifier.notify, this, &ofApp::haveBeenNotified);
}
void ofApp::haveBeenNotified(float &f){
ofLog() << " event at " << f << endl;
}
The general pattern is:
A notifying class that will notify defines an ofEvent. A listening class that will listen for that ofEvent calls ofAddListener() using the name of the event, the "this" keyword to refer to itself, and a pointer to the method that you want called when the event occurs The notifying class calls ofNotifyEvent() when it's time to send the event. The listening class has its notification method called with the parameters of the ofEvent passed to it.
ofAddListener(...)
void ofAddListener(ofEvent< void > &event, ListenerClass *listener, bool (ListenerClass::*)(const void *) listenerMethod, int prio)
Allows you to add a listener method to an event, use it whenever you want a class to be notified about an event.
This is a templated function so the types of the parameters are not predefined types but can be any type as long as the method is one of the listener class' and it has a particular signature.
The signature of the listener method depends on the event type. Every event is defined as:
ofEvent<type> event;
where type is the type of the parameter that is going to be passed when the event is notified. 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.
For instance, borrowing from the examples/events/SimpleEventsExample, if we make a class that will broadcast an event:
class SimpleEventNotifier {
ofEvent<float> notify; // will send an event with a float
void sendEvent() {
ofNotifyEvent(notify, ofGetElapsedTimef(), this);
}
};
We can listen for that in our ofApp:
SimpleEventNotifier notifier;
void ofApp::setup() {
ofAddListener(notifier.notify, this, &ofApp::haveBeenNotified);
}
void ofApp::haveBeenNotified(float &f){
ofLog() << " event at " << f << endl;
}
The general pattern is:
A notifying class that will notify defines an ofEvent. A listening class that will listen for that ofEvent calls ofAddListener() using the name of the event, the "this" keyword to refer to itself, and a pointer to the method that you want called when the event occurs The notifying class calls ofNotifyEvent() when it's time to send the event. The listening class has its notification method called with the parameters of the ofEvent passed to it.
Note that the event is a reference, which means it needs to a member of your class that will not go away in the lifetime of the object.
This version of the method allows you to use the prio to set whether the event should be called before the application events (mouse and key events, for example) with OF_EVENT_ORDER_BEFORE_APP or after with OF_EVENT_ORDER_AFTER_APP.
ofAddListener(...)
void ofAddListener(EventType &event, ListenerClass *listener, bool (ListenerClass::*)(ArgumentsType &) listenerMethod, int prio)
Allows you to add a listener method to an event, use it whenever you want a class to be notified about an event.
This is a templated function so the types of the parameters are not predefined types but can be any type as long as the method is one of the listener class' and it has a particular signature.
The signature of the listener method depends on the event type. Every event is defined as:
ofEvent<type> event;
where type is the type of the parameter that is going to be passed when the event is notified. 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.
For instance, borrowing from the examples/events/SimpleEventsExample, if we make a class that will broadcast an event:
class SimpleEventNotifier {
ofEvent<float> notify; // will send an event with a float
void sendEvent() {
ofNotifyEvent(notify, ofGetElapsedTimef(), this);
}
};
We can listen for that in our ofApp:
SimpleEventNotifier notifier;
void ofApp::setup() {
ofAddListener(notifier.notify, this, &ofApp::haveBeenNotified);
}
void ofApp::haveBeenNotified(float &f){
ofLog() << " event at " << f << endl;
}
The general pattern is:
A notifying class that will notify defines an ofEvent. A listening class that will listen for that ofEvent calls ofAddListener() using the name of the event, the "this" keyword to refer to itself, and a pointer to the method that you want called when the event occurs The notifying class calls ofNotifyEvent() when it's time to send the event. The listening class has its notification method called with the parameters of the ofEvent passed to it.
This version of the method allows you to use the prio to set whether the event should be called before the application events (mouse and key events, for example) with OF_EVENT_ORDER_BEFORE_APP or after with OF_EVENT_ORDER_AFTER_APP.
ofAddListener(...)
void ofAddListener(ofEvent< void > &event, ListenerClass *listener, void (ListenerClass::*)() listenerMethod, int prio)
Allows you to add a listener method to an event, use it whenever you want a class to be notified about an event.
This is a templated function so the types of the parameters are not predefined types but can be any type as long as the method is one of the listener class' and it has a particular signature.
The signature of the listener method depends on the event type. Every event is defined as:
ofEvent<type> event;
where type is the type of the parameter that is going to be passed when the event is notified. 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.
For instance, borrowing from the examples/events/SimpleEventsExample, if we make a class that will broadcast an event:
class SimpleEventNotifier {
ofEvent<float> notify; // will send an event with a float
void sendEvent() {
ofNotifyEvent(notify, ofGetElapsedTimef(), this);
}
};
We can listen for that in our ofApp:
SimpleEventNotifier notifier;
void ofApp::setup() {
ofAddListener(notifier.notify, this, &ofApp::haveBeenNotified);
}
void ofApp::haveBeenNotified(float &f){
ofLog() << " event at " << f << endl;
}
The general pattern is:
A notifying class that will notify defines an ofEvent. A listening class that will listen for that ofEvent calls ofAddListener() using the name of the event, the "this" keyword to refer to itself, and a pointer to the method that you want called when the event occurs The notifying class calls ofNotifyEvent() when it's time to send the event. The listening class has its notification method called with the parameters of the ofEvent passed to it.
This version of the method allows you to use the prio to set whether the event should be called before the application events (mouse and key events, for example) with OF_EVENT_ORDER_BEFORE_APP or after with OF_EVENT_ORDER_AFTER_APP.
ofAddListener(...)
void ofAddListener(ofEvent< void > &event, ListenerClass *listener, void (ListenerClass::*)(const void *) listenerMethod, int prio)
Allows you to add a listener method to an event, use it whenever you want a class to be notified about an event.
This is a templated function so the types of the parameters are not predefined types but can be any type as long as the method is one of the listener class' and it has a particular signature.
The signature of the listener method depends on the event type. Every event is defined as:
ofEvent<type> event;
where type is the type of the parameter that is going to be passed when the event is notified. 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.
For instance, borrowing from the examples/events/SimpleEventsExample, if we make a class that will broadcast an event:
class SimpleEventNotifier {
ofEvent<float> notify; // will send an event with a float
void sendEvent() {
ofNotifyEvent(notify, ofGetElapsedTimef(), this);
}
};
We can listen for that in our ofApp:
SimpleEventNotifier notifier;
void ofApp::setup() {
ofAddListener(notifier.notify, this, &ofApp::haveBeenNotified);
}
void ofApp::haveBeenNotified(float &f){
ofLog() << " event at " << f << endl;
}
The general pattern is:
A notifying class that will notify defines an ofEvent. A listening class that will listen for that ofEvent calls ofAddListener() using the name of the event, the "this" keyword to refer to itself, and a pointer to the method that you want called when the event occurs The notifying class calls ofNotifyEvent() when it's time to send the event. The listening class has its notification method called with the parameters of the ofEvent passed to it.
This version of the method allows you to use the prio to set whether the event should be called before the application events (mouse and key events, for example) with OF_EVENT_ORDER_BEFORE_APP or after with OF_EVENT_ORDER_AFTER_APP.
ofAddListener(...)
void ofAddListener(EventType &event, ListenerClass *listener, void (ListenerClass::*)(ArgumentsType &) listenerMethod, int prio)
Allows you to add a listener method to an event, use it whenever you want a class to be notified about an event.
This is a templated function so the types of the parameters are not predefined types but can be any type as long as the method is one of the listener class' and it has a particular signature.
The signature of the listener method depends on the event type. Every event is defined as:
ofEvent<type> event;
where type is the type of the parameter that is going to be passed when the event is notified. 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.
For instance, borrowing from the examples/events/SimpleEventsExample, if we make a class that will broadcast an event:
class SimpleEventNotifier {
ofEvent<float> notify; // will send an event with a float
void sendEvent() {
ofNotifyEvent(notify, ofGetElapsedTimef(), this);
}
};
We can listen for that in our ofApp:
SimpleEventNotifier notifier;
void ofApp::setup() {
ofAddListener(notifier.notify, this, &ofApp::haveBeenNotified);
}
void ofApp::haveBeenNotified(float &f){
ofLog() << " event at " << f << endl;
}
The general pattern is:
A notifying class that will notify defines an ofEvent. A listening class that will listen for that ofEvent calls ofAddListener() using the name of the event, the "this" keyword to refer to itself, and a pointer to the method that you want called when the event occurs The notifying class calls ofNotifyEvent() when it's time to send the event. The listening class has its notification method called with the parameters of the ofEvent passed to it.
This version of the method allows you to use the prio to set whether the event should be called before the application events (mouse and key events, for example) with OF_EVENT_ORDER_BEFORE_APP or after with OF_EVENT_ORDER_AFTER_APP.
ofAddListener(...)
void ofAddListener(EventType &event, void (*)(ArgumentsType &) listenerFunction, int prio)
ofAddListener(...)
void ofAddListener(ofEvent< void > &event, void (*)(const void *) listenerFunction, int prio)
ofAddListener(...)
void ofAddListener(ofEvent< void > &event, void (*)() listenerFunction, int prio)
ofAddListener(...)
void ofAddListener(EventType &event, bool (*)(ArgumentsType &) listenerFunction, int prio)
ofAddListener(...)
void ofAddListener(ofEvent< void > &event, bool (*)(const void *) listenerFunction, int prio)
ofAddListener(...)
void ofAddListener(ofEvent< void > &event, bool (*)() listenerFunction, int prio)
ofNotifyEvent(...)
bool ofNotifyEvent(ofEvent< void > &event)
Notifies an event, what makes all it's registered method listeners to be called with the same argument.
This is a templated function so the type of the parameters is not predefined and can be anything as long as the listener methods use the same type for the parameter.
The arguments are passed to the listeners by reference so they can modify them.
The listener methods are called in the same order they were registered using ofAddListener.
For instance, borrowing from the examples/events/SimpleEventsExample, if we make a class that will broadcast an event:
class SimpleEventNotifier {
ofEvent<float> notify; // will send an event with a float
void sendEvent() {
ofNotifyEvent(notify, ofGetElapsedTimef(), this);
}
};
We can listen for that in our ofApp:
SimpleEventNotifier notifier;
void ofApp::setup() {
ofAddListener(notifier.notify, this, &ofApp::haveBeenNotified);
}
void ofApp::haveBeenNotified(float &f){
ofLog() << " event at " << f << endl;
}
ofNotifyEvent(...)
bool ofNotifyEvent(EventType &event, const ArgumentsType &args)
Notifies an event, what makes all it's registered method listeners to be called with the same argument.
This is a templated function so the type of the parameters is not predefined and can be anything as long as the listener methods use the same type for the parameter.
The arguments are passed to the listeners by reference so they can modify them.
The listener methods are called in the same order they were registered using ofAddListener.
With this version the listeners also receive a pointer to the notifying class in case the listener method specifies that parameter.
For instance, borrowing from the examples/events/SimpleEventsExample, if we make a class that will broadcast an event:
class SimpleEventNotifier {
ofEvent<float> notify; // will send an event with a float
void sendEvent() {
ofNotifyEvent(notify, ofGetElapsedTimef(), this);
}
};
We can listen for that in our ofApp:
SimpleEventNotifier notifier;
void ofApp::setup() {
ofAddListener(notifier.notify, this, &ofApp::haveBeenNotified);
}
void ofApp::haveBeenNotified(float &f){
ofLog() << " event at " << f << endl;
}
ofNotifyEvent(...)
bool ofNotifyEvent(EventType &event, ArgumentsType &args)
Notifies an event, what makes all it's registered method listeners to be called with the same argument.
This is a templated function so the type of the parameters is not predefined and can be anything as long as the listener methods use the same type for the parameter.
The arguments are passed to the listeners by reference so they can modify them.
The listener methods are called in the same order they were registered using ofAddListener.
With this version the listeners also receive a pointer to the notifying class in case the listener method specifies that parameter.
For instance, borrowing from the examples/events/SimpleEventsExample, if we make a class that will broadcast an event:
class SimpleEventNotifier {
ofEvent<float> notify; // will send an event with a float
void sendEvent() {
ofNotifyEvent(notify, ofGetElapsedTimef(), this);
}
};
We can listen for that in our ofApp:
SimpleEventNotifier notifier;
void ofApp::setup() {
ofAddListener(notifier.notify, this, &ofApp::haveBeenNotified);
}
void ofApp::haveBeenNotified(float &f){
ofLog() << " event at " << f << endl;
}
ofNotifyEvent(...)
bool ofNotifyEvent(EventType &event, const ArgumentsType &args, SenderType *sender)
Notifies an event, what makes all it's registered method listeners to be called with the same argument.
This is a templated function so the type of the parameters is not predefined and can be anything as long as the listener methods use the same type for the parameter.
The arguments are passed to the listeners by reference so they can modify them.
The listener methods are called in the same order they were registered using ofAddListener.
With this version the listeners also receive an event args object that can be used to send additional data to the listening class.
For instance, borrowing from the examples/events/SimpleEventsExample, if we make a class that will broadcast an event:
class SimpleEventNotifier {
ofEvent<float> notify; // will send an event with a float
void sendEvent() {
ofNotifyEvent(notify, ofGetElapsedTimef());
}
};
We can listen for that in our ofApp:
SimpleEventNotifier notifier;
void ofApp::setup() {
ofAddListener(notifier.notify, this, &ofApp::haveBeenNotified);
}
void ofApp::haveBeenNotified(float &f){
ofLog() << " event at " << f << endl;
}
ofNotifyEvent(...)
bool ofNotifyEvent(EventType &event, ArgumentsType &args, SenderType *sender)
Notifies an event, what makes all it's registered method listeners to be called with the same argument.
This is a templated function so the type of the parameters is not predefined and can be anything as long as the listener methods use the same type for the parameter.
The arguments are passed to the listeners by reference so they can modify them.
The listener methods are called in the same order they were registered using ofAddListener.
For instance, borrowing from the examples/events/SimpleEventsExample, if we make a class that will broadcast an event:
class SimpleEventNotifier {
ofEvent notify; // will send an event with no data
void sendEvent() {
ofNotifyEvent(notify);
}
};
We can listen for that in our ofApp:
SimpleEventNotifier notifier;
void ofApp::setup() {
ofAddListener(notifier.notify, this, &ofApp::haveBeenNotified);
}
void ofApp::haveBeenNotified(){
ofLog() << " event at " << ofGetElapsedTimef() << endl;
}
Documentation from code comments
notifies an event so all the registered listeners get called
ie: ofNotifyEvent(addon.newIntEvent, intArgument, this)
or in case there's no sender: ofNotifyEvent(addon.newIntEvent, intArgument)
@returns: true in case any listener attended the event
ofNotifyEvent(...)
bool ofNotifyEvent(ofEvent< void > &event, SenderType *sender)
Notifies an event, what makes all it's registered method listeners to be called with the same argument.
This is a templated function so the type of the parameters is not predefined and can be anything as long as the listener methods use the same type for the parameter.
The arguments are passed to the listeners by reference so they can modify them.
The listener methods are called in the same order they were registered using ofAddListener.
With this version the listeners also receive a pointer to the notifying class in case the listener method specifies that parameter.
For instance, borrowing from the examples/events/SimpleEventsExample, if we make a class that will broadcast an event:
class SimpleEventNotifier {
ofEvent<float> notify; // will send an event with a float
void sendEvent() {
ofNotifyEvent(notify, ofGetElapsedTimef(), this);
}
};
We can listen for that in our ofApp:
SimpleEventNotifier notifier;
void ofApp::setup() {
ofAddListener(notifier.notify, this, &ofApp::haveBeenNotified);
}
void ofApp::haveBeenNotified(float &f){
ofLog() << " event at " << f << endl;
}
ofRemoveListener(...)
void ofRemoveListener(EventType &event, void (*)(const void *, ArgumentsType &) listenerFunction, int prio)
ofRemoveListener(...)
void ofRemoveListener(EventType &event, bool (*)(const void *, ArgumentsType &) listenerFunction, int prio)
ofRemoveListener(...)
void ofRemoveListener(EventType &event, ListenerClass *listener, bool (ListenerClass::*)(const void *, ArgumentsType &) listenerMethod, int prio)
Removes a listener method from an event. Use it whenever you want a class to stop being notified about an event after having registered it to the method with ofAddListener.
Don't forget to call this before deleting any instance that is listening to an event, if not the event will try to notify a non existent instance and the application will crash.
The syntax is just the same as that of ofAddListener.
ofRemoveListener(...)
void ofRemoveListener(EventType &event, ListenerClass *listener, void (ListenerClass::*)(const void *, ArgumentsType &) listenerMethod, int prio)
Removes a listener method from an event. Use it whenever you want a class to stop being notified about an event after having registered it to the method with ofAddListener.
Don't forget to call this before deleting any instance that is listening to an event, if not the event will try to notify a non existent instance and the application will crash.
The syntax is just the same as that of ofAddListener.
Documentation from code comments
unregister any method of any class to an event.
the method must provide one the following signatures: void method(ArgumentsType & args) void method(const void * sender, ArgumentsType &args) ie: ofAddListener(addon.newIntEvent, this, &Class::method)
ofRemoveListener(...)
void ofRemoveListener(ofEvent< void > &event, ListenerClass *listener, bool (ListenerClass::*)() listenerMethod, int prio)
Removes a listener method from an event. Use it whenever you want a class to stop being notified about an event after having registered it to the method with ofAddListener.
Don't forget to call this before deleting any instance that is listening to an event, if not the event will try to notify a non existent instance and the application will crash.
The syntax is just the same as that of ofAddListener.
ofRemoveListener(...)
void ofRemoveListener(ofEvent< void > &event, ListenerClass *listener, bool (ListenerClass::*)(const void *) listenerMethod, int prio)
Removes a listener method from an event. Use it whenever you want a class to stop being notified about an event after having registered it to the method with ofAddListener.
Don't forget to call this before deleting any instance that is listening to an event, if not the event will try to notify a non existent instance and the application will crash.
The syntax is just the same as that of ofAddListener.
ofRemoveListener(...)
void ofRemoveListener(EventType &event, ListenerClass *listener, bool (ListenerClass::*)(ArgumentsType &) listenerMethod, int prio)
Removes a listener method from an event. Use it whenever you want a class to stop being notified about an event after having registered it to the method with ofAddListener.
Don't forget to call this before deleting any instance that is listening to an event, if not the event will try to notify a non existent instance and the application will crash.
The syntax is just the same as that of ofAddListener.
ofRemoveListener(...)
void ofRemoveListener(ofEvent< void > &event, ListenerClass *listener, void (ListenerClass::*)() listenerMethod, int prio)
Removes a listener method from an event. Use it whenever you want a class to stop being notified about an event after having registered it to the method with ofAddListener.
Don't forget to call this before deleting any instance that is listening to an event, if not the event will try to notify a non existent instance and the application will crash.
The syntax is just the same as that of ofAddListener.
ofRemoveListener(...)
void ofRemoveListener(ofEvent< void > &event, ListenerClass *listener, void (ListenerClass::*)(const void *) listenerMethod, int prio)
Removes a listener method from an event. Use it whenever you want a class to stop being notified about an event after having registered it to the method with ofAddListener.
Don't forget to call this before deleting any instance that is listening to an event, if not the event will try to notify a non existent instance and the application will crash.
The syntax is just the same as that of ofAddListener.
ofRemoveListener(...)
void ofRemoveListener(EventType &event, ListenerClass *listener, void (ListenerClass::*)(ArgumentsType &) listenerMethod, int prio)
Removes a listener method from an event. Use it whenever you want a class to stop being notified about an event after having registered it to the method with ofAddListener.
Don't forget to call this before deleting any instance that is listening to an event, if not the event will try to notify a non existent instance and the application will crash.
The syntax is just the same as that of ofAddListener.
ofRemoveListener(...)
void ofRemoveListener(EventType &event, void (*)(ArgumentsType &) listenerFunction, int prio)
ofRemoveListener(...)
void ofRemoveListener(ofEvent< void > &event, void (*)(const void *) listenerFunction, int prio)
ofRemoveListener(...)
void ofRemoveListener(ofEvent< void > &event, void (*)() listenerFunction, int prio)
ofRemoveListener(...)
void ofRemoveListener(EventType &event, bool (*)(ArgumentsType &) listenerFunction, int prio)
ofRemoveListener(...)
void ofRemoveListener(ofEvent< void > &event, bool (*)(const void *) listenerFunction, int prio)
ofRemoveListener(...)
void ofRemoveListener(ofEvent< void > &event, bool (*)() listenerFunction, int prio)
Last updated 화요일, 19 11월 2024 17:25:54 UTC - 2537ee49f6d46d5fe98e408849448314fd1f180e
If you have any doubt about the usage of this module you can ask in the forum.
If you want to contribute better documentation or start documenting this section you can do so here
If you find anything wrong with this docs you can report any error by opening an issue