1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>GtkTreeView drag-and-drop</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
7
<link rel="home" href="index.html" title="GTK+ 2 Reference Manual">
8
<link rel="up" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets">
9
<link rel="prev" href="GtkTreeView.html" title="GtkTreeView">
10
<link rel="next" href="GtkCellView.html" title="GtkCellView">
11
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17
<td><a accesskey="p" href="GtkTreeView.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18
<td><a accesskey="u" href="TreeWidgetObjects.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20
<th width="100%" align="center">GTK+ 2 Reference Manual</th>
21
<td><a accesskey="n" href="GtkCellView.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23
<tr><td colspan="5" class="shortcuts">
24
<a href="#gtk2-GtkTreeView-drag-and-drop.synopsis" class="shortcut">Top</a>
26
<a href="#gtk2-GtkTreeView-drag-and-drop.description" class="shortcut">Description</a>
28
<a href="#gtk2-GtkTreeView-drag-and-drop.object-hierarchy" class="shortcut">Object Hierarchy</a>
30
<a href="#gtk2-GtkTreeView-drag-and-drop.implementations" class="shortcut">Known Implementations</a>
33
<div class="refentry">
34
<a name="gtk2-GtkTreeView-drag-and-drop"></a><div class="titlepage"></div>
35
<div class="refnamediv"><table width="100%"><tr>
37
<h2><span class="refentrytitle"><a name="gtk2-GtkTreeView-drag-and-drop.top_of_page"></a>GtkTreeView drag-and-drop</span></h2>
38
<p>GtkTreeView drag-and-drop — Interfaces for drag-and-drop support in GtkTreeView</p>
40
<td valign="top" align="right"></td>
42
<div class="refsynopsisdiv">
43
<a name="gtk2-GtkTreeView-drag-and-drop.synopsis"></a><h2>Synopsis</h2>
44
<a name="GtkTreeDragSource"></a><a name="GtkTreeDragDest"></a><pre class="synopsis">
45
#include <gtk/gtk.h>
47
<a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragSource-struct" title="GtkTreeDragSource">GtkTreeDragSource</a>;
48
struct <a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragSourceIface" title="struct GtkTreeDragSourceIface">GtkTreeDragSourceIface</a>;
49
<span class="returnvalue">gboolean</span> <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>
50
(<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>,
51
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *path</code></em>);
52
<span class="returnvalue">gboolean</span> <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> (<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>,
53
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *path</code></em>,
54
<em class="parameter"><code><a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> *selection_data</code></em>);
55
<span class="returnvalue">gboolean</span> <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> (<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>,
56
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *path</code></em>);
57
<a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragDest-struct" title="GtkTreeDragDest">GtkTreeDragDest</a>;
58
struct <a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragDestIface" title="struct GtkTreeDragDestIface">GtkTreeDragDestIface</a>;
59
<span class="returnvalue">gboolean</span> <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>
60
(<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>,
61
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *dest</code></em>,
62
<em class="parameter"><code><a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> *selection_data</code></em>);
63
<span class="returnvalue">gboolean</span> <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>
64
(<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>,
65
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *dest_path</code></em>,
66
<em class="parameter"><code><a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> *selection_data</code></em>);
67
<span class="returnvalue">gboolean</span> <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> (<em class="parameter"><code><a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> *selection_data</code></em>,
68
<em class="parameter"><code><a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> *tree_model</code></em>,
69
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *path</code></em>);
70
<span class="returnvalue">gboolean</span> <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> (<em class="parameter"><code><a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> *selection_data</code></em>,
71
<em class="parameter"><code><a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> **tree_model</code></em>,
72
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> **path</code></em>);
75
<div class="refsect1">
76
<a name="gtk2-GtkTreeView-drag-and-drop.object-hierarchy"></a><h2>Object Hierarchy</h2>
77
<pre class="synopsis">
79
+----GtkTreeDragSource
81
<pre class="synopsis">
86
<div class="refsect1">
87
<a name="gtk2-GtkTreeView-drag-and-drop.implementations"></a><h2>Known Implementations</h2>
89
GtkTreeDragSource is implemented by
90
<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>
92
GtkTreeDragDest is implemented by
93
<a class="link" href="GtkListStore.html" title="GtkListStore">GtkListStore</a> and <a class="link" href="GtkTreeStore.html" title="GtkTreeStore">GtkTreeStore</a>.</p>
95
<div class="refsect1">
96
<a name="gtk2-GtkTreeView-drag-and-drop.description"></a><h2>Description</h2>
98
GTK+ supports Drag-and-Drop in tree views with a high-level and a low-level
102
The low-level API consists of the GTK+ DND API, augmented by some treeview
103
utility functions: <a class="link" href="GtkTreeView.html#gtk-tree-view-set-drag-dest-row" title="gtk_tree_view_set_drag_dest_row ()"><code class="function">gtk_tree_view_set_drag_dest_row()</code></a>,
104
<a class="link" href="GtkTreeView.html#gtk-tree-view-get-drag-dest-row" title="gtk_tree_view_get_drag_dest_row ()"><code class="function">gtk_tree_view_get_drag_dest_row()</code></a>, <a class="link" href="GtkTreeView.html#gtk-tree-view-get-dest-row-at-pos" title="gtk_tree_view_get_dest_row_at_pos ()"><code class="function">gtk_tree_view_get_dest_row_at_pos()</code></a>,
105
<a class="link" href="GtkTreeView.html#gtk-tree-view-create-row-drag-icon" title="gtk_tree_view_create_row_drag_icon ()"><code class="function">gtk_tree_view_create_row_drag_icon()</code></a>, <a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#gtk-tree-set-row-drag-data" title="gtk_tree_set_row_drag_data ()"><code class="function">gtk_tree_set_row_drag_data()</code></a> and
106
<a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#gtk-tree-get-row-drag-data" title="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
107
nothing is done automatically, and implementing advanced features like
108
hover-to-open-rows or autoscrolling on top of this API is a lot of work.
111
On the other hand, if you write to the high-level API, then all the
112
bookkeeping of rows is done for you, as well as things like hover-to-open
113
and auto-scroll, but your models have to implement the
114
<a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a> and <a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a> interfaces.
117
<div class="refsect1">
118
<a name="gtk2-GtkTreeView-drag-and-drop.details"></a><h2>Details</h2>
119
<div class="refsect2">
120
<a name="GtkTreeDragSource-struct"></a><h3>GtkTreeDragSource</h3>
121
<pre class="programlisting">typedef struct _GtkTreeDragSource GtkTreeDragSource;</pre>
126
<div class="refsect2">
127
<a name="GtkTreeDragSourceIface"></a><h3>struct GtkTreeDragSourceIface</h3>
128
<pre class="programlisting">struct GtkTreeDragSourceIface {
129
GTypeInterface g_iface;
131
/* VTable - not signals */
133
gboolean (* row_draggable) (GtkTreeDragSource *drag_source,
136
gboolean (* drag_data_get) (GtkTreeDragSource *drag_source,
138
GtkSelectionData *selection_data);
140
gboolean (* drag_data_delete) (GtkTreeDragSource *drag_source,
148
<div class="refsect2">
149
<a name="gtk-tree-drag-source-drag-data-delete"></a><h3>gtk_tree_drag_source_drag_data_delete ()</h3>
150
<pre class="programlisting"><span class="returnvalue">gboolean</span> gtk_tree_drag_source_drag_data_delete
151
(<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>,
152
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *path</code></em>);</pre>
154
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
155
it was moved somewhere else via drag-and-drop. Returns <code class="literal">FALSE</code>
156
if the deletion fails because <em class="parameter"><code>path</code></em> no longer exists, or for
157
some model-specific reason. Should robustly handle a <em class="parameter"><code>path</code></em> no
158
longer found in the model!
160
<div class="variablelist"><table border="0" class="variablelist">
162
<col align="left" valign="top">
167
<td><p><span class="term"><em class="parameter"><code>drag_source</code></em> :</span></p></td>
168
<td>a <a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a>
172
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
173
<td>row that was being dragged</td>
176
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
178
<code class="literal">TRUE</code> if the row was successfully deleted</td>
184
<div class="refsect2">
185
<a name="gtk-tree-drag-source-drag-data-get"></a><h3>gtk_tree_drag_source_drag_data_get ()</h3>
186
<pre class="programlisting"><span class="returnvalue">gboolean</span> 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>,
187
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *path</code></em>,
188
<em class="parameter"><code><a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> *selection_data</code></em>);</pre>
190
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
191
representation of the row at <em class="parameter"><code>path</code></em>. <em class="parameter"><code>selection_data->target</code></em> gives
192
the required type of the data. Should robustly handle a <em class="parameter"><code>path</code></em> no
193
longer found in the model!
195
<div class="variablelist"><table border="0" class="variablelist">
197
<col align="left" valign="top">
202
<td><p><span class="term"><em class="parameter"><code>drag_source</code></em> :</span></p></td>
203
<td>a <a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a>
207
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
208
<td>row that was dragged</td>
211
<td><p><span class="term"><em class="parameter"><code>selection_data</code></em> :</span></p></td>
212
<td>a <a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> to fill with data
213
from the dragged row. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
217
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
219
<code class="literal">TRUE</code> if data of the required type was provided</td>
225
<div class="refsect2">
226
<a name="gtk-tree-drag-source-row-draggable"></a><h3>gtk_tree_drag_source_row_draggable ()</h3>
227
<pre class="programlisting"><span class="returnvalue">gboolean</span> 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>,
228
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *path</code></em>);</pre>
230
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
231
the source of a DND operation. If the source doesn't implement
232
this interface, the row is assumed draggable.
234
<div class="variablelist"><table border="0" class="variablelist">
236
<col align="left" valign="top">
241
<td><p><span class="term"><em class="parameter"><code>drag_source</code></em> :</span></p></td>
242
<td>a <a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a>
246
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
247
<td>row on which user is initiating a drag</td>
250
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
252
<code class="literal">TRUE</code> if the row can be dragged</td>
258
<div class="refsect2">
259
<a name="GtkTreeDragDest-struct"></a><h3>GtkTreeDragDest</h3>
260
<pre class="programlisting">typedef struct _GtkTreeDragDest GtkTreeDragDest;</pre>
265
<div class="refsect2">
266
<a name="GtkTreeDragDestIface"></a><h3>struct GtkTreeDragDestIface</h3>
267
<pre class="programlisting">struct GtkTreeDragDestIface {
268
GTypeInterface g_iface;
270
/* VTable - not signals */
272
gboolean (* drag_data_received) (GtkTreeDragDest *drag_dest,
274
GtkSelectionData *selection_data);
276
gboolean (* row_drop_possible) (GtkTreeDragDest *drag_dest,
277
GtkTreePath *dest_path,
278
GtkSelectionData *selection_data);
285
<div class="refsect2">
286
<a name="gtk-tree-drag-dest-drag-data-received"></a><h3>gtk_tree_drag_dest_drag_data_received ()</h3>
287
<pre class="programlisting"><span class="returnvalue">gboolean</span> gtk_tree_drag_dest_drag_data_received
288
(<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>,
289
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *dest</code></em>,
290
<em class="parameter"><code><a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> *selection_data</code></em>);</pre>
292
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>,
293
deriving the contents of the row from <em class="parameter"><code>selection_data</code></em>. If <em class="parameter"><code>dest</code></em> is
294
outside the tree so that inserting before it is impossible, <code class="literal">FALSE</code>
295
will be returned. Also, <code class="literal">FALSE</code> may be returned if the new row is
296
not created for some model-specific reason. Should robustly handle
297
a <em class="parameter"><code>dest</code></em> no longer found in the model!
299
<div class="variablelist"><table border="0" class="variablelist">
301
<col align="left" valign="top">
306
<td><p><span class="term"><em class="parameter"><code>drag_dest</code></em> :</span></p></td>
307
<td>a <a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a>
311
<td><p><span class="term"><em class="parameter"><code>dest</code></em> :</span></p></td>
312
<td>row to drop in front of</td>
315
<td><p><span class="term"><em class="parameter"><code>selection_data</code></em> :</span></p></td>
316
<td>data to drop</td>
319
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
320
<td>whether a new row was created before position <em class="parameter"><code>dest</code></em>
327
<div class="refsect2">
328
<a name="gtk-tree-drag-dest-row-drop-possible"></a><h3>gtk_tree_drag_dest_row_drop_possible ()</h3>
329
<pre class="programlisting"><span class="returnvalue">gboolean</span> gtk_tree_drag_dest_row_drop_possible
330
(<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>,
331
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *dest_path</code></em>,
332
<em class="parameter"><code><a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> *selection_data</code></em>);</pre>
334
Determines whether a drop is possible before the given <em class="parameter"><code>dest_path</code></em>,
335
at the same depth as <em class="parameter"><code>dest_path</code></em>. i.e., can we drop the data in
336
<em class="parameter"><code>selection_data</code></em> at that location. <em class="parameter"><code>dest_path</code></em> does not have to
337
exist; the return value will almost certainly be <code class="literal">FALSE</code> if the
338
parent of <em class="parameter"><code>dest_path</code></em> doesn't exist, though.
340
<div class="variablelist"><table border="0" class="variablelist">
342
<col align="left" valign="top">
347
<td><p><span class="term"><em class="parameter"><code>drag_dest</code></em> :</span></p></td>
348
<td>a <a class="link" href="gtk2-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a>
352
<td><p><span class="term"><em class="parameter"><code>dest_path</code></em> :</span></p></td>
353
<td>destination row</td>
356
<td><p><span class="term"><em class="parameter"><code>selection_data</code></em> :</span></p></td>
357
<td>the data being dragged</td>
360
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
362
<code class="literal">TRUE</code> if a drop is possible before <em class="parameter"><code>dest_path</code></em>
369
<div class="refsect2">
370
<a name="gtk-tree-set-row-drag-data"></a><h3>gtk_tree_set_row_drag_data ()</h3>
371
<pre class="programlisting"><span class="returnvalue">gboolean</span> 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>,
372
<em class="parameter"><code><a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> *tree_model</code></em>,
373
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *path</code></em>);</pre>
375
Sets selection data of target type <code class="literal">GTK_TREE_MODEL_ROW</code>. Normally used
376
in a drag_data_get handler.
378
<div class="variablelist"><table border="0" class="variablelist">
380
<col align="left" valign="top">
385
<td><p><span class="term"><em class="parameter"><code>selection_data</code></em> :</span></p></td>
386
<td>some <a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a>
390
<td><p><span class="term"><em class="parameter"><code>tree_model</code></em> :</span></p></td>
391
<td>a <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>
395
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
396
<td>a row in <em class="parameter"><code>tree_model</code></em>
400
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
402
<code class="literal">TRUE</code> 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</td>
408
<div class="refsect2">
409
<a name="gtk-tree-get-row-drag-data"></a><h3>gtk_tree_get_row_drag_data ()</h3>
410
<pre class="programlisting"><span class="returnvalue">gboolean</span> 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>,
411
<em class="parameter"><code><a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> **tree_model</code></em>,
412
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> **path</code></em>);</pre>
414
Obtains a <em class="parameter"><code>tree_model</code></em> and <em class="parameter"><code>path</code></em> from selection data of target type
415
<code class="literal">GTK_TREE_MODEL_ROW</code>. Normally called from a drag_data_received handler.
416
This function can only be used if <em class="parameter"><code>selection_data</code></em> originates from the same
417
process that's calling this function, because a pointer to the tree model
418
is being passed around. If you aren't in the same process, then you'll
419
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,
420
you can assume that selection data of type <code class="literal">GTK_TREE_MODEL_ROW</code> is
421
in from the current process. The returned path must be freed with
422
<a class="link" href="GtkTreeModel.html#gtk-tree-path-free" title="gtk_tree_path_free ()"><code class="function">gtk_tree_path_free()</code></a>.
424
<div class="variablelist"><table border="0" class="variablelist">
426
<col align="left" valign="top">
431
<td><p><span class="term"><em class="parameter"><code>selection_data</code></em> :</span></p></td>
432
<td>a <a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a>
436
<td><p><span class="term"><em class="parameter"><code>tree_model</code></em> :</span></p></td>
437
<td>a <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
441
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
442
<td>row in <em class="parameter"><code>tree_model</code></em>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
446
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
448
<code class="literal">TRUE</code> if <em class="parameter"><code>selection_data</code></em> had target type <code class="literal">GTK_TREE_MODEL_ROW</code> and
449
is otherwise valid</td>
458
Generated by GTK-Doc V1.18</div>
b'\\ No newline at end of file'