question about when a callback function is supposed to be called.
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Walter Roberson
2016-6-8
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!