User`s manual

Writing Event Handlers
7-9
function myclick(varargin)
disp('Single click function')
function my2click(varargin)
disp('Double click function')
function mymoused(varargin)
disp('You have reached the mouse down function')
disp('The X position is: ')
varargin(5)
disp('The Y position is: ')
varargin(6)
You can use the same event handler for all the events you want to monitor
using the cell array pairs. Response time will be better than using the callback
style.
For instance
h = actxcontrol('SELECTOR.SelectorCtrl.1', [0 0 200 200], f, ...
{'Click' 'allevents'; 'DblClick' 'allevents'; ...
'MouseDown' 'allevents'})
and allevents.m is
function allevents(varargin)
if (varargin{2} = -600)
disp ('Single Click Event Fired')
elseif (varargin{2} = -601)
disp ('Double Click Event Fired')
elseif (varargin{2} = -605)
disp ('Mousedown Event Fired')
end
Note MATLAB does not support event arguments passed by reference or
return values from events.