2017-04-18 12:39:29 +02:00
|
|
|
# About advancedEventsExample
|
2016-02-19 10:33:25 -07:00
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
2017-04-18 12:39:29 +02:00
|
|
|
### Learning Objectives
|
2016-02-19 10:33:25 -07:00
|
|
|
|
|
|
|
|
This Example demonstrates how to create and use custom events.
|
|
|
|
|
|
|
|
|
|
After studying this example, you'll understand how to create an object to generate custom events.
|
|
|
|
|
|
2017-04-18 12:39:29 +02:00
|
|
|
|
|
|
|
|
In the code, pay attention to:
|
2016-02-19 10:33:25 -07:00
|
|
|
|
|
|
|
|
* OF classes and functions to create custom events:
|
|
|
|
|
* ```ofAddListener()```
|
|
|
|
|
* ```ofRemoveListener()```
|
|
|
|
|
* ```ofEvent```
|
|
|
|
|
* ```ofEvents()```
|
|
|
|
|
* ```ofNotifyEvent()```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Expected Behavior
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
When launching this app, you should see a screen with
|
|
|
|
|
|
2017-04-18 12:39:29 +02:00
|
|
|
* a text display "click to enable/disable events".
|
2016-02-19 10:33:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
Instructions for use:
|
|
|
|
|
|
|
|
|
|
* Click the mouse button to enable / disable the update function of newFloatEvent and newIntEvent, both instances of eventsObject.
|
|
|
|
|
|
|
|
|
|
|
2017-04-18 12:39:29 +02:00
|
|
|
### Other classes used in this file
|
|
|
|
|
|
|
|
|
|
* ```eventsObject```
|