GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Sep 16, 2014 7:31 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Problem with motion event drawing
PostPosted: Sat Sep 01, 2007 7:58 am 
Offline
Familiar Face

Joined: Sat Sep 01, 2007 7:16 am
Posts: 10
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


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 01, 2007 10:23 am 
Offline
Familiar Face

Joined: Sat Sep 01, 2007 7:16 am
Posts: 10
Hi again,

I fixed it! It was because I was setting the GDK_POINTER_MOTION_HINT_MASK event as well, as soon as I took that out it worked properly.

Can anyone explain why this caused the problem? As I heard using the hint mask was good to reduce CPU workload.

Thanks anyway,

Glenn


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group