Cancel a Drag & Drop for some specific items in a Gtk.TreeView

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Cancel a Drag & Drop for some specific items in a Gtk.TreeView

Gtk+ - Apps Dev mailing list
I also opened this question on
https://stackoverflow.com/q/51974845/4865723

I have a Gtk.TreeView here. Most but not all of the items should be
able to be dragged & dropped. For example the first item should not be
able to be dragged & dropped but it should be selectable.

How can I realize this? Maybe I have to use the drag-begin signal and
stop the drag in there. But I don't know how.
_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Reply | Threaded
Open this post in threaded view
|

Re: Cancel a Drag & Drop for some specific items in a Gtk.TreeView

Gtk+ - Apps Dev mailing list
On 2018-09-11 13:50 Yuri Khan <[hidden email]> wrote:
> Reading the “GtkTreeView drag-and-drop”[1] page, I get the impression
> that you’d need to implement a wrapper around GtkTreeStore, or
> possibly a class derived from GtkTreeStore, that also overrides the
> row_draggable method so that it returns False for non-draggable rows.

Thanks for the hint.

It is Gtk.TreeView.do_row_draggable()

https://lazka.github.io/pgi-docs/Gtk-3.0/classes/TreeDragSource.html#Gtk.TreeDragSource.do_row_draggable

_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list