필터 지우기
필터 지우기

Close uialert - App designer

조회 수: 16 (최근 30일)
Ali razi
Ali razi 2022년 3월 10일
댓글: Walter Roberson 2022년 3월 12일
In App designer I have a function called
DayButtonPushed(app, event)
With the following code:
aFig = uifigure;
message = sprintf('March \n\nYear 2022');
uialert(aFig,message,'Info','Icon','info');
When I press the OK it does not close the background window. Therefore, how can I close all upon pressing ok (image attached)?

답변 (1개)

Walter Roberson
Walter Roberson 2022년 3월 10일
Why create a uifigure() there? uialert() will create its own uifigure()
  댓글 수: 6
Simon Chan
Simon Chan 2022년 3월 12일
Add a CloseFcn may be a workaround if you don't want to use the uifigure anymore.
aFig = uifigure;
message = sprintf('March \n\nYear 2022');
uialert(aFig,message,'Info','Icon','info','CloseFcn',{@closefig,aFig});
function closefig(src,event,aFig)
delete(aFig)
end
Walter Roberson
Walter Roberson 2022년 3월 12일
@Simon Chan That's a good idea.

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

카테고리

Help CenterFile Exchange에서 Develop uifigure-Based Apps에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by