How to stop getting cursor position?

1 次查看(过去 30 天)
I have a function based on GUI_27 by Matt Fig. The function continuously displays the position of the cursor as the mouse is moved within the axis. I'd like to know: how can I turn off this behavior, so it stops extracting and displaying the cursor location? In my real GUI, the user pushes a pushbutton to start displaying the cursor location, but I don't know how to stop it.

采纳的回答

Geoff Hayes
Geoff Hayes 2017-6-23
KAE - how have you implemented the function as described in GUI_27? Do you use the same callback like
set(S.fh,'windowbuttonmotionfcn',{@fh_wbmfcn,S}) % Set the motion detector
If so, you could try clearing this callback as
set(S.fh,'windowbuttonmotionfcn',[]);
so that the WindowButtonMotionFcn no longer has a callback function to update the cursor position. When you need to know the cursor position then just restore the callback as however you have initialed it before.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by