question about when a callback function is supposed to be called.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
J. Webster
le 8 Juin 2016
Réponse apportée : Walter Roberson
le 8 Juin 2016
In my program, which is written in App Designer, I have a Text Edit Field which contains the path to my data directory.
One can edit the value in the field to ways.
Way 1 is to directly edit the value by clicking in the box and typing the new path
for Way 2, I have a button beside the text field that when clicked opens up a file dialog and allows the user to select a different directory.
If I edit the Text field directly by typing in it, the valueChanged callback is called correctly.
If I use the button and file dialog to change the directory, then the value that is shown in the text field changes to what was selected, but the valueChanged callback is NOT called.
It seems to me that if the value is changed, no matter how it was changed, then the callback should execute.
Is this behavior expected or is it a bug?
0 commentaires
Réponse acceptée
Walter Roberson
le 8 Juin 2016
Callbacks are never called when a property value is set() or changed by using dot notation. A listener might be called when a property value is changed, but not a callback.
Callbacks are invoked upon click or upon keyboard action when the item has focus (depending on the variety of callback.)
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Interactive Control and Callbacks 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!