Puzzling CurrentPoint property behaviour in figure

1 回表示 (過去 30 日間)
Temu Gautama
Temu Gautama 2020 年 2 月 13 日
コメント済み: Temu Gautama 2020 年 2 月 13 日
Hi,
I have some puzzling behaviour on the CurrentPoint property of a figure. Normally, it only changes when you click (and release) inside the figure. This is what I get in this code:
close all
hFig = figure( 1 )
while( ishandle( hFig ))
title( get( hFig, 'CurrentPoint' ))
drawnow
end
However, when I add a dummy callback function on the WindowButtonMotionFcn, I get the current position of the mouse pointer (which was, accidently, what I was looking for):
close all
hFig = figure( 1 )
set( hFig, 'WindowButtonMotionFcn', @( src1, evt1 ) 1 );
while( ishandle( hFig ))
title( get( hFig, 'CurrentPoint' ))
drawnow
end
Can anybody explain this behaviour? I am using R2015b.
Thanks,
Temu
  2 件のコメント
Adam
Adam 2020 年 2 月 13 日
I would imagine it is just being intelligent and only updating the property when it is actually needed. And adding a button motion callback counts as it being needed even though the callback itself happens not to make use of it, I guess.
Temu Gautama
Temu Gautama 2020 年 2 月 13 日
Thanks for that. BIt of a funny one, though...

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by