Azzera filtri
Azzera filtri

How to pass data from Dialog App to Calling App before closing Dialog App?

7 visualizzazioni (ultimi 30 giorni)
I have an app that opens a Dialog app when pushing a button. In the Dialog app I want to insert some data, that then gets passed on to the main app before closing the Dialog app. How can I do that?
Below my code with the missing lines where I would like to pass the data from the Dialog App to the main app:
properties (Access = private)
CallingApp % Description
end
% Callbacks that handle component events
methods (Access = private)
% Code that executes after component creation
function startupFcn(app, mainapp, dby, compass)
app.CallingApp=mainapp;
end
% Button pushed function: OKButton
function OKButtonPushed(app, event)
% pass on data from this app to CallingApp
????
% delete dialog window
delete(app)
end
% Value changed function: speedupdownsampledatabySpinner
function speedupdownsampledatabySpinnerValueChanged(app, event)
dby = app.speedupdownsampledatabySpinner.Value;
end
% Value changed function: toolorientationSpinner
function toolorientationSpinnerValueChanged(app, event)
compass = app.toolorientationSpinner.Value;
end
end
Thank you!

Risposte (1)

Thomas Fournier
Thomas Fournier il 10 Set 2021
So you have a Dialog app and a calling app, imagine in your calling app you have a property called speed,
in your calling app you access it with app.speed, but if you want to change it from your Dialog app you have to write
app.CallingApp.speed='something'

Categorie

Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by