필터 지우기
필터 지우기

Properties of graphic objects not observable any more in R2014b?

조회 수: 2 (최근 30일)
Thomas Deneux
Thomas Deneux 2015년 1월 11일
편집: Walter Roberson 2016년 9월 27일
Hello,
In my programs, i am using 'addlistener' to track specific changes of the properties of some graphic objects, for example (hobj is a graphic object handle):
addlistener(hobj,'Position','PostSet',@(u,e)updatepos(P));
addlistener(hobj,'Units','PostSet',@(u,e)updateunits(P));
This works fine for me (i have R2014a), but leads to the following error for one collaborator who has R2014b:
Error using matlab.ui.Figure/addlistener While adding a PostSet listener, property 'Position' in class 'matlab.ui.Figure' is not defined to be SetObservable.
Is it possible that the ability to track property changes that i was using has been removed in the latest release of Matlab?! If it is the case, how then can i detect in particular when the size of graphic objects changes (including when their units are 'normalized' and the size of the parent is changed).
Thanks

답변 (1개)

Walter Roberson
Walter Roberson 2016년 9월 27일
편집: Walter Roberson 2016년 9월 27일
You can addlistener to the Resize event.
All of the properties() of figures can be addlistener except Position and Children. I do not know at this time why Position is different.

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by