Is there a way to disable focus on a calling app while designing multi-window apps using app designer?

7 ビュー (過去 30 日間)
I'm designing a multi-window app using app designer in R2019a, where information from the calling app is passed to the dialog app on the press of a button. I would like to disallow the user from interacting with the calling app while the dialog app is executing.
This example provided by TMW disables the calling button in the main app. However I have several buttons, menus and a table; all of which I'll have to disable and re-enable on deleting the dialog app, which seems tedious.
This FEX submission was not designed to work with uifigure/app designer.
Thanks.

採用された回答

Ashwin Thombre
Ashwin Thombre 2019 年 12 月 7 日
I've figured out a work around for my needs. Solution is as follows:
  1. Create a progress dialog in the calling app UIFigure from the dialog app startup function
function startupFcn(app,CallingApp)
app.InterruptDialog=uiprogressdlg(CallingApp.UIFigure);
%rest of your code
end
2. Close the progress dialog in the close request function of the dialog app
function UIFigureCloseRequest(app,event)
close(app.InterruptDialog);
%rest of your code
delete(app);
end
The only negative of this method is that the progress dialog kicks in after the dialog app becomes visible, but the lag is acceptable. Hope this helps.

その他の回答 (1 件)

Subhadeep Koley
Subhadeep Koley 2019 年 11 月 5 日
Hi, there is a work around by setting the visibility of the calling UIFigure to ‘off’ at the ButtonPushed call back.
app.UIFigure.Visible = 'off';
At the called UIFigure CloseRequestFcn callback you can again set the visibility to ‘on’.
app.UIFigure.Visible = 'on';
Hope this helps!
  1 件のコメント
Ashwin Thombre
Ashwin Thombre 2019 年 11 月 6 日
Thanks, but I'd like to keep the calling app visible so that users can see changes they've made to data from the dialog app in the calling app.
I need the dialog app to behave like the built-in modal dialog uialert.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDevelop uifigure-Based Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by