MATLAB: ButtonDownFcn on ActXControl video element

actxcontrolbuttondownfcnguideMATLABMATLAB Compiler

Hi,
at first, I wanted to create ActXControl video element using GUIDE. There ButtonDownFcn could be easily created. But when I compiled the code to exe file, there was always an error at the begining of the program concerning this video element.
So I decided to create the video window in the code by calling actxcontrol and defining size of the element. Is there any difference in these two solutions? At lease this one does not cause error after compilation. But how can I create ButtonDownFcn on this element?
Thanks for help, Filip

Best Answer

Hi,
you have to use registerevent:
%http://www.mathworks.com/help/matlab/matlab_external/using-events.html#f90131
function test
f = figure('position',[30 30 500 500]);
a = actxcontrol('Sysmon.3',[10 10 400 400], f);
a.events
a.registerevent({'OnDblClick',@mycb});
end
function mycb(varargin)
celldisp(varargin)
end
Related Question