Azzera filtri
Azzera filtri

How to stop getting cursor position?

1 visualizzazione (ultimi 30 giorni)
KAE
KAE il 21 Giu 2017
Commentato: KAE il 23 Giu 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.

Risposta accettata

Geoff Hayes
Geoff Hayes il 23 Giu 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 Commento
KAE
KAE il 23 Giu 2017
This will work with how I have the code implemented, thanks!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by