[wx-dev] cut/paste files list under wxGTK
Armel Asselin
asselin.armel at wanadoo.fr
Wed Nov 1 10:10:59 PST 2006
>> > I'm currently trying to make wxFileDataObject work a bit better under
>> > wxGTK(2): it seems that Gnome uses the type
>> > "x-special/gnome-copied-files"
>> > whereas wx only supports "text/uri-list".
>> > I saw that a similar problems happened with wxTextDataObject (i.e. it
>> > is
>> > expected to be simple data object but is not in fact).
>> >
>> > is there already some work in this direction?
>>
>> No.
>
> Actually, I just dragged a file onto the test widget in
> the "dnd" sample and it does work, so if GNOME and
> therefore GTK has switched to "x-special/gnome-copied-files",
> then we'd have to know which version of GTK+ would be
> affected. Additionally, we can now also check if KDE
> is running and they might be using something else again.
>
> Or do you mean clipboard pasting of files? I wonder
> where that is used outside of file managers, but
> having work wouldn't hurt.
in fact, Nautilus drag'n'drop uses text/uri-list but cut/paste uses
x-special/gnome-copied-files. so drag'n'drop worked but not copy/paste.
OK, i've built something which works here, I found bugs in
wxClipboard::GetData (it requests all the info with default direction
wxDataObject::Get, whereas it should ask with wxDataObject::Set)
the gnome format is only accepted (i.e. only if direction is Set) and not
returned, as we do not know what to put in the first line (which the command
type: cut or copy)... maybe we could support it and always put copy?
if have got a problem also for wxClipboard::IsSupported(wxDF_FILENAME),
wxDF_FILENAME points only toward g_fileAtom currently, so testing won't work
if the clipboard content is x-special... should I put a hack???
Armel
More information about the wx-dev
mailing list