Mystilleef <[EMAIL PROTECTED]> writes:
> Hello,
>
> Every time I drag a text document onto my application's text buffer,
> it loads the document fine, but then, it appends the document's URI at
> the end of the document.
>
> def data_received_callback(self, widget, drag_context, x, y, selection_data,
> target_type, time):
> if target_type == self.TARGET_TYPE_TEXT:
> data = selection_data.get_text()
> filename = gnomevfs.get_local_path_from_uri(data)
> realfile = filename[0:-1]
> self.loadFile(realfile)
>
> else:
> print "couldn't not load file"
I don't know if this will help. You can try using
drag_context.finish() in the branches of the conditional in
data_received_callback():
def data_received_callback(self, widget, drag_context, x, y,
selection_data, target_type, time):
if ...:
...
# Should actually check here to make sure that the file load worked
drag_context.finish(success=True, del_=False, time=time)
else:
...
drag_context.finish(success=False, del_=False, time=time)
Unfortunately I suspect this won't fix the problem.
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/