Borrar filtros
Borrar filtros

How to stop getting cursor position?

1 visualización (últimos 30 días)
KAE
KAE el 21 de Jun. de 2017
Comentada: KAE el 23 de Jun. de 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.

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by