File: //usr/share/gtk-doc/html/gtk/gtk-GtkTreeView-drag-and-drop.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>GtkTreeView drag-and-drop</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="GTK+ Reference Manual">
<link rel="up" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets">
<link rel="prev" href="GtkTreeView.html" title="GtkTreeView">
<link rel="next" href="GtkCellView.html" title="GtkCellView">
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="part" href="gtk.html" title="Part I. GTK+ Overview">
<link rel="part" href="gtkbase.html" title="Part II. GTK+ Core Reference">
<link rel="part" href="gtkobjects.html" title="Part III. GTK+ Widgets and Objects">
<link rel="chapter" href="ch01.html" title="Object Hierarchy">
<link rel="chapter" href="ch02.html" title="Widget Gallery">
<link rel="chapter" href="WindowWidgets.html" title="Windows">
<link rel="chapter" href="DisplayWidgets.html" title="Display Widgets">
<link rel="chapter" href="ButtonWidgets.html" title="Buttons and Toggles">
<link rel="chapter" href="NumericEntry.html" title="Numeric/Text Data Entry">
<link rel="chapter" href="TextWidgetObjects.html" title="Multiline Text Editor">
<link rel="chapter" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets">
<link rel="chapter" href="MenusAndCombos.html" title="Menus, Combo Box, Toolbar">
<link rel="chapter" href="Actions.html" title="Action-based menus and toolbars">
<link rel="chapter" href="SelectorWidgets.html" title="Selectors (File/Font/Color/Input Devices)">
<link rel="chapter" href="LayoutContainers.html" title="Layout Containers">
<link rel="chapter" href="Ornaments.html" title="Ornaments">
<link rel="chapter" href="ScrollingWidgets.html" title="Scrolling">
<link rel="chapter" href="Printing.html" title="Printing">
<link rel="chapter" href="MiscObjects.html" title="Miscellaneous">
<link rel="chapter" href="AbstractObjects.html" title="Abstract Base Classes">
<link rel="chapter" href="PlugSocket.html" title="Cross-process Embedding">
<link rel="chapter" href="SpecialObjects.html" title="Special-purpose features">
<link rel="chapter" href="RecentDocuments.html" title="Recently Used Documents">
<link rel="chapter" href="DeprecatedObjects.html" title="Deprecated">
<link rel="part" href="migrating.html" title="Part IV. Migrating from Previous Versions of GTK+">
<link rel="chapter" href="gtk-migrating-checklist.html" title="Migration Checklist">
<link rel="chapter" href="gtk-migrating-GtkFileChooser.html" title="Migrating from GtkFileSelection to GtkFileChooser">
<link rel="chapter" href="gtk-migrating-GtkAction.html" title="Migrating from old menu and toolbar systems to GtkAction">
<link rel="chapter" href="gtk-migrating-GtkComboBox.html" title="Migrating from GtkOptionMenu and GtkCombo to GtkComboBox and
GtkComboBoxEntry">
<link rel="chapter" href="gtk-migrating-GtkIconView.html" title="Migrating from GnomeIconList to GtkIconView">
<link rel="chapter" href="gtk-migrating-GtkAboutDialog.html" title="Migrating from GnomeAbout to GtkAboutDialog">
<link rel="chapter" href="gtk-migrating-GtkColorButton.html" title="Migrating from GnomeColorPicker to GtkColorButton">
<link rel="chapter" href="gtk-migrating-GtkAssistant.html" title="Migrating from GnomeDruid to GtkAssistant">
<link rel="chapter" href="gtk-migrating-GtkRecentChooser.html" title="Migrating from EggRecent to GtkRecentChooser">
<link rel="chapter" href="gtk-migrating-GtkLinkButton.html" title="Migrating from GnomeHRef to GtkLinkButton">
<link rel="part" href="pt05.html" title="Part V. GTK+ Tools">
<link rel="glossary" href="glossary.html" title="Glossary">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="GtkTreeView.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="TreeWidgetObjects.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ Reference Manual</th>
<td><a accesskey="n" href="GtkCellView.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3165450" class="shortcut">Top</a>
 | 
<a href="#id3165873" class="shortcut">Description</a>
 | 
<a href="#id3165772" class="shortcut">Object Hierarchy</a>
 | 
<a href="#id3165810" class="shortcut">Known Implementations</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="gtk-GtkTreeView-drag-and-drop"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id3165450"></a><span class="refentrytitle">GtkTreeView drag-and-drop</span>
</h2>
<p>GtkTreeView drag-and-drop — Interfaces for drag-and-drop support in GtkTreeView</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<a name="GtkTreeDragSource"></a><a name="GtkTreeDragDest"></a><pre class="synopsis">
#include <gtk/gtk.h>
<a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource-struct">GtkTreeDragSource</a>;
<a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSourceIface">GtkTreeDragSourceIface</a>;
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-drag-source-drag-data-delete">gtk_tree_drag_source_drag_data_delete</a>
(<a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource">GtkTreeDragSource</a> *drag_source,
<a href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *path);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-drag-source-drag-data-get">gtk_tree_drag_source_drag_data_get</a>
(<a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource">GtkTreeDragSource</a> *drag_source,
<a href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *path,
<a href="GtkWidget.html#GtkSelectionData">GtkSelectionData</a> *selection_data);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-drag-source-row-draggable">gtk_tree_drag_source_row_draggable</a>
(<a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource">GtkTreeDragSource</a> *drag_source,
<a href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *path);
<a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest-struct">GtkTreeDragDest</a>;
<a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDestIface">GtkTreeDragDestIface</a>;
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-drag-dest-drag-data-received">gtk_tree_drag_dest_drag_data_received</a>
(<a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest">GtkTreeDragDest</a> *drag_dest,
<a href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *dest,
<a href="GtkWidget.html#GtkSelectionData">GtkSelectionData</a> *selection_data);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-drag-dest-row-drop-possible">gtk_tree_drag_dest_row_drop_possible</a>
(<a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest">GtkTreeDragDest</a> *drag_dest,
<a href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *dest_path,
<a href="GtkWidget.html#GtkSelectionData">GtkSelectionData</a> *selection_data);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-set-row-drag-data">gtk_tree_set_row_drag_data</a> (<a href="GtkWidget.html#GtkSelectionData">GtkSelectionData</a> *selection_data,
<a href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> *tree_model,
<a href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *path);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-get-row-drag-data">gtk_tree_get_row_drag_data</a> (<a href="GtkWidget.html#GtkSelectionData">GtkSelectionData</a> *selection_data,
<a href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> **tree_model,
<a href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> **path);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3165772"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
GInterface
+----GtkTreeDragSource
</pre>
<pre class="synopsis">
GInterface
+----GtkTreeDragDest
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3165810"></a><h2>Known Implementations</h2>
<p>
GtkTreeDragSource is implemented by
<a href="GtkTreeModelSort.html" title="GtkTreeModelSort">GtkTreeModelSort</a>, <a href="GtkTreeStore.html" title="GtkTreeStore">GtkTreeStore</a>, <a href="GtkListStore.html" title="GtkListStore">GtkListStore</a> and <a href="GtkTreeModelFilter.html" title="GtkTreeModelFilter">GtkTreeModelFilter</a>.</p>
<p>
GtkTreeDragDest is implemented by
<a href="GtkTreeStore.html" title="GtkTreeStore">GtkTreeStore</a> and <a href="GtkListStore.html" title="GtkListStore">GtkListStore</a>.</p>
</div>
<div class="refsect1" lang="en">
<a name="id3165873"></a><h2>Description</h2>
<p>
GTK+ supports Drag-and-Drop in tree views with a high-level and a low-level
API.
</p>
<p>
The low-level API consists of the GTK+ DND API, augmented by some treeview
utility functions: <a href="GtkTreeView.html#gtk-tree-view-set-drag-dest-row"><code class="function">gtk_tree_view_set_drag_dest_row()</code></a>,
<a href="GtkTreeView.html#gtk-tree-view-get-drag-dest-row"><code class="function">gtk_tree_view_get_drag_dest_row()</code></a>, <a href="GtkTreeView.html#gtk-tree-view-get-dest-row-at-pos"><code class="function">gtk_tree_view_get_dest_row_at_pos()</code></a>,
<a href="GtkTreeView.html#gtk-tree-view-create-row-drag-icon"><code class="function">gtk_tree_view_create_row_drag_icon()</code></a>, <a href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-set-row-drag-data"><code class="function">gtk_tree_set_row_drag_data()</code></a> and
<a href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-get-row-drag-data"><code class="function">gtk_tree_get_row_drag_data()</code></a>. This API leaves a lot of flexibility, but
nothing is done automatically, and implementing advanced features like
hover-to-open-rows or autoscrolling on top of this API is a lot of work.
</p>
<p>
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
<a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a> and <a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a> interfaces.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id3165988"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id3165998"></a><h3>
<a name="GtkTreeDragSource-struct"></a>GtkTreeDragSource</h3>
<a class="indexterm" name="id3166011"></a><pre class="programlisting">typedef struct _GtkTreeDragSource GtkTreeDragSource;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3166027"></a><h3>
<a name="GtkTreeDragSourceIface"></a>GtkTreeDragSourceIface</h3>
<a class="indexterm" name="id3166040"></a><pre class="programlisting">typedef 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;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3166065"></a><h3>
<a name="gtk-tree-drag-source-drag-data-delete"></a>gtk_tree_drag_source_drag_data_delete ()</h3>
<a class="indexterm" name="id3166079"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gtk_tree_drag_source_drag_data_delete
(<a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource">GtkTreeDragSource</a> *drag_source,
<a href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *path);</pre>
<p>
Asks the <a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a> to delete the row at <em class="parameter"><code>path</code></em>, because
it was moved somewhere else via drag-and-drop. Returns <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a>
if the deletion fails because <em class="parameter"><code>path</code></em> no longer exists, or for
some model-specific reason. Should robustly handle a <em class="parameter"><code>path</code></em> no
longer found in the model!</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>drag_source</code></em> :</span></td>
<td> a <a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>path</code></em> :</span></td>
<td> row that was being dragged
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the row was successfully deleted
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3166221"></a><h3>
<a name="gtk-tree-drag-source-drag-data-get"></a>gtk_tree_drag_source_drag_data_get ()</h3>
<a class="indexterm" name="id3166236"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gtk_tree_drag_source_drag_data_get
(<a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource">GtkTreeDragSource</a> *drag_source,
<a href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *path,
<a href="GtkWidget.html#GtkSelectionData">GtkSelectionData</a> *selection_data);</pre>
<p>
Asks the <a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a> to fill in <em class="parameter"><code>selection_data</code></em> with a
representation of the row at <em class="parameter"><code>path</code></em>. <em class="parameter"><code>selection_data->target</code></em> gives
the required type of the data. Should robustly handle a <em class="parameter"><code>path</code></em> no
longer found in the model!</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>drag_source</code></em> :</span></td>
<td> a <a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>path</code></em> :</span></td>
<td> row that was dragged
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>selection_data</code></em> :</span></td>
<td> a <a href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> to fill with data from the dragged row
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if data of the required type was provided
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3166402"></a><h3>
<a name="gtk-tree-drag-source-row-draggable"></a>gtk_tree_drag_source_row_draggable ()</h3>
<a class="indexterm" name="id3166416"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gtk_tree_drag_source_row_draggable
(<a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource">GtkTreeDragSource</a> *drag_source,
<a href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *path);</pre>
<p>
Asks the <a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a> 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.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>drag_source</code></em> :</span></td>
<td> a <a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>path</code></em> :</span></td>
<td> row on which user is initiating a drag
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the row can be dragged
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3166528"></a><h3>
<a name="GtkTreeDragDest-struct"></a>GtkTreeDragDest</h3>
<a class="indexterm" name="id3166541"></a><pre class="programlisting">typedef struct _GtkTreeDragDest GtkTreeDragDest;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3166557"></a><h3>
<a name="GtkTreeDragDestIface"></a>GtkTreeDragDestIface</h3>
<a class="indexterm" name="id3166570"></a><pre class="programlisting">typedef 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;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3166593"></a><h3>
<a name="gtk-tree-drag-dest-drag-data-received"></a>gtk_tree_drag_dest_drag_data_received ()</h3>
<a class="indexterm" name="id3166607"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gtk_tree_drag_dest_drag_data_received
(<a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest">GtkTreeDragDest</a> *drag_dest,
<a href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *dest,
<a href="GtkWidget.html#GtkSelectionData">GtkSelectionData</a> *selection_data);</pre>
<p>
Asks the <a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a> to insert a row before the path <em class="parameter"><code>dest</code></em>,
deriving the contents of the row from <em class="parameter"><code>selection_data</code></em>. If <em class="parameter"><code>dest</code></em> is
outside the tree so that inserting before it is impossible, <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a>
will be returned. Also, <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> may be returned if the new row is
not created for some model-specific reason. Should robustly handle
a <em class="parameter"><code>dest</code></em> no longer found in the model!</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>drag_dest</code></em> :</span></td>
<td> a <a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest</code></em> :</span></td>
<td> row to drop in front of
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>selection_data</code></em> :</span></td>
<td> data to drop
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> whether a new row was created before position <em class="parameter"><code>dest</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3166784"></a><h3>
<a name="gtk-tree-drag-dest-row-drop-possible"></a>gtk_tree_drag_dest_row_drop_possible ()</h3>
<a class="indexterm" name="id3166798"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gtk_tree_drag_dest_row_drop_possible
(<a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest">GtkTreeDragDest</a> *drag_dest,
<a href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *dest_path,
<a href="GtkWidget.html#GtkSelectionData">GtkSelectionData</a> *selection_data);</pre>
<p>
Determines whether a drop is possible before the given <em class="parameter"><code>dest_path</code></em>,
at the same depth as <em class="parameter"><code>dest_path</code></em>. i.e., can we drop the data in
<em class="parameter"><code>selection_data</code></em> at that location. <em class="parameter"><code>dest_path</code></em> does not have to
exist; the return value will almost certainly be <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> if the
parent of <em class="parameter"><code>dest_path</code></em> doesn't exist, though.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>drag_dest</code></em> :</span></td>
<td> a <a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest_path</code></em> :</span></td>
<td> destination row
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>selection_data</code></em> :</span></td>
<td> the data being dragged
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if a drop is possible before <em class="parameter"><code>dest_path</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3166971"></a><h3>
<a name="gtk-tree-set-row-drag-data"></a>gtk_tree_set_row_drag_data ()</h3>
<a class="indexterm" name="id3166985"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gtk_tree_set_row_drag_data (<a href="GtkWidget.html#GtkSelectionData">GtkSelectionData</a> *selection_data,
<a href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> *tree_model,
<a href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *path);</pre>
<p>
Sets selection data of target type <code class="literal">GTK_TREE_MODEL_ROW</code>. Normally used
in a drag_data_get handler.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>selection_data</code></em> :</span></td>
<td> some <a href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>tree_model</code></em> :</span></td>
<td> a <a href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>path</code></em> :</span></td>
<td> a row in <em class="parameter"><code>tree_model</code></em>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the <a href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> had the proper target type to allow us to set a tree row
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3167144"></a><h3>
<a name="gtk-tree-get-row-drag-data"></a>gtk_tree_get_row_drag_data ()</h3>
<a class="indexterm" name="id3167156"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gtk_tree_get_row_drag_data (<a href="GtkWidget.html#GtkSelectionData">GtkSelectionData</a> *selection_data,
<a href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> **tree_model,
<a href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> **path);</pre>
<p>
Obtains a <em class="parameter"><code>tree_model</code></em> and <em class="parameter"><code>path</code></em> from selection data of target type
<code class="literal">GTK_TREE_MODEL_ROW</code>. Normally called from a drag_data_received handler.
This function can only be used if <em class="parameter"><code>selection_data</code></em> originates from the same
process that's calling this function, because a pointer to the tree model
is being passed around. If you aren't in the same process, then you'll
get memory corruption. In the <a href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a> drag_data_received handler,
you can assume that selection data of type <code class="literal">GTK_TREE_MODEL_ROW</code> is
in from the current process. The returned path must be freed with
<a href="GtkTreeModel.html#gtk-tree-path-free"><code class="function">gtk_tree_path_free()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>selection_data</code></em> :</span></td>
<td> a <a href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>tree_model</code></em> :</span></td>
<td> a <a href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>path</code></em> :</span></td>
<td> row in <em class="parameter"><code>tree_model</code></em>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if <em class="parameter"><code>selection_data</code></em> had target type <code class="literal">GTK_TREE_MODEL_ROW</code> and
is otherwise valid
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</body>
</html>