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

4 visualizaciones (últimos 30 días)
F S
F S el 10 de Sept. de 2021
Comentada: Adam Danz el 10 de Sept. de 2021
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!

Respuestas (1)

Thomas Fournier
Thomas Fournier el 10 de Sept. de 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'

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by