On Thu, 2004-05-27 at 14:24 +0200, simonartige free fr wrote:
> Thanks for your fast answer.
>
> Ok, I will report a bug on Gtk+ for this... But, are you sure there is no way
> to put a signal and a callback on the file list ? For instance, can we have
> the "button-press-event" signal on this widget ?
>
> I tried to do what you told me on my treeview to set up the DnD. However, it
> doesn't work. Is what I wrote correct ?
>
>
> static GtkTargetEntry target_source[] = {
> { "treeviewdnd", GTK_TARGET_SAME_WIDGET, 0 }
> };
>
> static GtkTargetEntry target_destination[] = {
> { "treeviewdnd", GTK_TARGET_SAME_WIDGET, 1 },
> { "text/x-uri-list", GTK_TARGET_SAME_APP, 2 }
> };
>
> .
> .
> .
>
> gtk_tree_view_enable_model_drag_source(GTK_TREE_VIEW(pTreeView),
> GDK_BUTTON1_MASK, target_source, sizeof(target_source) /
> sizeof(GtkTargetEntry), GDK_ACTION_MOVE);
>
> gtk_tree_view_enable_model_drag_dest(GTK_TREE_VIEW(pTreeView),
> target_destination, sizeof(target_destination) / sizeof(GtkTargetEntry),
> GDK_ACTION_MOVE);
>
>
> The other target is for an intern Dnd.
>
> Did I write/understand it wrong ? If so, please tell me what I should write
> and what you mean by "just add the "text/x-uri-list" target to your
> TreeView".
>
> Thanks for advance !
>
> Simon.
Sorry, I wasn't very clear. What I meant was "it should work so that all
you have to do is add 'text/x-uri'list" to your TreeView, but it doesn't
work that way now and will require a patch to GTK+ to do so." Since
you're apparently familiar with TreeView DnD (I'm not), I was suggesting
you just dive into the GTK+ source and add the appropriate drag targets
to the GtkFileChooser widgets yourself (attaching the resulting diff to
a bug in bugzilla so it won't get lost). Since all the GtkFileChooser*
widgets use the same code (in gtkfilechooserdefault.c) to draw the list
in the chooser widget, it should be a trivial patch to write.
And, I should probably also apologize if that sounds presumptuous, it
just seems like something best done at the GTK+ level, and F/OSS makes
doing that easy :-).
--
Peace,
Jim Cape
http://ignore-your.tv
"We still name our military helicopter gunships after victims
of genocide. Nobody bats an eyelash about that: Blackhawk.
Apache. And Comanche. If the Luftwaffe named its military
helicopters Jew and Gypsy, I suppose people would notice."
-- Noam Chomsky, "Propaganda and the Public Mind"
Attachment:
signature.asc
Description: This is a digitally signed message part