How to determine if the user closed the app window?

22 ビュー (過去 30 日間)
Rich006
Rich006 2023 年 4 月 24 日
回答済み: Kevin Holly 2023 年 4 月 24 日
I have a script that calls an App Designer mlapp as an interface for a user to enter information. How can I get my main script to determine if the user has closed the window (using the X in the title bar)?

採用された回答

Kevin Holly
Kevin Holly 2023 年 4 月 24 日
When you run the app in your main script, you could assign a variable to its handle.
app = YourApp;
You can check if it is deleted with:
isvalid(app)
Another useful function is you could use is uiwait.
You could also add a Close Request Function to your app.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by