Re: [gtk-list] problem with grabbing pointer



>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+.

it does. you must have a mistake in your code. take a look at the
example code in testgtk.c covering shaped windows. you'll find stuff
that does this for shaped windows that you can drag around the screen
at will.

Pointer grabs are not a feature of GTK, but of the X Window
system. There is (almost) no way to avoid them regardless of the
widget toolkit one uses or the language its written in.

What signals are you using ?

--p



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