From: Jeremie on
Hello,

I'm trying to program in a GUI, a push button "modify ROI", which will allow me to select a contour among several others ones (all in the same axes).
So I set the mouse click to read the name of the contour and store it in a variable, the problem is although that the mouse click seems to really launch the command, the variable values never changes.

Here is a simplified version of the function.

function modROI_Callback(hObject, eventdata, handles)
set(h,'windowbuttondownfcn','linecapt=get(gco,''DisplayName'')');
linecapt='';
stopit=0;

while(stopit==0)
name=linecapt
if ~isempty(linecapt);
stopit=1;
end
end


Few remarks:
1- In debug mode, I can see that the command 'linecapt=get(gco,''DisplayName'')' is executed, but linecapt always remains empty. Only once I stop the debug mode, linecapt then change its value to the name of the contour I selected
2- If I copy-paste in the command window, the function seems to work.
3- I read several post about updating the handles in the GUI during the process, but it doesn't change anything, even if I try to store the variable in a variable handles.linecapt for example.

Anyone as already experienced the same?

Jeremei
 | 
Pages: 1
Prev: simulink / variables
Next: Bode phase plot