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

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.

 Akzeptierte Antwort

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.

Weitere Antworten (1)

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 Kommentar

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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by