TreeDragSource

Deprecated since version 4.10: List views use widgets to display their contents. You can use DragSource to implement a drag source

class TreeDragSource(*args, **kwargs)

Implementations: ListStore, TreeModelFilter, TreeModelSort, TreeStore

Interface for Drag-and-Drop destinations in GtkTreeView.

Methods

class TreeDragSource
drag_data_delete(path: TreePath) bool

Asks the GtkTreeDragSource to delete the row at path, because it was moved somewhere else via drag-and-drop. Returns False if the deletion fails because path no longer exists, or for some model-specific reason. Should robustly handle a path no longer found in the model!

Deprecated since version 4.10: Use list models instead

Parameters:

path – row that was being dragged

drag_data_get(path: TreePath) ContentProvider | None

Asks the GtkTreeDragSource to return a GdkContentProvider representing the row at path. Should robustly handle a path no longer found in the model!

Deprecated since version 4.10: Use list models instead

Parameters:

path – row that was dragged

row_draggable(path: TreePath) bool

Asks the GtkTreeDragSource whether a particular row can be used as the source of a DND operation. If the source doesn’t implement this interface, the row is assumed draggable.

Deprecated since version 4.10: Use list models instead

Parameters:

path – row on which user is initiating a drag

Virtual Methods

class TreeDragSource
do_drag_data_delete(path: TreePath) bool

Asks the GtkTreeDragSource to delete the row at path, because it was moved somewhere else via drag-and-drop. Returns False if the deletion fails because path no longer exists, or for some model-specific reason. Should robustly handle a path no longer found in the model!

Deprecated since version 4.10: Use list models instead

Parameters:

path – row that was being dragged

do_drag_data_get(path: TreePath) ContentProvider | None

Asks the GtkTreeDragSource to return a GdkContentProvider representing the row at path. Should robustly handle a path no longer found in the model!

Deprecated since version 4.10: Use list models instead

Parameters:

path – row that was dragged

do_row_draggable(path: TreePath) bool

Asks the GtkTreeDragSource whether a particular row can be used as the source of a DND operation. If the source doesn’t implement this interface, the row is assumed draggable.

Deprecated since version 4.10: Use list models instead

Parameters:

path – row on which user is initiating a drag