필터 지우기
필터 지우기

Force quiet a callback function on Appdesigner?

조회 수: 1 (최근 30일)
Faez Alkadi
Faez Alkadi 2021년 11월 17일
댓글: Faez Alkadi 2021년 11월 18일
I am using Matlab Appdesigner and want to be able to force quiet any callback function and any subfunction with in that callback function. I added a push button to my app named Cancel and put the following code with in the sub-function of the Excute callback function to stop it when I press cancel. However it takes time to quit the excustion of the callback function (Excute) because it doesn't start quiting untill it reaches out to the line where this code is at in the sub-function.
%Check for Cancel button press
if app.CancelButton.Value == true
app.CancelButton.Value = false; % To reactive the stop button
return
end
Is there any way to add a Canceling pushbutton to the app which overwrite everything as Ctrl-C does in the Command window?
  댓글 수: 8
Rik
Rik 2021년 11월 18일
I never use AppDesigner or timer objects myself either. What code did you try?
Faez Alkadi
Faez Alkadi 2021년 11월 18일
I actually still don't know how to start with timer object. However, I used uiconfirm now but still works as my previous code since it need to wait for the excution to reach the line in the subfunction where app.CancelButton.Value is checked.
app.CancelButton.Value = false;
selection = uiconfirm(app.UIFigure,'Cancel?',...
'Confirm Cancelling');
switch selection
case 'OK'
app.CancelButton.Value = true;
return
case 'Cancel'
app.CancelButton.Value = false;
end

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by