⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gtk-gtktreeview-drag-and-drop.html

📁 最新gtk中文资料集
💻 HTML
📖 第 1 页 / 共 3 页
字号:
Asks the <a class="link" 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> isoutside the tree so that inserting before it is impossible, <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>will be returned. Also, <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> may be returned if the new row isnot created for some model-specific reason.  Should robustly handlea <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><p><span class="term"><em class="parameter"><code>drag_dest</code></em>&#160;:</span></p></td><td> a <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>dest</code></em>&#160;:</span></p></td><td> row to drop in front of</td></tr><tr><td><p><span class="term"><em class="parameter"><code>selection_data</code></em>&#160;:</span></p></td><td> data to drop</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></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="id3770786"></a><h3><a name="gtk-tree-drag-dest-row-drop-possible"></a>gtk_tree_drag_dest_row_drop_possible ()</h3><a class="indexterm" name="id3770800"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            gtk_tree_drag_dest_row_drop_possible                                                        (<a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest">GtkTreeDragDest</a> *drag_dest,                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *dest_path,                                                         <a class="link" 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 toexist; the return value will almost certainly be <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if theparent 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><p><span class="term"><em class="parameter"><code>drag_dest</code></em>&#160;:</span></p></td><td> a <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>dest_path</code></em>&#160;:</span></p></td><td> destination row</td></tr><tr><td><p><span class="term"><em class="parameter"><code>selection_data</code></em>&#160;:</span></p></td><td> the data being dragged</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> <ahref="/usr/share/gtk-doc/html/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="id3770973"></a><h3><a name="gtk-tree-set-row-drag-data"></a>gtk_tree_set_row_drag_data ()</h3><a class="indexterm" name="id3770987"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            gtk_tree_set_row_drag_data          (<a class="link" href="GtkWidget.html#GtkSelectionData">GtkSelectionData</a> *selection_data,                                                         <a class="link" href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> *tree_model,                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *path);</pre><p>Sets selection data of target type <code class="literal">GTK_TREE_MODEL_ROW</code>. Normally usedin a drag_data_get handler.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>selection_data</code></em>&#160;:</span></p></td><td> some <a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>tree_model</code></em>&#160;:</span></p></td><td> a <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>path</code></em>&#160;:</span></p></td><td> a row in <em class="parameter"><code>tree_model</code></em></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> <ahref="/usr/share/gtk-doc/html/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</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3771146"></a><h3><a name="gtk-tree-get-row-drag-data"></a>gtk_tree_get_row_drag_data ()</h3><a class="indexterm" name="id3771159"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            gtk_tree_get_row_drag_data          (<a class="link" href="GtkWidget.html#GtkSelectionData">GtkSelectionData</a> *selection_data,                                                         <a class="link" href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> **tree_model,                                                         <a class="link" 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 sameprocess that's calling this function, because a pointer to the tree modelis being passed around. If you aren't in the same process, then you'llget memory corruption. In the <a class="link" 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> isin from the current process. The returned path must be freed with<a class="link" 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><p><span class="term"><em class="parameter"><code>selection_data</code></em>&#160;:</span></p></td><td> a <a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>tree_model</code></em>&#160;:</span></p></td><td> a <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>path</code></em>&#160;:</span></p></td><td> row in <em class="parameter"><code>tree_model</code></em></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> <ahref="/usr/share/gtk-doc/html/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 class="refsect1" lang="en"><a name="id3771380"></a><div class="refsect2" lang="en"><a name="id3771381"></a></div><hr><div class="refsect2" lang="en"><a name="id3771382"></a></div></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -