Is there a way to update input arguments from main app to dialogue app if the dialogue app is running in single instance?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
staurtupFcn is no more processed after first access to dialogue app and arguments are not updated according to following access from main app.
0 Commenti
Risposte (1)
Eric Delgado
il 22 Nov 2022
Yes. Just create a PUBLIC property or a public function in your dialogue app and call it everytime you change something in your main app. You can use try catch block or a handle validation.
% In your dialogue app - "dialogApp.mlx"
properties (Access = public)
myProperty
end
methods (Access = public)
function myPublicFunction(app, newValue)
app.myProperty = newValue;
end
end
% In your main app
properties (Access = private)
hWin = [] % handle to your dialogue window
end
% Callback for a pushed button, opening your dialogue window, for example
app.hWin = dialogApp(app);
% Changing a value in your dialogue windows from your main app
if ~isempty(app.hWin)
app.hWin.myPublicFunction(10);
end
% Or...
try
app.hWin.myPublicFunction(10);
catch
end
% Or...
try
app.hWin.myProperty = 10;
catch
end
0 Commenti
Vedere anche
Categorie
Scopri di più su Develop Apps Using App Designer 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!