|
Hi all,
First of all I'm programming in C.
I'm trying to create a panning image effect using the grab and drag style that you would use in a pdf file for example.
It's mostly working, I'm using a gtk drawing area and modifying the 'corner position' of the gdk pixmap to start drawing from onto the drawing area.
I'm using a button press event to detect the 'grab' point and then motion events to detect how to move the image.
The problem is that when there is a lot of pointer motion occuring and then the button is clicked to start the drag it seems as though the button click event is ignored until after the motion events are dealt with. This results in the previously clicked point (or 0,0 if no previous points) being mistaken as the point which is 'grabbed' rather than the new point.
I have made sure that the button press event is attached before the motion event if that makes a difference, and I've had many people (who know C but not GTK) verify that my code seems correct.
Would anyone know the problem here? Or is there a better way of doing what I'm trying to achieve? sorry I'm very new to GTK and GUI programming.
Also if anyone could point me in the direction of come open source code which does this it would be GREATLY appreciated.
Thanks for reading!
Glenn
|