Model drag and drop with sorted store



Hi guys,

Hope you are all doing fine.

I'm struggling with a drag'n'drop issue[1] and I think I now found out the root cause of my problems.

The attached file "test-dnd2.pl" is a simplified example of the issue : when you are using a Gtk3::TreeModelSort instead of the plain Gtk3::TreeStore, the drag and drop events "drag_data_received" and "drag_data_get" are not processed properly because Gtk::TreeModelSort does not implement [2] the GtkTreeDragDestIface [3] interface.

I suspect this is by design since Gtk::TreeModelSort is supposed to be a "read only" view to the underlying model [4].

As I need both to have that Gtk::TreeModelSort and drag'n'drop ... I'm feeling a bit stuck with this and was wondering what would be the proper solution for this ?

Thanks for any tip and suggestion.

(note: I tried to override Gtk::TreeModelSort and implement GtkTreeDragDestIface myself but I'm hitting so other issues ; will described this in a separate thread)

  Gaëtan


[1] https://github.com/asbru-cm/asbru-cm/issues/167
[2] https://gitlab.gnome.org/GNOME/gtk/-/blob/master/gtk/gtktreemodelsort.c
[3] https://developer.gnome.org/gtk3/stable/gtk3-GtkTreeView-drag-and-drop.html#GtkTreeDragDestIface
[4] https://gitlab.gnome.org/GNOME/gtk/-/issues/2293#note_661619

Attachment: test-dnd2.pl
Description: Perl program



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