How to add extra arguments to callback functions in App Designer?
19 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to be able to pass parameters or arguments into the callback function, but do not know how to do this or if it is even possible. Currently, this is how I create a callback function within the code view of App Designer. {test.ValueChangedFcn = createCallbackFcn(app,@testChange,true);} From there, I would create {function testChange(app,event) %%code end}
What if i need {function testChange(app,event,arg1,arg2)}?
Does anybody know how I can do this or if this is possible?
0 commentaires
Réponses (1)
Mudambi Srivatsa
le 26 Juin 2017
Adding extra arguments into a callback function is not possible in App Designer. However, you can share the data to callback functions as application state since "app" is accessible.
For more information, refer to the following links:
http://www.mathworks.com/help/matlab/creating_guis/differences-between-app-designer-and-guide.html#buv81ly-1
http://www.mathworks.com/help/matlab/creating_guis/share-data-across-callbacks-in-app-designer.html#busp3ol-13
0 commentaires
Voir également
Catégories
En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!