1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531
|
<!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.33.0 (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_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</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">
<span class="returnvalue">gboolean</span>
</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">
<span class="returnvalue">gboolean</span>
</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">
<span class="returnvalue">gboolean</span>
</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">
<span class="returnvalue">gboolean</span>
</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">
<span class="returnvalue">gboolean</span>
</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">
<span class="returnvalue">gboolean</span>
</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="other_proto_type">
<col class="other_proto_name">
</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="/usr/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 <gtk/gtk.h>
</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"><span class="returnvalue">gboolean</span>
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 <code class="literal">FALSE</code>
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> <code class="literal">TRUE</code> 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"><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>,
<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->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> <code class="literal">TRUE</code> 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"><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>,
<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> <code class="literal">TRUE</code> 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"><span class="returnvalue">gboolean</span>
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, <code class="literal">FALSE</code>
will be returned. Also, <code class="literal">FALSE</code> 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"><span class="returnvalue">gboolean</span>
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 <code class="literal">FALSE</code> 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> <code class="literal">TRUE</code> 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"><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>,
<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> <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</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"><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>,
<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> <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
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.33.0</div>
</body>
</html>
|