如何使用按钮退出App designer GUI?
我试过了,但不起作用:
function QuitButtonPushed(app, event)
fig = uifigure;
selection = uiconfirm(fig,'Close software?','Quit', 'Icon','warning');
switch selection
case 'Yes'
app.delete;
case 'No'
return
end发布于 2020-04-09 21:11:45
交换机的案例应该是'OK'和'Cancel',而不是'Yes'和'No'。
另外,不建议使用fig = uifigure;,而是传入app.UIFigure:
selection = uiconfirm(app.UIFigure,'Close software?','Quit', 'Icon','warning');
switch selection
case 'OK'
app.delete();
case 'Cancel'
return
endhttps://stackoverflow.com/questions/61121584
复制相似问题