📄 gtktreeselection.html
字号:
><code class="literal">TRUE</code></a> indicates to <em class="parameter"><code>selection</code></em>that it is okay to change the selection.</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> :</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> :</span></p></td><td>A <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> being viewed</td></tr><tr><td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td><td>The <a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> of the row in question</td></tr><tr><td><p><span class="term"><em class="parameter"><code>path_currently_selected</code></em> :</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 path is currently selected</td></tr><tr><td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td><td>user data</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</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 selection state of the row can be toggled</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3695259"></a><h3><a name="GtkTreeSelectionForeachFunc"></a>GtkTreeSelectionForeachFunc ()</h3><a class="indexterm" name="id3695272"></a><pre class="programlisting">void (*GtkTreeSelectionForeachFunc) (<a class="link" href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> *model, <a class="link" href="GtkTreeModel.html#GtkTreePath">GtkTreePath</a> *path, <a class="link" href="GtkTreeModel.html#GtkTreeIter">GtkTreeIter</a> *iter, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> data);</pre><p>A function used by <a class="link" href="GtkTreeSelection.html#gtk-tree-selection-selected-foreach"><code class="function">gtk_tree_selection_selected_foreach()</code></a> to map allselected rows. It will be called on every selected row in the view.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>model</code></em> :</span></p></td><td>The <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> being viewed</td></tr><tr><td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td><td>The <a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> of a selected row</td></tr><tr><td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td><td>A <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> pointing to a selected row</td></tr><tr><td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td><td>user data</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3695422"></a><h3><a name="gtk-tree-selection-set-mode"></a>gtk_tree_selection_set_mode ()</h3><a class="indexterm" name="id3695435"></a><pre class="programlisting">void gtk_tree_selection_set_mode (<a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection">GtkTreeSelection</a> *selection, <a class="link" href="gtk-Standard-Enumerations.html#GtkSelectionMode">GtkSelectionMode</a> type);</pre><p>Sets the selection mode of the <em class="parameter"><code>selection</code></em>. If the previous type was<a class="link" href="gtk-Standard-Enumerations.html#GTK-SELECTION-MULTIPLE:CAPS"><span class="type">GTK_SELECTION_MULTIPLE</span></a>, then the anchor is kept selected, if it waspreviously selected.</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> :</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>type</code></em> :</span></p></td><td> The selection mode</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3695532"></a><h3><a name="gtk-tree-selection-get-mode"></a>gtk_tree_selection_get_mode ()</h3><a class="indexterm" name="id3695546"></a><pre class="programlisting"><a class="link" href="gtk-Standard-Enumerations.html#GtkSelectionMode">GtkSelectionMode</a> gtk_tree_selection_get_mode (<a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection">GtkTreeSelection</a> *selection);</pre><p>Gets the selection mode for <em class="parameter"><code>selection</code></em>. See<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-set-mode"><code class="function">gtk_tree_selection_set_mode()</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</code></em> :</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> :</span></p></td><td> the current selection mode</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3695633"></a><h3><a name="gtk-tree-selection-set-select-function"></a>gtk_tree_selection_set_select_function ()</h3><a class="indexterm" name="id3695646"></a><pre class="programlisting">void gtk_tree_selection_set_select_function (<a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection">GtkTreeSelection</a> *selection, <a class="link" href="GtkTreeSelection.html#GtkTreeSelectionFunc">GtkTreeSelectionFunc</a> func, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> data, <a class="link" href="gtk-Types.html#GtkDestroyNotify">GtkDestroyNotify</a> destroy);</pre><p>Sets the selection function. If set, this function is called before any nodeis selected or unselected, giving some control over which nodes are selected.The select function should return <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the state of the node may be toggled,and <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if the state of the node should be left unchanged.</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> :</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> :</span></p></td><td> The selection function.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td><td> The selection function's data.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td><td> The destroy function for user data. May be NULL.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3695798"></a><h3><a name="gtk-tree-selection-get-user-data"></a>gtk_tree_selection_get_user_data ()</h3><a class="indexterm" name="id3695811"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> gtk_tree_selection_get_user_data (<a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection">GtkTreeSelection</a> *selection);</pre><p>Returns the user data for the selection function.</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> :</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> :</span></p></td><td> The user data.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3695880"></a><h3><a name="gtk-tree-selection-get-tree-view"></a>gtk_tree_selection_get_tree_view ()</h3><a class="indexterm" name="id3695894"></a><pre class="programlisting"><a class="link" href="GtkTreeView.html" title="GtkTreeView">GtkTreeView</a>* gtk_tree_selection_get_tree_view (<a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection">GtkTreeSelection</a> *selection);</pre><p>Returns the tree view associated with <em class="parameter"><code>selection</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> :</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> :</span></p></td><td> A <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3695977"></a><h3><a name="gtk-tree-selection-get-selected"></a>gtk_tree_selection_get_selected ()</h3>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -