If you want to do this within a window, here is how you might approach the problem.
First turn the cursor off in the window.
Put a raw widget over the entire window and put in a callback for cursor movements.
In the callback, figure out where mouse position is and put a small graphic image there.
Implement a timer so that you can cycle the graphic image.
You also have to figure out what to do when the cursor leaves the window.
You might want the image to disappear.
This is different from Mac spinning wheel in that the spinning wheel goes everywhere.
This would appear only inside the window.