Re: Dual Drop on to GtkTreeView



On Wed, 2003-06-25 at 16:58, Todd Kulesza wrote:
      view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));

      gtk_drag_dest_set (view, GTK_DEST_DEFAULT_ALL, target_table, 

remove that dest_set call...

gtk_tree_view_enable_model_drag_dest ()
gtk_tree_view_enable_model_drag_source ()

and use these instead.

gtk_tree_xx_drag_source (GTK_TREE_VIEW (view),
                                        GDK_BUTTON1_MASK,
                                        target_table,
                                        G_N_ELEMENTS (target_table),
                                        GDK_ACTION_MOVE|GDK_ACTION_COPY);

gtk_tree_xx_drag_dest (GTK_TREE_VIEW (view),
                                      target_table,
                                      G_N_ELEMENTS (target_table),
                                      GDK_ACTION_MOVE|GDK_ACTION_COPY);


this enables that you drag and drop stuff inside your view. now add the
'drag-data-received' signal to it, as you did, with that you should be
able to get the with gtk_tree_view_get_drag_dest_row so you can store
your drag from nautilus there. if you autoreorder things then you dont
need gtk_tree_view_get_drag_dest you can simply insert the new row in
your view and have it sorted automatically.

hope this helps. i assume your target_table is set up correctly. there
is no further stuff needed as in connecting a source or other dest.




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