Update to R2011b breaks call to addlistener
2 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
采纳的回答
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)
更多回答(1 个)
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
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.
另请参阅
类别
在 Help Center 和 File 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!