Re: TreeDragSource data_get location



Torsten Schoenfeld <kaffeetisch gmx de> writes:

It's not obvious to me what the default for the target should be.  You chose
the atom for GTK_TREE_MODEL_ROW -- why?

With an eye on gtk_tree_set_row_drag_data() which looks like it refuses
to act on a selection data of any other target value.  Makes you wonder
if it ought to allow NULL or NONE or whatever at least ... (a matter for
gtk of course).

I found one instance in gtk/gtkdnd.c, gtk_drag_drop().  It does the following
to initialize the data:

      selection_data.selection = GDK_NONE;
      selection_data.target = pair->target;
      selection_data.data = NULL;
      selection_data.length = -1;

Maybe that's all there is.  I was expecting to see someone storing
GTK_TREE_MODEL_ROW into target, which is what you get in the callback,
and makes gtk_tree_set_row_drag_data work.  Perhaps that happens
indirectly iterating through the "target list" built from row_targets[]
array in gtktreeview.c.

(I'm pretty fuzzy on the dnd.  At the X level it's pretty awful but
nearly understandable.  By the time gtk half buries it under two levels
of abstraction it's pretty hopeless :-)

Is there a way to automatically test this stuff?  Ross once wrote an attempt,
t/GtkTreeView-Dnd.t.  But it's not run by default since he saw no way to
synthesize the necessary events.

I guess that'd be the way, a bit like hard work though.



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