how to ensure that a functions has finished GUI

조회 수: 3 (최근 30일)
Symeon Mattes
Symeon Mattes 2012년 8월 14일
Hi, I have the an issue on my GUI environment with a a slider (e.g. slider_myslider), which calls a callback function everytime is being moved, e.g.
function slider_myslider_Callback(hObject,eventdata,handles)
disp('start');
myfunction()
disp('stop');
end
function myFunction()
disp('myFunction');
"wait 10sec"
end
Every time I move the silder the above callback functions is called. I press it two time what I'm going to get is:
start
start
stop
stop
However what I would like to have is
start
myFunction
stop
start
myFunction
stop
At the beginning I thought it had to do with multithreading, however I think it has to do with the fact that the call of myFunction is not asynchronous. Any suggestions?

채택된 답변

Symeon Mattes
Symeon Mattes 2012년 8월 14일
Actually it wasn't BusyAction, but you helped me to check it further. BusyAction was already 'queue'. I had to change Interruptible to 'off'.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2012년 8월 14일
Set the BusyAction of the slider to 'queue'

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by