📄 gtktreestore.html
字号:
<td> A valid <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>sibling</code></em> :</span></p></td><td> A valid <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3859768"></a><h3><a name="gtk-tree-store-insert-after"></a>gtk_tree_store_insert_after ()</h3><a class="indexterm" name="id3859782"></a><pre class="programlisting">void gtk_tree_store_insert_after (<a class="link" href="GtkTreeStore.html" title="GtkTreeStore">GtkTreeStore</a> *tree_store, <a class="link" href="GtkTreeModel.html#GtkTreeIter">GtkTreeIter</a> *iter, <a class="link" href="GtkTreeModel.html#GtkTreeIter">GtkTreeIter</a> *parent, <a class="link" href="GtkTreeModel.html#GtkTreeIter">GtkTreeIter</a> *sibling);</pre><p>Inserts a new row after <em class="parameter"><code>sibling</code></em>. If <em class="parameter"><code>sibling</code></em> is <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>, then the row will beprepended to <em class="parameter"><code>parent</code></em> 's children. If <em class="parameter"><code>parent</code></em> and <em class="parameter"><code>sibling</code></em> are <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>, thenthe row will be prepended to the toplevel. If both <em class="parameter"><code>sibling</code></em> and <em class="parameter"><code>parent</code></em> areset, then <em class="parameter"><code>parent</code></em> must be the parent of <em class="parameter"><code>sibling</code></em>. When <em class="parameter"><code>sibling</code></em> is set,<em class="parameter"><code>parent</code></em> is optional.</p><p><em class="parameter"><code>iter</code></em> will be changed to point to this new row. The row will be empty afterthis function is called. To fill in values, you need to call<a class="link" href="GtkTreeStore.html#gtk-tree-store-set"><code class="function">gtk_tree_store_set()</code></a> or <a class="link" href="GtkTreeStore.html#gtk-tree-store-set-value"><code class="function">gtk_tree_store_set_value()</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>tree_store</code></em> :</span></p></td><td> A <a class="link" href="GtkTreeStore.html" title="GtkTreeStore"><span class="type">GtkTreeStore</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td><td> An unset <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> to set to the new row</td></tr><tr><td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td><td> A valid <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>sibling</code></em> :</span></p></td><td> A valid <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3860071"></a><h3><a name="gtk-tree-store-insert-with-values"></a>gtk_tree_store_insert_with_values ()</h3><a class="indexterm" name="id3860088"></a><pre class="programlisting">void gtk_tree_store_insert_with_values (<a class="link" href="GtkTreeStore.html" title="GtkTreeStore">GtkTreeStore</a> *tree_store, <a class="link" href="GtkTreeModel.html#GtkTreeIter">GtkTreeIter</a> *iter, <a class="link" href="GtkTreeModel.html#GtkTreeIter">GtkTreeIter</a> *parent, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> position, ...);</pre><p>Creates a new row at <em class="parameter"><code>position</code></em>. <em class="parameter"><code>iter</code></em> will be changed to point to thisnew row. If <em class="parameter"><code>position</code></em> is larger than the number of rows on the list, thenthe new row will be appended to the list. The row will be filled withthe values given to this function.</p><p>Calling<code class="literal">gtk_tree_store_insert_with_values (tree_store, iter, position, ...)</code>has the same effect as calling</p><div class="informalexample"><pre class="programlisting">gtk_tree_store_insert (tree_store, iter, position);gtk_tree_store_set (tree_store, iter, ...);</pre></div><p>with the different that the former will only emit a row_inserted signal,while the latter will emit row_inserted, row_changed and if the tree storeis sorted, rows_reordered. Since emitting the rows_reordered signalrepeatedly can affect the performance of the program,<a class="link" href="GtkTreeStore.html#gtk-tree-store-insert-with-values"><code class="function">gtk_tree_store_insert_with_values()</code></a> should generally be preferred wheninserting rows in a sorted tree store.</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>tree_store</code></em> :</span></p></td><td> A <a class="link" href="GtkTreeStore.html" title="GtkTreeStore"><span class="type">GtkTreeStore</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td><td> An unset <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> to set the new row, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td><td> A valid <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td><td> position to insert the new row</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td> pairs of column number and value, terminated with -1</td></tr></tbody></table></div><p class="since">Since 2.10</p></div><hr><div class="refsect2" lang="en"><a name="id3860327"></a><h3><a name="gtk-tree-store-insert-with-valuesv"></a>gtk_tree_store_insert_with_valuesv ()</h3><a class="indexterm" name="id3860344"></a><pre class="programlisting">void gtk_tree_store_insert_with_valuesv (<a class="link" href="GtkTreeStore.html" title="GtkTreeStore">GtkTreeStore</a> *tree_store, <a class="link" href="GtkTreeModel.html#GtkTreeIter">GtkTreeIter</a> *iter, <a class="link" href="GtkTreeModel.html#GtkTreeIter">GtkTreeIter</a> *parent, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> position, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> *columns, <ahref="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue">GValue</a> *values, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> n_values);</pre><p>A variant of <a class="link" href="GtkTreeStore.html#gtk-tree-store-insert-with-values"><code class="function">gtk_tree_store_insert_with_values()</code></a> which takesthe columns and values as two arrays, instead of varargs. Thisfunction is mainly intended for language bindings.</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>tree_store</code></em> :</span></p></td><td> A <a class="link" href="GtkTreeStore.html" title="GtkTreeStore"><span class="type">GtkTreeStore</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td><td> An unset <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> to set the new row, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td><td> A valid <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td><td> position to insert the new row</td></tr><tr><td><p><span class="term"><em class="parameter"><code>columns</code></em> :</span></p></td><td> an array of column numbers</td></tr><tr><td><p><span class="term"><em class="parameter"><code>values</code></em> :</span></p></td><td> an array of GValues</td></tr><tr><td><p><span class="term"><em class="parameter"><code>n_values</code></em> :</span></p></td><td> the length of the <em class="parameter"><code>columns</code></em> and <em class="parameter"><code>values</code></em> arrays</td></tr></tbody></table></div><p class="since">Since 2.10</p></div><hr><div class="refsect2" lang="en"><a name="id3860602"></a><h3><a name="gtk-tree-store-prepend"></a>gtk_tree_store_prepend ()</h3><a class="indexterm" name="id3860615"></a><pre class="programlisting">void gtk_tree_store_prepend (<a class="link" href="GtkTreeStore.html" title="GtkTreeStore">GtkTreeStore</a> *tree_store, <a class="link" href="GtkTreeModel.html#GtkTreeIter">GtkTreeIter</a> *iter, <a class="link" href="GtkTreeModel.html#GtkTreeIter">GtkTreeIter</a> *parent);</pre><p>Prepends a new row to <em class="parameter"><code>tree_store</code></em>. If <em class="parameter"><code>parent</code></em> is non-<ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>, then it will prependthe new row before the first child of <em class="parameter"><code>parent</code></em>, otherwise it will prepend a rowto the top level. <em class="parameter"><code>iter</code></em> will be changed to point to this new row. The rowwill be empty after this function is called. To fill in values, you need tocall <a class="link" href="GtkTreeStore.html#gtk-tree-store-set"><code class="function">gtk_tree_store_set()</code></a> or <a class="link" href="GtkTreeStore.html#gtk-tree-store-set-value"><code class="function">gtk_tree_store_set_value()</code></a>.</p><p></p><div class="variablelist"><table border="0">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -