Re: Drag and Drop issue.



I've just found the solution. I forgot to set the "use-drag-icons" arg
of my GtkCList widget to "false" (gtk_clist_set_use_drag_icons). But I
think you're right: "GTK's DND is not really tailored for this task". I
will try to achieve my goal in on other way. Thank.

Okay, here's some tips on how I did this once.

First on your source widget (the one you want the user to click and drag
around), have it watch for a GDK_EVENT_BUTTON_PRESS, then when the button
is pressed (and perhaps when it moves +/-5 pixels from its initial
position, watch for motion events too to achieve this) create a pop-up
GtkWindow.

This window will not have any WM decorations so you need to set its size
using gtk_widget_set_usize(). Use gtk_widget_reparent() to move the source
widget on to the pop up window, then ungrab and then grab the pointer,
grab the pointer relative to the source widget that is now on the pop up
window.

At this point you'll need to watch for motion events and move the popup
window relative to the root window, as I recall there's an obscure
function to get the current pointer coordinates relative to the root
window.

This worked for me once, if you have any questions let me know :)

--
Sincerely,                  ,"-_                         \|/
-Capt. Taura M.             ,   O=__                    --X--
..__                         ,_JNMNNEO=_                 /|\
OMNOUMmnne.                  {OMMNNNEEEEOO=_
UOOOBIOOOEOMMn.               'LONMMMMNNEEEOOO=.__..,,..
UUOOEUUOOOOOOOObe              '"=OMMMMWNEEEOOOOO,"=OEEEOO=,._
OOUUUIEEIOONNOIUbe.                "7OMMMMNNNNNWWEEEEOOOOOO"   "'.
EEBNNMMMNWNWWEEIMMNe.             __  7EMMMNNNNNWWWEEEEEEEOO.     " .
NNMMMMWWWMMMWEINMMMNn            "=BBEEEEMMMMMMMMNNNWWWEEOOOOO=._     .
                  http://furry.ao.net/~learfox/





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