What about an anonymous function_
configureCallback(s, "terminator", @(src, evt) mycallback(src, evt, handles))
The ugly solution would be to store the handles persistently in the callback:
function mycallback(src, evt)
persistent handles
if nargin == 1
handles = src;
return;
end
...
end
Then call the callback after creating the handles:
This is prone to bugs, because you might forget to update the persistent data. The anonymous function is a more direct approach.
Best Answer