listener on graphics property 'BeingDeleted'
3 ビュー (過去 30 日間)
古いコメントを表示
How do I add a listener to a graphics object being deleted? It seems like 'BeingDeleted' is set to 'on' during deletion. Furthermore 'BeingDeleted' is SetObservable. So why does the following code not work?
h=plot(0,0,'.b');
addlistener(h,'BeingDeleted','PostSet',@(varargin)(disp('deleted')))
delete(h)
Please note I don't want to use the callback 'deleteFcn', since there might be other objects interested in the delete event.
1 件のコメント
Daniel Kovari
2016 年 9 月 1 日
I'm also having trouble with listeners to 'BeingDeleted'. Did you find a work around?
回答 (1 件)
Sean de Wolski
2016 年 9 月 1 日
How about just listening for 'ObjectBeingDestroyed'?
addlistener(h,'ObjectBeingDestroyed',@(varargin)(disp('deleted')))
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!