create a tab which appear before closing the GUI
1 vue (au cours des 30 derniers jours)
Jiri Hajek le 10 Oct 2022
You have to create a UIFigureCloseRequest callback, which is easily done in AppDesigner by a right click on the app.UIFigure in Component Browser.
Then, in the callback, use a.uiconfirm functiion, which gives two alternative answers (OK or Cancel). In an if-else block, you can manage the options you need do perform. You can close the app by the command delete(app).
Allen le 10 Oct 2022
@PA, I typically use something similar to the following.
qstr = "Do you really want to close the Project without Saving?";
qans = uiconfirm(app.UIFigure,qstr,"Close Request", ...
"Options",["Save","Don't Save","Cancel"], ...
% I typically have a save function assign to a push button callback
% within my App and call it directly from here.
% You can also directly insert any save functions that work for your
% data type.