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

📄 gtktreeselection.html

📁 最新gtk中文资料集
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<a class="indexterm" name="id3695990"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            gtk_tree_selection_get_selected     (<a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection">GtkTreeSelection</a> *selection,                                                         <a class="link" href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> **model,                                                         <a class="link" href="GtkTreeModel.html#GtkTreeIter">GtkTreeIter</a> *iter);</pre><p>Sets <em class="parameter"><code>iter</code></em> to the currently selected node if <em class="parameter"><code>selection</code></em> is set to<a class="link" href="gtk-Standard-Enumerations.html#GTK-SELECTION-SINGLE:CAPS"><span class="type">GTK_SELECTION_SINGLE</span></a> or <a class="link" href="gtk-Standard-Enumerations.html#GTK-SELECTION-BROWSE:CAPS"><span class="type">GTK_SELECTION_BROWSE</span></a>.  <em class="parameter"><code>iter</code></em> may be NULL if youjust want to test if <em class="parameter"><code>selection</code></em> has any selected nodes.  <em class="parameter"><code>model</code></em> is filledwith the current model as a convenience.  This function will not work if youuse <em class="parameter"><code>selection</code></em> is <a class="link" href="gtk-Standard-Enumerations.html#GTK-SELECTION-MULTIPLE:CAPS"><span class="type">GTK_SELECTION_MULTIPLE</span></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</code></em>&#160;:</span></p></td><td> A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>model</code></em>&#160;:</span></p></td><td> A pointer to set to the <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>, or NULL.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>iter</code></em>&#160;:</span></p></td><td> The <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>, or NULL.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> TRUE, if there is a selected node.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3696185"></a><h3><a name="gtk-tree-selection-selected-foreach"></a>gtk_tree_selection_selected_foreach ()</h3><a class="indexterm" name="id3696200"></a><pre class="programlisting">void                gtk_tree_selection_selected_foreach (<a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection">GtkTreeSelection</a> *selection,                                                         <a class="link" href="GtkTreeSelection.html#GtkTreeSelectionForeachFunc">GtkTreeSelectionForeachFunc</a> func,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> data);</pre><p>Calls a function for each selected node. Note that you cannot modifythe tree or selection from within this function. As a result,<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-get-selected-rows"><code class="function">gtk_tree_selection_get_selected_rows()</code></a> might be more useful.</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</code></em>&#160;:</span></p></td><td> A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td><td> The function to call for each selected node.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td><td> user data to pass to the function.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3696317"></a><h3><a name="gtk-tree-selection-get-selected-rows"></a>gtk_tree_selection_get_selected_rows ()</h3><a class="indexterm" name="id3696333"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList">GList</a>*              gtk_tree_selection_get_selected_rows                                                        (<a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection">GtkTreeSelection</a> *selection,                                                         <a class="link" href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> **model);</pre><p>Creates a list of path of all selected rows. Additionally, if you areplanning on modifying the model after calling this function, you maywant to convert the returned list into a list of <a class="link" href="GtkTreeModel.html#GtkTreeRowReference"><span class="type">GtkTreeRowReference</span></a>s.To do this, you can use <a class="link" href="GtkTreeModel.html#gtk-tree-row-reference-new"><code class="function">gtk_tree_row_reference_new()</code></a>.</p><p>To free the return value, use:</p><div class="informalexample"><pre class="programlisting">g_list_foreach (list, gtk_tree_path_free, NULL);g_list_free (list);</pre></div><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</code></em>&#160;:</span></p></td><td> A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>model</code></em>&#160;:</span></p></td><td> A pointer to set to the <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>, or NULL.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> A <ahref="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList"><span class="type">GList</span></a> containing a <a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> for each selected row.</td></tr></tbody></table></div><p class="since">Since  2.2</p></div><hr><div class="refsect2" lang="en"><a name="id3696491"></a><h3><a name="gtk-tree-selection-count-selected-rows"></a>gtk_tree_selection_count_selected_rows ()</h3><a class="indexterm" name="id3696507"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a>                gtk_tree_selection_count_selected_rows                                                        (<a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection">GtkTreeSelection</a> *selection);</pre><p>Returns the number of rows that have been selected in <em class="parameter"><code>tree</code></em>.</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</code></em>&#160;:</span></p></td><td> A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> The number of rows selected.</td></tr></tbody></table></div><p class="since">Since  2.2</p></div><hr><div class="refsect2" lang="en"><a name="id3696591"></a><h3><a name="gtk-tree-selection-select-path"></a>gtk_tree_selection_select_path ()</h3><a class="indexterm" name="id3696604"></a><pre class="programlisting">void                gtk_tree_selection_select_path      (<a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection">GtkTreeSelection</a> *selection,                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *path);</pre><p>Select the row at <em class="parameter"><code>path</code></em>.</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</code></em>&#160;:</span></p></td><td> A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>path</code></em>&#160;:</span></p></td><td> The <a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> to be selected.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3696698"></a><h3><a name="gtk-tree-selection-unselect-path"></a>gtk_tree_selection_unselect_path ()</h3><a class="indexterm" name="id3696712"></a><pre class="programlisting">void                gtk_tree_selection_unselect_path    (<a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection">GtkTreeSelection</a> *selection,                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *path);</pre><p>Unselects the row at <em class="parameter"><code>path</code></em>.</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</code></em>&#160;:</span></p></td><td> A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>path</code></em>&#160;:</span></p></td><td> The <a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> to be unselected.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3696806"></a><h3><a name="gtk-tree-selection-path-is-selected"></a>gtk_tree_selection_path_is_selected ()</h3><a class="indexterm" name="id3696821"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            gtk_tree_selection_path_is_selected (<a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection">GtkTreeSelection</a> *selection,                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *path);</pre><p>Returns <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the row pointed to by <em class="parameter"><code>path</code></em> is currently selected.  If <em class="parameter"><code>path</code></em>does not point to a valid location, <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is returned</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</code></em>&#160;:</span></p></td><td> A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>path</code></em>&#160;:</span></p></td><td> A <a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> to check selection on.</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>path</code></em> is selected.</td></tr>

⌨️ 快捷键说明

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