【发布时间】:2014-01-21 15:36:48
【问题描述】:
当用户关闭 gui(使用 rght top 'x')时,如何在 GUI Matlab 中发出警告消息。
【问题讨论】:
-
这绝对不是引用帖子的重复。
标签: matlab user-interface warnings message
当用户关闭 gui(使用 rght top 'x')时,如何在 GUI Matlab 中发出警告消息。
【问题讨论】:
标签: matlab user-interface warnings message
例如,您可以set the figure's CloseRequestFcn 询问用户是否真的要关闭图窗。为此,您可以使用内置的模式窗口,例如 questdlg。上述文档中给出了example of such a function:
function my_closereq(src,evnt)
% User-defined close request function
% to display a question dialog box
selection = questdlg('Close This Figure?',...
'Close Request Function',...
'Yes','No','Yes');
switch selection,
case 'Yes',
delete(gcf)
case 'No'
return
end
end
【讨论】: