I have wary annoying problem with dnd dragging image. When I start dragging some widget, it shows some default icon as it moves. I just want that this icon is actually widget looks itself. So it should look just as I move widget by dragging.
Is there easy way to accomplish this?
I started to look around and all I found is to set image using pixbuf
pixbuf = gtk.gdk.pixbuf_new_from_xpm_data(xpm)
myWidget.drag_source_set_icon_pixbuf(pixbuf)
This way it works, but I need to use current looks of widget, because there are themes and overlay of few images.
You can get the Cairo context of the widget, then copy it to a pixbuf:
Here I’m going through an intermediary file to save and load the image data. There’s probably a direct way to do that, but after going through the Cairo documentation and trying out various weird things, I gave up.