필터 지우기
필터 지우기

check if user pressed the button "OK" in msgbox

조회 수: 23 (최근 30일)
Valmir Sadiku
Valmir Sadiku 2015년 11월 3일
답변: Valmir Sadiku 2015년 11월 3일
I want to show some message to the user and then check if he proceed with pressing button or if he closed the dialogue. e.g.:
uiwait(msgbox('Please press OK.','something'))
if(user pressed button to continue)
%%do something
else
%%process aborted due the user action (he closed the msgbox)
end
Do you have any idea how to get this?
Thank you in advance!
Best regards,
goldenEyes

채택된 답변

Valmir Sadiku
Valmir Sadiku 2015년 11월 3일
I solved it by using dialog and adding an callback to the button. Maybe not the simplest solution, but it is a solution which works for now :-) Anyway thank you TastyPastry!
bye

추가 답변 (1개)

TastyPastry
TastyPastry 2015년 11월 3일
Use questdlg instead.
h=questdlg('Please press OK','something','OK','OK');
switch h
case 'OK'
%'OK' code here
case ''
%abort code
otherwise
end

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by