gtktreeview dnd



Hello,

I'm trying to get a drag'n'drop of a row between two tree views. 
The lack of documentation in the Gtk+-2.2 API reference on this subject
makes this difficult to make for me.

I tried this :
1) define :
  static GtkTargetEntry row_targets[] = {
    { "GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_WIDGET, 0 }
  };

2) enable drag on the source tree view
  gtk_tree_view_enable_model_drag_source( GTK_TREE_VIEW(treeview),
       GDK_BUTTON1_MASK,  row_targets, G_N_ELEMENTS(row_targets), 
       GDK_ACTION_COPY);

3) enable drop on the destination tree view
  gtk_tree_view_enable_model_drag_dest( GTK_TREE_VIEW(treeview_dest),
       row_targets, G_N_ELEMENTS(row_targets), GDK_ACTION_COPY);

4) add a callback that does some simple action (prints a text) when the
event "drag_data_received" is detected on the dest treeview.

The result is that I can drag, but I cannot drop on the dest treeview
(there is not the little '+' sign, and it does absolutely nothing).
If you can give me any clue...

Note that I'd like to use this treeview-specific drag and drop system, and
not the general dnd system (I know there are tutorials on the general dnd
system but I couldn't find any concerning the treeview-specific dnd).

Thanks in advance,
Clement.

-- 
Clement Bourdarias
cbour mangoquest org
http://icculus.org/~phneutre



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