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
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!