GTK4: gtk_tree_view_enable_model_drag_dest () and GdkContentFormats



Hi all,

I've done a port of a program to GTK4 (3.93.3); there is a part that I have not yet gotten to work and that is drag and drop inside a tree view.

I have particularly trouble understanding using the target formats inside gtk_tree_view_enable_model_drag_dest (). For the GTK 3 version I use a GtkTargetEntry structure initialised with {{ "STRING", GTK_TARGET_SAME_WIDGET, 0 }}, which has always worked fine so far. For GTK 4 I am supposed to use GdkContentFormats. But which mime types am I supposed to fill into gtk_content_formats_new ()? The tree store contains one element each of GDK_TYPE_PIXBUF and G_TYPE_UINT; the rest of the tree store consists of G_TYPE_STRING elements.

What I've essentialy done in GTK 3 is using
gtk_tree_view_enable_model_drag_dest (GTK_TREE_VIEW (treeview), enable_list, 1, GDK_ACTION_MOVE); (enable_list is the structure which I mentioned above).
together with
gtk_tree_view_enable_model_drag_source (GTK_TREE_VIEW (treeview), GDK_BUTTON1_MASK, enable_list, 1, GDK_ACTION_MOVE);

For testing of the GTK 4 version I've tried simply with "text/plain" as mime type in GdkContentFormat. I can't drag anything yet, and there is no warning or error message printed if I try to do so. I've done my testing on an installation of Siduction (Debian ustable distro) inside VirtualBox.


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