Re: Equivalent to gtk_drag_get_source_widget()?



Paul Davis wrote:
the treeview defines itself as a drag source only for "same widget" DnD.
if you do not take several complex steps to alter this, you cannot drag
out of the treeview. that's mostly because the only target the treeview
accepts/sends by default is a string representation of the path within
an unnamed treemodel. its so unutterably braindead as to be
unbearable :)

I think I have to agree with Chris here. My widget is a filesystem browser and inherits the Gtk::TreeView interface; I'm using two of it to resemble the Norton Commander filebrowsing interface.

As for drag and drop, All I had to do is to call set_drag_source and set_drag_target for text/plain data (the file paths), and connect my signal handlers. I can now copy files from one FileBrowser to the other without too much hassle, I just have to check that the user can't drag (read: copy or move) a file to itself (of course this behavior may be subject to discussion, but for several reasons I decided I don't want it).

I didn't feel I had to "hack" anywhere.

Regards,
Matthias




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]