- Modify your WindowButtonMotion callback code to check if the mouse cursor is hovering over the UIAxes element before performing any actions.
- You can use functions like hittest or gcf to determine the current object under the mouse cursor.
- If the cursor is outside the UIAxes, proceed with your custom WindowButtonMotion logic. If it's inside, allow default UIAxes interactions to take place.
App Designer UIAxes Interactions not working when UIFigure WindowButtonMotion callback set
8 次查看(过去 30 天)
显示 更早的评论
I want to use the WindowButtonMotion callback to produce a 'hover' effect on various images that I'm using as buttons on an App I'm designing, but it looks like just turning on the UIFigure's WindowButtonMotion callback completely disables interactivity (pan, rotate, etc.) with the UIAxes. I have a surface plot showing a 3D render of the data the user is visualizing, but it becomes completely non-interactive when I use buttonmotion callbacks to track mouse movements for the mouse hover.
I've tried various ways to get around this, including setting the UIAxes.View property as a function of mouse positions when the mouse is within the UIAxes, but this seems really clunky, and I can't seem to work out how to 'click & drag' to interact with the surface plot correctly.
Any solutions to re-enable plot interactions? I'm working on Matlab 2019a.
0 个评论
回答(1 个)
Amal Raj
2024-6-6
Hi Arturo,
Conditional Callback Execution:
WindowButtonMotion callback: https://www.mathworks.com/matlabcentral/answers/712873-how-to-get-windowbuttonmotionfcn-to-track-mouse-position
Hope this helps!!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop uifigure-Based Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!