How to pass data from Dialog App to Calling App before closing Dialog App?
4 次查看(过去 30 天)
显示 更早的评论
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!
回答(1 个)
Thomas Fournier
2021-9-10
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'
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!