0001 function test
0002
0003
0004
0005 fig = figure;
0006
0007
0008 set(fig,'WindowButtonDownFcn',{@wbd});
0009
0010
0011
0012
0013 function wbd(h,evd)
0014
0015 disp('down')
0016
0017
0018 props.WindowButtonMotionFcn = get(h,'WindowButtonMotionFcn');
0019 props.WindowButtonUpFcn = get(h,'WindowButtonUpFcn');
0020 setappdata(h,'TestGuiCallbacks',props);
0021
0022
0023
0024 set(h,'WindowButtonMotionFcn',{@wbm})
0025 set(h,'WindowButtonUpFcn',{@wbu})
0026
0027
0028
0029 function wbm(h,evd)
0030
0031
0032 disp('motion')
0033
0034
0035 function wbu(h,evd)
0036
0037
0038 disp('up')
0039
0040
0041 props = getappdata(h,'TestGuiCallbacks');
0042 set(h,props);