Re: Movinf the mouse pointer



hi,

i do much the same thing in my application when i am zooming in on
seismological waveforms, mouse-down drag-right = zoom in, mouse-down
drag-left = zoom out.

in order to determine whether or not to zoom in or out, on mouse-down i
save the coordinates of the current mouse position, and then on the drag
event compare the new mouse position with the original (saved) mouse-down
position.  if new  > original then zoom in, else zoom out.  once the drag
event is processed, i reset the original position with the new position
(thus, allowing the user to change directions without having to either: 1)
restart the mouse event, or 2) get back to the original position.  how
this is relevant for you would be app-specific).

if you want to restore the original starting position, simply save the
mouse position on mouse-down and then restore these saved coordinates on
mouse-up.

hope this helps,

richard boaz

> Hello all,
>
> I have implemented a way to rotate the view around a point in my 3D
> application, by using the mouse pointer: in
> fact when the left mouse button is hold down and the mouse is moved, the
> view rotates around. When this process
> is going on, the mouse is hidden (i.e. its shape is an empty image).
> My problem is that I would like to reset the mouse pointer position
> after each delta movement has been detected: in this
> way the mouse pointer is always placed in the original position it was
> when the mouse button was pressed. I do not know
> how to do it, any help?
>
> TIA
> Luca
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]