MATLAB Object-Oriented Programming

(Joyce) #1

NewState
end


methods
function data = ToggleEventData(newState)
data.NewState = newState;
end
end
end


The call to notify can use the ToggleEventData constructor to create the necessary
argument.


evtdata = ToggleEventData(newState);
notify(obj,'ToggledState',evtdata);


See Also


Related Examples



  • “Listener Callback Syntax” on page 11-30

  • “Listen for Changes to Property Values” on page 11-40

  • “Techniques for Using Events and Listeners” on page 11-50


See Also
Free download pdf