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

disable focusmodalmulti-window appsuifigure disable

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.

Best Answer

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.