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

7 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

Ashwin Thombre
Ashwin Thombre il 7 Dic 2019
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.

Più risposte (1)

Subhadeep Koley
Subhadeep Koley il 5 Nov 2019
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 Commento
Ashwin Thombre
Ashwin Thombre il 6 Nov 2019
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.

Accedi per commentare.

Categorie

Scopri di più su Develop uifigure-Based Apps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by