Home > helper > test.m

test

PURPOSE ^

test gui function

SYNOPSIS ^

function test

DESCRIPTION ^

 test gui function

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function test
0002 % test gui function
0003 
0004 % create figure
0005 fig = figure;
0006 
0007 % set the figure's WindowButtonDownFcn
0008 set(fig,'WindowButtonDownFcn',{@wbd});
0009 
0010 
0011 
0012 % ---------------------------
0013 function wbd(h,evd)
0014 
0015 disp('down')
0016 
0017 % get the values and store them in the figure's appdata
0018 props.WindowButtonMotionFcn = get(h,'WindowButtonMotionFcn');
0019 props.WindowButtonUpFcn = get(h,'WindowButtonUpFcn');
0020 setappdata(h,'TestGuiCallbacks',props);
0021 
0022 % set the new values for the WindowButtonMotionFcn and
0023 % WindowButtonUpFcn
0024 set(h,'WindowButtonMotionFcn',{@wbm})
0025 set(h,'WindowButtonUpFcn',{@wbu})
0026 
0027 
0028 % ---------------------------
0029 function wbm(h,evd)
0030 % executes while the mouse moves
0031 
0032 disp('motion')
0033 
0034 % ---------------------------
0035 function wbu(h,evd)
0036 % executes when the mouse button is released
0037 
0038 disp('up')
0039 
0040 % get the properties and restore them
0041 props = getappdata(h,'TestGuiCallbacks');
0042 set(h,props);

Generated on Thu 17-Mar-2011 14:45:51 by m2html © 2005