필터 지우기
필터 지우기

GUI handles does not update

조회 수: 1 (최근 30일)
Naz
Naz 2011년 11월 6일
Hi. Here is a problem: on my gui I have axes where I display an image. At first, my code was as following:
axes(handles.axes1);
imshow(myImage);
it worked fine so far, however, the word "axes" was underlined by orange line, suggesting that this is not a good way to implement this code. So, I found another way to activate the axis:
set(myGUIname,'CurrentAxes',handles.axes1);
imshow(myImage);
now, it works good too, however, something happened to the 'handles' of my GUI - it does not update anymore. Thus, the following:
guidata(hObject, handles);
does not save changes to the handles. I tried to make my GUI active instead of axes, but it did not help:
set(0,'CurrentFigure',myGUIname);
Is there a way to fix it?

채택된 답변

Walter Roberson
Walter Roberson 2011년 11월 6일
Do not use axes() or set CurrentAxes. Instead,
imshow(handles.axes1, myImage)
or
imshow(myImage, 'Parent', handles.axes1)
  댓글 수: 1
Naz
Naz 2011년 11월 6일
The second option works. Thank you Walter.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by