Update to R2011b breaks call to addlistener

조회 수: 1 (최근 30일)
David Goldsmith
David Goldsmith 2011년 10월 11일
Just updated from R2010a to R2011b. In a custom "brush on" handler, I have the following call to addlistener that works fine in R2010a:
addlistener(figureHandle, 'windowButtonUp', @obj.BrushEnd);
but causes R2011b to return the following error:
"The specified event is not supported by the object"
when it tries to call save__listener__.
I've searched the Release Notes of every version from 2010a through 2011b, the bug reports, the entire MathWorks site, and Googled--nada. Any ideas? Thanks!

채택된 답변

Jan
Jan 2011년 10월 11일
Please try this:
addlistener(figureHandle, 'WindowButtonUpFcn', 'PostSet', @obj.BrushEnd);
[EDITED]: I assume, the above will not do what you need. Try this:
addlistener(gcf, 'WindowMouseRelease', @obj.BrushEnd)
  댓글 수: 2
David Goldsmith
David Goldsmith 2011년 10월 12일
WindowMouseRelease worked, thanks. Subsequently, I searched the entire site for WindowMouseRelease, and received nothing but a "Check your spelling" warning--"very undocumented" indeed! (I'm going to report this as a bug.)
David Goldsmith
David Goldsmith 2011년 10월 12일
Here's the reply I got to my service request:
"Thank you for bringing this issue to our attention. It is indeed true that the events ‘WindowButtonUp’, ‘WindowButtonDown’ and ‘WindowButtonMotion’ have been renamed to ‘WindowMouseRelease’, ‘WindowMousePress’ and ‘WindowMouseMotion’ (respectively)...
The current documentation for MATLAB 7.13 (R2011b) has no indication of these name changes. I have made a request to update the documentation. Once again, thank you very much for helping us."
Hopefully that's the extent of that (but see my other post about the new database toolbox update function breaking my code).

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

추가 답변 (1개)

Jonas Reber
Jonas Reber 2011년 10월 11일
does the event exist on the "figureHandle"?
get(get(classhandle(handle(figureHandle)),'Events'),'Name')
what if you try writing it "WindowButtonUpEvent"? I think its just a spelling error.
  댓글 수: 3
Jan
Jan 2011년 10월 11일
>> addlistener(gcf, 'WindowButtonUpEvent', @why);
"Warning: The specified event will be removed in a future release.
Please use the following event instead: WindowMouseRelease"
But the WindowMouseRelease does not appear in the list shown by: get(get(classhandle(handle(gcf)),'Events'),'Name')
I think the non-trivial ineraction with GUIs is very undocumented and clumsy.
David Goldsmith
David Goldsmith 2011년 10월 11일
Thanks, all.
@ Walter: is there a "one-stop-shop" list of such events?
@ Jan: no scheisse! ;-(

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

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by