My modal dialog box does not prevent interactions with a MATLAB app (made by App Designer) window

조회 수: 8 (최근 30일)
I have a custom app designed in App Designer, which is composed of one input box (accepting data) and a confirm button. Pushing the confirm button will execute a callback function, which will check whether the box is empty first:
function ConfirmButtonPushed(app, event)
if isempty(app.Databox.Value)
errordlg('No data supplied.', 'Input Error', 'modal');
return;
else
% Some actions to process the data
end
end
If the box is empty, the user is supposed to acknowledge the error message before going back to interact with the app again. However, the modal error dialog does not prevent interactions with the app window (It does prevent interactions with the main MATLAB command line window). Any clue?

채택된 답변

Geoff Hayes
Geoff Hayes 2019년 6월 25일
CreLox - try using uialert instead. This may work assuming that your app has been created with the uifigure function.
  댓글 수: 1
CreLox
CreLox 2019년 6월 25일
It worked. Thank you! The only issue with this workaround is that a uialert dialog window is nested inside the app window and seems to have a minimal width and height, which may not fit into the app window.

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by