problem with grabbing pointer



Here's the big picture of what I'm trying to do:

I have a button drawn on the screen.  I would like for the user to be able
to click and drag the button around the window using the left mouse button.

So, what I do is I connect signals to button pushes, and motion, etc.  All
is well as long as the user doesn't move the mouse too fast.  If they do,
then the button no longer gets the mouse events (b/c the mouse moved off the
button before it could catch up).  With Tcl/Tk and Java, the pointer is
grabbed by the button and so if I move off the upper left edge, the button
still gets the mouse events, with coordinates of -1,-1 (for example).

I'd like for the same thing to happen with Gtk+.

I've tried on the left mouse click to do a call to 

gdk_pointer_grab(event->window,1,GDK_ALL_EVENTS_MASK,NULL,NULL,0);

but this seems to have no effect.

Any ideas?

Thanks,

Martin



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