Dual Drop on to GtkTreeView



Hi,

I'm developing an application with a GtkTreeView, and I would like users to be able to drag and drop files onto it from Nautilus and rearrange the order of those files by dragging items around in the GtkTreeView itself. I can do either one or the other, but not both. The code I'm using is below:

        store = gtk_list_store_new (N_AUDIO_COLUMNS,
                        G_TYPE_STRING,
                        G_TYPE_STRING,
                        G_TYPE_STRING,
                        G_TYPE_STRING);
        
        view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));

gtk_drag_dest_set (view, GTK_DEST_DEFAULT_ALL, target_table, G_N_ELEMENTS (target_table), GDK_ACTION_COPY); g_signal_connect (G_OBJECT (view), "drag_data_received", G_CALLBACK (drag_audio_rcv_cb), store);
        gtk_tree_view_set_reorderable (GTK_TREE_VIEW (view), TRUE);


If I comment out the call to gtk_tree_view_set_reorderable, I can drag files into the list; if I comment out the gtk_drag_dest_set call, I can rearrange the list items. Is there any way to do both?

Todd




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