addlistener for an array
5 ビュー (過去 30 日間)
古いコメントを表示
In a GUI, I would like a function to be called whenever a certain variable stored in "handles" is changed (handles.times lets say). I tried using addlistener() directly on an array, which doesn't work. I think I can create a class and do it that way, but it seems like a lot. I'm looking for SPECIFIC examples. Reasoning for this is I have a GUI that is a slave GUI to a master GUI. Whenever a certain value changes in the slave, I want it to automatically update the master GUI.
0 件のコメント
回答 (1 件)
Walter Roberson
2011 年 8 月 30 日
It might be easier to write a small wrapper routine such as
function handles = updatehandles(handles, field, value)
handles.(field) = value;
guidata(handles.mastergui, handles);
end
and then use updatehandles() instead of a plain assignment.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Graphics Object Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!