|
| I am still on the learning curve in Matlab and hope to get some
advice. I am creating a GUI with one axes. Clicking on the one point
in the axes, I wish to drag it to other position. But when I clicked
on that point, I got "Error in custom datatip string function". The
point could not be dragged.
Below is a short version of the code:
% --- Executes on button press in click_drag.
function click_drag_Callback(hObject, eventdata, handles)
if get(hObject,'Value')==0
set(handles.fig_live,'WindowButtonDownFcn',{@wbd});
end
function wbd(h,evd)
props.WindowsButtonMotionFcn = get(h,'WindowButtonMotionFcn');
props.WindowButtonUpFcn = get(h,'WindowButtonUpFcn');
setappdata(h,'GuiCallbacks',props);
% set the new values for the WindowButtonMotionFcn and
% WindowButtonUpFcn
set(h,'WindowButtonMotionFcn',{@wbm})
set(h,'WindowButtonUpFcn',{@wbu})
function wbm(h,evd)
set(h.axes3,'XLim',[-2 2],'YLim',[-2 2]);
[x,y]=ginput(2)
function wbu(h,evd)
props = getappdata(h,'GuiCallbacks');
set(h,props);
|
|