Clear Filters
Clear Filters

How to stop getting cursor position?

1 view (last 30 days)
KAE
KAE on 21 Jun 2017
Commented: KAE on 23 Jun 2017
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.

Accepted Answer

Geoff Hayes
Geoff Hayes on 23 Jun 2017
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.
  1 Comment
KAE
KAE on 23 Jun 2017
This will work with how I have the code implemented, thanks!

Sign in to comment.

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!