How to update a "child" figure?
조회 수: 8 (최근 30일)
이전 댓글 표시
I have a manually generated gui which consists of a parent figure with a number of child figures laid out on uipanels.
If I click something in one of the child figure I can cause something to happen in the parent figure using a figure handle passed to the child figure as an argument when I call the function that creates it.
Is there are way of triggering in the other direction, i.e. once the child has been created, if I click something in the parent figure how do I cause something to happen in the child figure?
댓글 수: 0
채택된 답변
Sean de Wolski
2012년 1월 17일
Save the handle to the child figure in appdata and set it as necessary:
setappdata(hParent,'hChild1',hChild);
On click:
hChild = getappdata(hParent,'hChild');
set(hChild,...)
댓글 수: 3
Sean de Wolski
2012년 1월 17일
Sure you can save the figure handle in appdata, that's what my above setappdata command did.
doc setappdata/doc getappdata for more info
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!