From: Aleksandra on
Hi,
While sending notification to an object of another class, I also need to pass an aditional value to a callback method in that class. In order to do that, I've created a class ToPass as a subclass of event.EventData class where the value is stored, but it seems that the event object exists only when executing notify. Using debugg I can see that the value is passed to the event object, but when I try to execute the callback function, which accepts as inputs the object of the local class as well as src and evnt, the evnt object is empty, i.e. the property value is [], the source is '' and the EventName is ''. I also tried to initialize an object from the class ToPass, so it exists in the workspace, but then I need to assign the value to it mannualy in order to pass it as an argument in the callback function, which does not make sense.
the code is sth like this:

%in class 1
function Info(obj1, obj2)
....
notify(sourceobj, 'EventName', ToPass(oldval))
end

%in class 2
function ListenToTest(obj2, obj1)
obj2.lh = addlistener(obj1, 'EventName', @(src, evnt)Ans(obj2, src, evnt));
end

%the callback
function Ans(obj2, src, evnt)
......
end

Maybe the question is trivial, but I could use some help.
Thanks,
Aleksandra