📄 gtkcombobox.html
字号:
<div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>combo_box</code></em> :</span></p></td><td> A <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the column span column.</td></tr></tbody></table></div><p class="since">Since 2.6</p></div><hr><div class="refsect2" lang="en"><a name="id3869824"></a><h3><a name="gtk-combo-box-set-column-span-column"></a>gtk_combo_box_set_column_span_column ()</h3><a class="indexterm" name="id3869840"></a><pre class="programlisting">void gtk_combo_box_set_column_span_column (<a class="link" href="GtkComboBox.html" title="GtkComboBox">GtkComboBox</a> *combo_box, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> column_span);</pre><p>Sets the column with column span information for <em class="parameter"><code>combo_box</code></em> to be<em class="parameter"><code>column_span</code></em>. The column span column contains integers which indicatehow many columns an item should span.</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>combo_box</code></em> :</span></p></td><td> A <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>column_span</code></em> :</span></p></td><td> A column in the model passed during construction</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3869942"></a><h3><a name="gtk-combo-box-get-active"></a>gtk_combo_box_get_active ()</h3><a class="indexterm" name="id3869958"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> gtk_combo_box_get_active (<a class="link" href="GtkComboBox.html" title="GtkComboBox">GtkComboBox</a> *combo_box);</pre><p>Returns the index of the currently active item, or -1 if there's noactive item. If the model is a non-flat treemodel, and the active item is not an immediate child of the root of the tree, this function returns <code class="literal">gtk_tree_path_get_indices (path)[0]</code>, where <code class="literal">path</code> is the <a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> of the active item.</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>combo_box</code></em> :</span></p></td><td> A <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> An integer which is the index of the currently active item, or -1 if there's no active item.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3870058"></a><h3><a name="gtk-combo-box-set-active"></a>gtk_combo_box_set_active ()</h3><a class="indexterm" name="id3870074"></a><pre class="programlisting">void gtk_combo_box_set_active (<a class="link" href="GtkComboBox.html" title="GtkComboBox">GtkComboBox</a> *combo_box, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> index_);</pre><p>Sets the active item of <em class="parameter"><code>combo_box</code></em> to be the item at <em class="parameter"><code>index</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>combo_box</code></em> :</span></p></td><td> A <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>index_</code></em> :</span></p></td><td> An index in the model passed during construction, or -1 to haveno active item</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3870173"></a><h3><a name="gtk-combo-box-get-active-iter"></a>gtk_combo_box_get_active_iter ()</h3><a class="indexterm" name="id3870189"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> gtk_combo_box_get_active_iter (<a class="link" href="GtkComboBox.html" title="GtkComboBox">GtkComboBox</a> *combo_box, <a class="link" href="GtkTreeModel.html#GtkTreeIter">GtkTreeIter</a> *iter);</pre><p>Sets <em class="parameter"><code>iter</code></em> to point to the current active item, if it exists.</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>combo_box</code></em> :</span></p></td><td> A <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td><td> The uninitialized <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a></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 <em class="parameter"><code>iter</code></em> was set</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3870316"></a><h3><a name="gtk-combo-box-set-active-iter"></a>gtk_combo_box_set_active_iter ()</h3><a class="indexterm" name="id3870332"></a><pre class="programlisting">void gtk_combo_box_set_active_iter (<a class="link" href="GtkComboBox.html" title="GtkComboBox">GtkComboBox</a> *combo_box, <a class="link" href="GtkTreeModel.html#GtkTreeIter">GtkTreeIter</a> *iter);</pre><p>Sets the current active item to be the one referenced by <em class="parameter"><code>iter</code></em>. <em class="parameter"><code>iter</code></em> must correspond to a path of depth one.</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>combo_box</code></em> :</span></p></td><td> A <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td><td> The <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a></td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3870439"></a><h3><a name="gtk-combo-box-get-model"></a>gtk_combo_box_get_model ()</h3><a class="indexterm" name="id3870454"></a><pre class="programlisting"><a class="link" href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a>* gtk_combo_box_get_model (<a class="link" href="GtkComboBox.html" title="GtkComboBox">GtkComboBox</a> *combo_box);</pre><p>Returns the <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> which is acting as data source for <em class="parameter"><code>combo_box</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>combo_box</code></em> :</span></p></td><td> A <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</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="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> which was passed during construction.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3870553"></a><h3><a name="gtk-combo-box-set-model"></a>gtk_combo_box_set_model ()</h3><a class="indexterm" name="id3870568"></a><pre class="programlisting">void gtk_combo_box_set_model (<a class="link" href="GtkComboBox.html" title="GtkComboBox">GtkComboBox</a> *combo_box, <a class="link" href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> *model);</pre><p>Sets the model used by <em class="parameter"><code>combo_box</code></em> to be <em class="parameter"><code>model</code></em>. Will unset a previously set model (if applicable). If model is <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>, then it will unset the model.</p><p>Note that this function does not clear the cell renderers, you have to call <a class="link" href="GtkCellLayout.html#gtk-cell-layout-clear"><code class="function">gtk_cell_layout_clear()</code></a> yourself if you need to set up different cell renderers for the new 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>combo_box</code></em> :</span></p></td><td> A <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</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></td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3870703"></a><h3><a name="gtk-combo-box-new-text"></a>gtk_combo_box_new_text ()</h3>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -