MATLAB Object-Oriented Programming

(Joyce) #1

  • Source — Handle or array of handles of the object that generated the event

  • EventName — Name of the event

  • Callback — Function to execute when an enabled listener receives event notification

  • Enabled — Callback function executes only when Enabled is true. See “Enable and
    Disable Listeners” on page 11-63 for an example.

  • Recursive — Allow listener to trigger the same event that caused execution of the
    callback.


Recursive is false by default. If the callback triggers the event for which it is
defined as the callback, the listener cannot execute recursively. Therefore, set
Recursive to false if the callback must trigger its own event. Setting the
Recursive property to true can create a situation where infinite recursion reaches
the recursion limit and triggers an error.

“Control Listener Lifecycle” on page 11-28 provides more specific information.

11 Events — Sending and Responding to Messages

Free download pdf