[pygtk] receiving files from nautilus

Thomas Leonard tal00r@ecs.soton.ac.uk
Tue, 1 Oct 2002 11:16:53 +0100

Florian <florian@structbench.com> wrote:
> On Mon, 2002-09-30 at 03:02, James Henstridge wrote:
> > florian wrote:
> > 
> > >hi!
> > >
> > >im wondering if its possible to receive files dragged from
> > >nautilus on some gtk widget. should be possible, or?
> > >
> > >but how do i managed it? when i drag some files from nautilus
> > >on a row in a treeview. how do i figure out the filename and
> > >all that stuff. does anybody have a example or some small
> > >tips? i would appreciate..
> > >  
> > Nautilus uses "text/uri-list" as the target type for its drags, so just 
> > say that you accept drags of that type.  The format of the data in a 
> > text/uri-list drag is simply a '\r\n' separated list of uris.
> anybody might be able to just give me a super small example
> of what extra stuff has to be done to make all that?
> the dnd examples are kinda hard to understand, since there are
> no comments in them and also the used gtk functions are barly
> commented..

ROX-Lib has a mix-in class called XDSLoader which does this.
It's quite short, and anyway you don't need to understand the details to
use it. It can also get data directly from other programs. Look in ROX-Lib
for a gtk+-1.2 version and ROX-Lib2 for gtk+-2.0.





Thomas Leonard			http://rox.sourceforge.net
tal00r@ecs.soton.ac.uk		tal197@users.sourceforge.net
GPG: 9242 9807 C985 3C07 44A6  8B9A AE07 8280 59A5 3CC1