Re: Drag'n'drop problems



On Mon, 8 Sep 2008 22:27:08 +0200
"Kristian Rietveld" <kris gtk org> wrote:

This function will actually set up the tree view as a model drag
source and destination (via
gtk_tree_view_enable_model_drag_{source,dest}) and will specify a
target entry using GTK_TREE_MODEL_ROW as a target string.

Unfortunately the default implementations of the GtkTreeDragDest
interface that are in the GtkListStore and GtkTreeStore models can
only handle the GTK_TREE_MODEL_ROW target.  One of the things you can
try is subclass GtkListStore or GtkTreeStore and re-implement the
GtkTreeDragDest interface.  If that is not enough, I think another
thing that people tend to do is even override the default
implementation of drag and drop on the tree view widget.

Hello Kristian,

Yes, that is what I found out. Most implementations seem to use the lower
level interface. Is GTK_TREE_MODEL_ROW the only string that is
interpreted as special? Or does any of the frequently used ones, like
'STRING' 'TEXT', 'INTEGER', 'text/plain', also have side-effects?

This recent blog entry (and the preceding one) of Davyd may be of use:
http://davyd.livejournal.com/252082.html

Interesting, particularly the part of how to copy data into the
selection - I hadn't seen an example of that elsewhere.

I fully agree that the current implementation of drag and drop in tree
view is suboptimal, especially in terms of ease of use and
extensibility.  Over the summer I started on a rewrite of this, but as
University has started again I cannot really say when this will be
finished :)  But at least improvements are (finally) in the works.

Nice to see a student who takes his studies seriously! Best of luck...

John



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