For Programmers: Free Programming Magazines  


Home > Archive > Matlab > February 2007 > Error in datatip









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Error in datatip
Nutre

2007-02-28, 7:14 pm

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);
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com