Why callback and enable off doesn't same time work?

조회 수: 1 (최근 30일)
Pan
Pan 2012년 8월 14일
I don't know a question.
The hp2 button callback function and the button isn't setting the button property 'enable' to 'off'.
For this:
function hp2_callback(hObject, eventdata)
set(hp2,'callback','f2');
set(hp2,'enable','off');
pause(2);
set(hp2,'enable','on');
end
This code works the 'enable off', not work in the callback 'f2'.
Why don't they both work??

답변 (1개)

Image Analyst
Image Analyst 2012년 8월 14일
편집: Image Analyst 2012년 8월 14일
I don't know. Can you post the code for your f2() function? And why isn't handles listed in your argument list? Are you using GUIDE or not? If so you'd need to use " handles.hp2" and not just "hp2".
  댓글 수: 1
Sean de Wolski
Sean de Wolski 2012년 8월 14일
The above would work if it was a nested function with hp2 defined - a very plausible non-GUIDE workflow.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by