필터 지우기
필터 지우기

If I change a property of a UIControl in a callback do I still need to call setappdata before exiting?

조회 수: 2 (최근 30일)
I start my call back with
handles = getappdata(gcf,'handles');
So I have created a local copy of the handles structure.
Then I modify a control with
set(handles.Batch,'value',1);
Since handles.batch is a handle, don't I automatically change its properties without having to call
setappdata(gcf,'handles',handles);

채택된 답변

Walter Roberson
Walter Roberson 2018년 7월 30일
Correct, you only have to call setappdata() if you modify the structure itself.
Note: it is more common to use guidata() to manage a handles structure. It does the same thing as setappdata() of a property named UsedByGUIData_m, but people are more accustomed to reading guidata()
  댓글 수: 1
Eugene Davis
Eugene Davis 2018년 7월 30일
Thanks Walter. In my app, which I inherited, there are several GUI data structures. They chose not to add these other structures to the grand handles structure. I suppose all the logic, wrt guidata(), about how to deal with the handles structure apply to other structures. The main difference is that these other structures do not contain GUI handles.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by