使用代码退出 App 设计器 GUI - Matlab
Quit an App designer GUI using a code - Matlab
如何使用按钮退出 App 设计器 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
switch case 应该是 'OK'
和 'Cancel'
,而不是 'Yes'
、'No'
。
还建议通过app.UIFigure
而不是使用fig = uifigure;
:
selection = uiconfirm(app.UIFigure,'Close software?','Quit', 'Icon','warning');
switch selection
case 'OK'
app.delete();
case 'Cancel'
return
end
如何使用按钮退出 App 设计器 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
switch case 应该是 'OK'
和 'Cancel'
,而不是 'Yes'
、'No'
。
还建议通过app.UIFigure
而不是使用fig = uifigure;
:
selection = uiconfirm(app.UIFigure,'Close software?','Quit', 'Icon','warning');
switch selection
case 'OK'
app.delete();
case 'Cancel'
return
end