Blob Blame History Raw
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkTreeView drag-and-drop: GTK+ 2 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GTK+ 2 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.26.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#gtk2-GtkTreeView-drag-and-drop.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#gtk2-GtkTreeView-drag-and-drop.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_implementations">  <span class="dim">|</span> 
                  <a href="#gtk2-GtkTreeView-drag-and-drop.implementations" class="shortcut">Known Implementations</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="TreeWidgetObjects.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GtkTreeView.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GtkCellView.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gtk2-GtkTreeView-drag-and-drop"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk2-GtkTreeView-drag-and-drop.top_of_page"></a>GtkTreeView drag-and-drop</span></h2>
<p>GtkTreeView drag-and-drop</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gtk2-GtkTreeView-drag-and-drop.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#gtk-tree-drag-source-drag-data-delete" title="gtk_tree_drag_source_drag_data_delete ()">gtk_tree_drag_source_drag_data_delete</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#gtk-tree-drag-source-drag-data-get" title="gtk_tree_drag_source_drag_data_get ()">gtk_tree_drag_source_drag_data_get</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#gtk-tree-drag-source-row-draggable" title="gtk_tree_drag_source_row_draggable ()">gtk_tree_drag_source_row_draggable</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#gtk-tree-drag-dest-drag-data-received" title="gtk_tree_drag_dest_drag_data_received ()">gtk_tree_drag_dest_drag_data_received</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#gtk-tree-drag-dest-row-drop-possible" title="gtk_tree_drag_dest_row_drop_possible ()">gtk_tree_drag_dest_row_drop_possible</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#gtk-tree-set-row-drag-data" title="gtk_tree_set_row_drag_data ()">gtk_tree_set_row_drag_data</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#gtk-tree-get-row-drag-data" title="gtk_tree_get_row_drag_data ()">gtk_tree_get_row_drag_data</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<a name="GtkTreeDragSource"></a><a name="GtkTreeDragDest"></a><div class="refsect1">
<a name="gtk2-GtkTreeView-drag-and-drop.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragSource-struct" title="GtkTreeDragSource">GtkTreeDragSource</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragSourceIface" title="struct GtkTreeDragSourceIface">GtkTreeDragSourceIface</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragDest-struct" title="GtkTreeDragDest">GtkTreeDragDest</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragDestIface" title="struct GtkTreeDragDestIface">GtkTreeDragDestIface</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gtk2-GtkTreeView-drag-and-drop.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    <a href="/home/mclasen/gnome/share/gtk-doc/html/gobject/GTypeModule.html">GInterface</a>
    <span class="lineart">├──</span> GtkTreeDragDest
    <span class="lineart">╰──</span> GtkTreeDragSource
</pre>
</div>
<div class="refsect1">
<a name="gtk2-GtkTreeView-drag-and-drop.implementations"></a><h2>Known Implementations</h2>
<p>
GtkTreeDragSource is implemented by
 <a class="link" href="GtkListStore.html" title="GtkListStore">GtkListStore</a>,  <a class="link" href="GtkTreeModelFilter.html" title="GtkTreeModelFilter">GtkTreeModelFilter</a>,  <a class="link" href="GtkTreeModelSort.html" title="GtkTreeModelSort">GtkTreeModelSort</a> and  <a class="link" href="GtkTreeStore.html" title="GtkTreeStore">GtkTreeStore</a>.</p>
<p>
GtkTreeDragDest is implemented by
 <a class="link" href="GtkListStore.html" title="GtkListStore">GtkListStore</a> and  <a class="link" href="GtkTreeStore.html" title="GtkTreeStore">GtkTreeStore</a>.</p>
</div>
<div class="refsect1">
<a name="gtk2-GtkTreeView-drag-and-drop.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gtk/gtk.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="gtk2-GtkTreeView-drag-and-drop.description"></a><h2>Description</h2>
</div>
<div class="refsect1">
<a name="gtk2-GtkTreeView-drag-and-drop.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gtk-tree-drag-source-drag-data-delete"></a><h3>gtk_tree_drag_source_drag_data_delete ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_tree_drag_source_drag_data_delete (<em class="parameter"><code><a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a> *drag_source</code></em>,
                                       <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *path</code></em>);</pre>
<p>Asks the <a class="link" href="gtk2-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>
<div class="refsect3">
<a name="gtk-tree-drag-source-drag-data-delete.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>drag_source</p></td>
<td class="parameter_description"><p>a <a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>path</p></td>
<td class="parameter_description"><p>row that was being dragged</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-tree-drag-source-drag-data-delete.returns"></a><h4>Returns</h4>
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the row was successfully deleted</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-drag-source-drag-data-get"></a><h3>gtk_tree_drag_source_drag_data_get ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_tree_drag_source_drag_data_get (<em class="parameter"><code><a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a> *drag_source</code></em>,
                                    <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *path</code></em>,
                                    <em class="parameter"><code><a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> *selection_data</code></em>);</pre>
<p>Asks the <a class="link" href="gtk2-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-&gt;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>
<div class="refsect3">
<a name="gtk-tree-drag-source-drag-data-get.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>drag_source</p></td>
<td class="parameter_description"><p>a <a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>path</p></td>
<td class="parameter_description"><p>row that was dragged</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>selection_data</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> to fill with data
from the dragged row. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-tree-drag-source-drag-data-get.returns"></a><h4>Returns</h4>
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if data of the required type was provided </p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-drag-source-row-draggable"></a><h3>gtk_tree_drag_source_row_draggable ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_tree_drag_source_row_draggable (<em class="parameter"><code><a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a> *drag_source</code></em>,
                                    <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *path</code></em>);</pre>
<p>Asks the <a class="link" href="gtk2-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>
<div class="refsect3">
<a name="gtk-tree-drag-source-row-draggable.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>drag_source</p></td>
<td class="parameter_description"><p>a <a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>path</p></td>
<td class="parameter_description"><p>row on which user is initiating a drag</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-tree-drag-source-row-draggable.returns"></a><h4>Returns</h4>
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the row can be dragged</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-drag-dest-drag-data-received"></a><h3>gtk_tree_drag_dest_drag_data_received ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_tree_drag_dest_drag_data_received (<em class="parameter"><code><a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a> *drag_dest</code></em>,
                                       <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *dest</code></em>,
                                       <em class="parameter"><code><a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> *selection_data</code></em>);</pre>
<p>Asks the <a class="link" href="gtk2-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>
<div class="refsect3">
<a name="gtk-tree-drag-dest-drag-data-received.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>drag_dest</p></td>
<td class="parameter_description"><p>a <a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dest</p></td>
<td class="parameter_description"><p>row to drop in front of</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>selection_data</p></td>
<td class="parameter_description"><p>data to drop</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-tree-drag-dest-drag-data-received.returns"></a><h4>Returns</h4>
<p> whether a new row was created before position <em class="parameter"><code>dest</code></em>
</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-drag-dest-row-drop-possible"></a><h3>gtk_tree_drag_dest_row_drop_possible ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_tree_drag_dest_row_drop_possible (<em class="parameter"><code><a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a> *drag_dest</code></em>,
                                      <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *dest_path</code></em>,
                                      <em class="parameter"><code><a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> *selection_data</code></em>);</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>
<div class="refsect3">
<a name="gtk-tree-drag-dest-row-drop-possible.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>drag_dest</p></td>
<td class="parameter_description"><p>a <a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dest_path</p></td>
<td class="parameter_description"><p>destination row</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>selection_data</p></td>
<td class="parameter_description"><p>the data being dragged</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-tree-drag-dest-row-drop-possible.returns"></a><h4>Returns</h4>
<p> <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>
</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-set-row-drag-data"></a><h3>gtk_tree_set_row_drag_data ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_tree_set_row_drag_data (<em class="parameter"><code><a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> *selection_data</code></em>,
                            <em class="parameter"><code><a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> *tree_model</code></em>,
                            <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *path</code></em>);</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>
<div class="refsect3">
<a name="gtk-tree-set-row-drag-data.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>selection_data</p></td>
<td class="parameter_description"><p>some <a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>tree_model</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>path</p></td>
<td class="parameter_description"><p>a row in <em class="parameter"><code>tree_model</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-tree-set-row-drag-data.returns"></a><h4>Returns</h4>
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> had the proper target type to allow us to set a tree row</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-get-row-drag-data"></a><h3>gtk_tree_get_row_drag_data ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_tree_get_row_drag_data (<em class="parameter"><code><a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> *selection_data</code></em>,
                            <em class="parameter"><code><a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> **tree_model</code></em>,
                            <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> **path</code></em>);</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 class="link" href="gtk2-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 class="link" href="GtkTreeModel.html#gtk-tree-path-free" title="gtk_tree_path_free ()"><code class="function">gtk_tree_path_free()</code></a>.</p>
<div class="refsect3">
<a name="gtk-tree-get-row-drag-data.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>selection_data</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>tree_model</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>path</p></td>
<td class="parameter_description"><p>row in <em class="parameter"><code>tree_model</code></em>
. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-tree-get-row-drag-data.returns"></a><h4>Returns</h4>
<p> <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</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="gtk2-GtkTreeView-drag-and-drop.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GtkTreeDragSource-struct"></a><h3>GtkTreeDragSource</h3>
<pre class="programlisting">typedef struct _GtkTreeDragSource GtkTreeDragSource;</pre>
</div>
<hr>
<div class="refsect2">
<a name="GtkTreeDragSourceIface"></a><h3>struct GtkTreeDragSourceIface</h3>
<pre class="programlisting">struct GtkTreeDragSourceIface {
  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);
};
</pre>
</div>
<hr>
<div class="refsect2">
<a name="GtkTreeDragDest-struct"></a><h3>GtkTreeDragDest</h3>
<pre class="programlisting">typedef struct _GtkTreeDragDest GtkTreeDragDest;</pre>
</div>
<hr>
<div class="refsect2">
<a name="GtkTreeDragDestIface"></a><h3>struct GtkTreeDragDestIface</h3>
<pre class="programlisting">struct GtkTreeDragDestIface {
  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);
};
</pre>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.26.1</div>
</body>
</html>