Handle Graphics - run a callback function when mouse motion ceases??
Mostrar comentarios más antiguos
Hi,
I'm building an interactive graphical app. I wish to run a callback function once the user stops moving the mouse over the graph, to bring up a pseudo tool-tip on the nearest entity. I don't wish to use any mouse button presses, as these are for other interactions.
I can't think of a simple way of triggering the callback, short of using the mouse motion to continually reset a timer object, which is pretty clunky.
Any ideas??
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 25 de Mzo. de 2011
0 votos
You could have the timer running all the time that the option is in effect, with timer repeat mode, configured so that the effect that the timer has is dependent on a flag that the motion callback clears when there is mouse motion.
2 comentarios
P_Farr
el 28 de Mzo. de 2011
Walter Roberson
el 28 de Mzo. de 2011
Well, there is no specific callback for mouse motion stopping -- not unless there is one at the Java level.
Can you think of any time-outs in MATLAB that might be a model for the behaviour you would like to see? The only time-outs that I can think of at the moment are the time-outs waiting to see a terminator for serial I/O.
Categorías
Más información sobre Interactive Control and Callbacks en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!