[pygtk] DND on non-editable textview

Le Boulanger Yann asterix at lagaule.org
Tue May 9 06:13:20 WST 2006


Hi all,

I'm trying to implement DND of files (from a file manager) to a textview.
here is my code:

self.TARGET_TYPE_URI_LIST = 80
tv.connect('drag_data_received', self.on_drag_data_received)
tv.drag_dest_set(gtk.DEST_DEFAULT_ALL,
	[ ( 'text/uri-list', 0, self.TARGET_TYPE_URI_LIST ) ],
	gtk.gdk.ACTION_COPY)

def on_drag_data_received(self, widget, context, x, y, selection,
target_type, timestamp):
	print 'data received'
	context.finish(True, False, timestamp)
	return True

everything works fine when textview is editable, but when it's not
editable (tv.set_editable(False)) on_drag_data_received() is not called.
Is it normal ? is there a way to workaround that ?

thanks,
Yann


More information about the pygtk mailing list