Guilherme Salgado wrote:

Hi!

Today I was playing around with dnd in the treeview and found that the
info passed to drag_data_get_cb(widget, drag_context, selection_data,
info, time, data) is always 0.
The same occurs with drag_data_received_cb(widget, drag_context, x, y,
selection_data, info, time, data):

From what i've learned in the tutorial, and when using dnd with other
widgets, the info value should be the third value of the target (i.e,
[('text/plain', flags, info)]) defined and passed to
treeview.enable_model_drag_{source,dest}(), shouldn't it?

I'm attaching a changed version of the treeviewdnd.py example from the
tutorial, that prints the selection_data.target and the info values
inside both functions. If you try it with different drag sources, you'll
see that the target changes while the info is still 0.

Do I misunderstood something or my observations are correct and I should
file a bug report?



I think it's the treeview dnd behavior. Try changing the info field of MY_TREE_MODEL_ROW to 42 and then do an internal row drag and drop. The drag_data_get sees the info field but the drag_data_received gets 0. Looks like treeview dnd doesn't play by these rules i.e. it doesn't register the targets with a gtk_widget_drag_dest_set() but keeps them internally and then does it's own matching. But it calls gtk_drag_begin() with its internal set of targets.

This probably arises from the mixing of the treeview dnd and widget dnd apis in the example. It's on my list to do a full widget dnd tutorial with good examples. Likely you have to implement the complete widget dnd and not use the treeview dnd to get full control and full information.

John

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to