📄 gtkcombobox.html
字号:
<a class="indexterm" name="id3870718"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_combo_box_new_text (void);</pre><p>Convenience function which constructs a new text combo box, which is a<a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a> just displaying strings. If you use this function to createa text combo box, you should only manipulate its data source with thefollowing convenience functions: <a class="link" href="GtkComboBox.html#gtk-combo-box-append-text"><code class="function">gtk_combo_box_append_text()</code></a>,<a class="link" href="GtkComboBox.html#gtk-combo-box-insert-text"><code class="function">gtk_combo_box_insert_text()</code></a>, <a class="link" href="GtkComboBox.html#gtk-combo-box-prepend-text"><code class="function">gtk_combo_box_prepend_text()</code></a> and<a class="link" href="GtkComboBox.html#gtk-combo-box-remove-text"><code class="function">gtk_combo_box_remove_text()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> A new text combo box.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3870820"></a><h3><a name="gtk-combo-box-append-text"></a>gtk_combo_box_append_text ()</h3><a class="indexterm" name="id3870836"></a><pre class="programlisting">void gtk_combo_box_append_text (<a class="link" href="GtkComboBox.html" title="GtkComboBox">GtkComboBox</a> *combo_box, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *text);</pre><p>Appends <em class="parameter"><code>string</code></em> to the list of strings stored in <em class="parameter"><code>combo_box</code></em>. Note thatyou can only use this function with combo boxes constructed with<a class="link" href="GtkComboBox.html#gtk-combo-box-new-text"><code class="function">gtk_combo_box_new_text()</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>combo_box</code></em> :</span></p></td><td> A <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a> constructed using <a class="link" href="GtkComboBox.html#gtk-combo-box-new-text"><code class="function">gtk_combo_box_new_text()</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td><td> A string</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3870958"></a><h3><a name="gtk-combo-box-insert-text"></a>gtk_combo_box_insert_text ()</h3><a class="indexterm" name="id3870974"></a><pre class="programlisting">void gtk_combo_box_insert_text (<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> position, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *text);</pre><p>Inserts <em class="parameter"><code>string</code></em> at <em class="parameter"><code>position</code></em> in the list of strings stored in <em class="parameter"><code>combo_box</code></em>.Note that you can only use this function with combo boxes constructedwith <a class="link" href="GtkComboBox.html#gtk-combo-box-new-text"><code class="function">gtk_combo_box_new_text()</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>combo_box</code></em> :</span></p></td><td> A <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a> constructed using <a class="link" href="GtkComboBox.html#gtk-combo-box-new-text"><code class="function">gtk_combo_box_new_text()</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td><td> An index to insert <em class="parameter"><code>text</code></em></td></tr><tr><td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td><td> A string</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3871128"></a><h3><a name="gtk-combo-box-prepend-text"></a>gtk_combo_box_prepend_text ()</h3><a class="indexterm" name="id3871145"></a><pre class="programlisting">void gtk_combo_box_prepend_text (<a class="link" href="GtkComboBox.html" title="GtkComboBox">GtkComboBox</a> *combo_box, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *text);</pre><p>Prepends <em class="parameter"><code>string</code></em> to the list of strings stored in <em class="parameter"><code>combo_box</code></em>. Note thatyou can only use this function with combo boxes constructed with<a class="link" href="GtkComboBox.html#gtk-combo-box-new-text"><code class="function">gtk_combo_box_new_text()</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>combo_box</code></em> :</span></p></td><td> A <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a> constructed with <a class="link" href="GtkComboBox.html#gtk-combo-box-new-text"><code class="function">gtk_combo_box_new_text()</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td><td> A string</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3871266"></a><h3><a name="gtk-combo-box-remove-text"></a>gtk_combo_box_remove_text ()</h3><a class="indexterm" name="id3871282"></a><pre class="programlisting">void gtk_combo_box_remove_text (<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> position);</pre><p>Removes the string at <em class="parameter"><code>position</code></em> from <em class="parameter"><code>combo_box</code></em>. Note that you can only usethis function with combo boxes constructed with <a class="link" href="GtkComboBox.html#gtk-combo-box-new-text"><code class="function">gtk_combo_box_new_text()</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>combo_box</code></em> :</span></p></td><td> A <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a> constructed with <a class="link" href="GtkComboBox.html#gtk-combo-box-new-text"><code class="function">gtk_combo_box_new_text()</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td><td> Index of the item to remove</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3871403"></a><h3><a name="gtk-combo-box-get-active-text"></a>gtk_combo_box_get_active_text ()</h3><a class="indexterm" name="id3871419"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a>* gtk_combo_box_get_active_text (<a class="link" href="GtkComboBox.html" title="GtkComboBox">GtkComboBox</a> *combo_box);</pre><p>Returns the currently active string in <em class="parameter"><code>combo_box</code></em> or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if noneis selected. Note that you can only use this function with comboboxes constructed with <a class="link" href="GtkComboBox.html#gtk-combo-box-new-text"><code class="function">gtk_combo_box_new_text()</code></a> and with <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a>s.</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> constructed with <a class="link" href="GtkComboBox.html#gtk-combo-box-new-text"><code class="function">gtk_combo_box_new_text()</code></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a newly allocated string containing the currently active text.</td></tr></tbody></table></div><p class="since">Since 2.6</p></div><hr><div class="refsect2" lang="en"><a name="id3871545"></a><h3><a name="gtk-combo-box-popup"></a>gtk_combo_box_popup ()</h3><a class="indexterm" name="id3871561"></a><pre class="programlisting">void gtk_combo_box_popup (<a class="link" href="GtkComboBox.html" title="GtkComboBox">GtkComboBox</a> *combo_box);</pre><p>Pops up the menu or dropdown list of <em class="parameter"><code>combo_box</code></em>. </p><p>This function is mostly intended for use by accessibility technologies;applications should have little use for it.</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></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3871636"></a><h3><a name="gtk-combo-box-popdown"></a>gtk_combo_box_popdown ()</h3><a class="indexterm" name="id3871652"></a><pre class="programlisting">void gtk_combo_box_popdown (<a class="link" href="GtkComboBox.html" title="GtkComboBox">GtkComboBox</a> *combo_box);</pre><p>Hides the menu or dropdown list of <em class="parameter"><code>combo_box</code></em>.</p><p>This function is mostly intended for use by accessibility technologies;applications should have little use for it.</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></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3871728"></a><h3><a name="gtk-combo-box-get-popup-accessible"></a>gtk_combo_box_get_popup_accessible ()</h3><a class="indexterm" name="id3871744"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/atk/AtkObject.html">AtkObject</a>* gtk_combo_box_get_popup_accessible (<a class="link" href="GtkComboBox.html" title="GtkComboBox">GtkComboBox</a> *combo_box);</pre><p>Gets the accessible object corresponding to the combo box's popup.</p><p>This function is mostly intended for use by accessibility technologies;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -