Synopsis
#include <gtk/gtk.h>
GtkTreeDragSource;
GtkTreeDragSourceIface;
gboolean gtk_tree_drag_source_drag_data_delete
(GtkTreeDragSource *drag_source,
GtkTreePath *path);
gboolean gtk_tree_drag_source_drag_data_get (GtkTreeDragSource *drag_source,
GtkTreePath *path,
GtkSelectionData *selection_data);
gboolean gtk_tree_drag_source_row_draggable (GtkTreeDragSource *drag_source,
GtkTreePath *path);
GtkTreeDragDest;
GtkTreeDragDestIface;
gboolean gtk_tree_drag_dest_drag_data_received
(GtkTreeDragDest *drag_dest,
GtkTreePath *dest,
GtkSelectionData *selection_data);
gboolean gtk_tree_drag_dest_row_drop_possible
(GtkTreeDragDest *drag_dest,
GtkTreePath *dest_path,
GtkSelectionData *selection_data);
gboolean gtk_tree_set_row_drag_data (GtkSelectionData *selection_data,
GtkTreeModel *tree_model,
GtkTreePath *path);
gboolean gtk_tree_get_row_drag_data (GtkSelectionData *selection_data,
GtkTreeModel **tree_model,
GtkTreePath **path);
Known ImplementationsGtkTreeDragSource is implemented by GtkTreeModelFilter, GtkTreeModelSort, GtkTreeStore and GtkListStore. GtkTreeDragDest is implemented by GtkTreeStore and GtkListStore. DescriptionGTK+ supports Drag-and-Drop in tree views with a high-level and a low-level API.
The low-level API consists of the GTK+ DND API, augmented by some treeview
utility functions: On the other hand, if you write to the high-level API, then all the bookkeeping of rows is done for you, as well as things like hover-to-open and auto-scroll, but your models have to implement the GtkTreeDragSource and GtkTreeDragDest interfaces. DetailsGtkTreeDragSourceIfacetypedef struct {
GTypeInterface g_iface;
/* VTable - not signals */
gboolean (* row_draggable) (GtkTreeDragSource *drag_source,
GtkTreePath *path);
gboolean (* drag_data_get) (GtkTreeDragSource *drag_source,
GtkTreePath *path,
GtkSelectionData *selection_data);
gboolean (* drag_data_delete) (GtkTreeDragSource *drag_source,
GtkTreePath *path);
} GtkTreeDragSourceIface;
gtk_tree_drag_source_drag_data_delete ()gboolean gtk_tree_drag_source_drag_data_delete
(GtkTreeDragSource *drag_source,
GtkTreePath *path);
Asks the GtkTreeDragSource to delete the row at
gtk_tree_drag_source_drag_data_get ()gboolean gtk_tree_drag_source_drag_data_get (GtkTreeDragSource *drag_source, GtkTreePath *path, GtkSelectionData *selection_data);
Asks the GtkTreeDragSource to fill in
gtk_tree_drag_source_row_draggable ()gboolean gtk_tree_drag_source_row_draggable (GtkTreeDragSource *drag_source, GtkTreePath *path); 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.
GtkTreeDragDestIfacetypedef struct {
GTypeInterface g_iface;
/* VTable - not signals */
gboolean (* drag_data_received) (GtkTreeDragDest *drag_dest,
GtkTreePath *dest,
GtkSelectionData *selection_data);
gboolean (* row_drop_possible) (GtkTreeDragDest *drag_dest,
GtkTreePath *dest_path,
GtkSelectionData *selection_data);
} GtkTreeDragDestIface;
gtk_tree_drag_dest_drag_data_received ()gboolean gtk_tree_drag_dest_drag_data_received
(GtkTreeDragDest *drag_dest,
GtkTreePath *dest,
GtkSelectionData *selection_data);
Asks the GtkTreeDragDest to insert a row before the path
gtk_tree_drag_dest_row_drop_possible ()gboolean gtk_tree_drag_dest_row_drop_possible
(GtkTreeDragDest *drag_dest,
GtkTreePath *dest_path,
GtkSelectionData *selection_data);
Determines whether a drop is possible before the given
gtk_tree_set_row_drag_data ()gboolean gtk_tree_set_row_drag_data (GtkSelectionData *selection_data, GtkTreeModel *tree_model, GtkTreePath *path);
Sets selection data of target type
gtk_tree_get_row_drag_data ()gboolean gtk_tree_get_row_drag_data (GtkSelectionData *selection_data, GtkTreeModel **tree_model, GtkTreePath **path);
Obtains a
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||