[Gtk-sharp-list] Drag and drop path
Tue, 30 Nov 2004 17:20:45 +0100
Thanks for the help, I'll check it out tonight!
But it seems strange to me that a simple GTK application would require
gnomevfs to be able to use it's drag and drop URI:s? Not that it
matters, I was planning on looking at gnomevfs anyway :-)
p.s. I am writing a C# music player and I will drop you an off list mail
On Mon, 2004-11-29 at 22:01 +0000, Mike Rhodes wrote:
> I use this code:
> [DllImport ("libgnomevfs-2.dll")]
> private static extern IntPtr gnome_vfs_get_local_path_from_uri (string str);
> public static string LocalPathFromUri (string uri)
> IntPtr p = gnome_vfs_get_local_path_from_uri (uri);
> if (p == IntPtr.Zero)
> return null;
> return GLib.Marshaller.PtrToStringGFree (p);
> (All credit goes to the Muine code where I found it =) ) I believe
> gnome-vfs isn't part of gtk-sharp as of yet, so I'm not sure of
> another way to do it.
> p.s. btw, if you are thinking of writing a C# music player, I'm also
> writing one; perhaps we could team up -- or at least solve some of the
> issues that come up -- drop me a line off-list if you are interested!
> On Mon, 29 Nov 2004 19:08:26 +0100, Christian Rudh
> <firstname.lastname@example.org> wrote:
> > Hi
> > When drop a file on my application i get the URL in the following
> > format:
> > file:///home/user/song%20X.mp3
> > To be able to pass it on to Gst# (for example) I have to remove the
> > file:// part and replace %20 with spaces (that goes for other special
> > characters to). Is there any simple way to decode the string to a normal
> > Unix path? Like the System.Web.HttpUtility.HTMLDecode that MS .NET has?
Christian Rudh <email@example.com>