how to close all apps simultaneously?
23 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi
I am closing one app and want the other one that calls the app I am closing, to close also.
How can I do that ? As a temporarily solution I have placed a dialog box asking the user whether she or he want to close the calling app also..
thanks
0 Kommentare
Antworten (1)
Taylor
am 4 Dez. 2023
Generally, you can just use "delete"
myHandle = myApp;
delete(myHandle)
I would recommend baking this into the "UIFigureCloseRequest" callback of your primary app like so
% this is called somewhere in the primary app
secondaryAppHandle = secondaryApp;
% this will go in UIFigureCloseRequest
delete(secondaryAppHandle);
7 Kommentare
Taylor
am 4 Dez. 2023
Ah ok I think I understand your point now, thank you for the explanation. When I call
delete(secondaryAppHandle);
I am relying on there being a "UIFigureCloseRequest" function in the secondary App that will properly close the secodary App not just the figure. So the user must make sure they have added this callback function to the secondary App. Deleting the figure object will trigger the UIFigureCloseRequest to be called which will stop the app.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1560394/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1560399/image.png)
Walter Roberson
am 4 Dez. 2023
CloseRequestFcn handles calls to close() or clicking the window decorations to close the figure; CloseRequestFcn does not get invoked for delete() calls.
Siehe auch
Kategorien
Mehr zu Develop uifigure-Based Apps finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!