gtk3/docs/reference/gtk/html/GtkComboBoxText.html
2021-04-15 09:52:10 +01:00

635 lines
33 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkComboBoxText: GTK+ 3 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GTK+ 3 Reference Manual">
<link rel="up" href="MenusAndCombos.html" title="Menus, Combo Box, Toolbar">
<link rel="prev" href="GtkComboBox.html" title="GtkComboBox">
<link rel="next" href="GtkMenu.html" title="GtkMenu">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
<a href="#GtkComboBoxText.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
<a href="#GtkComboBoxText.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_interfaces">  <span class="dim">|</span> 
<a href="#GtkComboBoxText.implemented-interfaces" class="shortcut">Implemented Interfaces</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="MenusAndCombos.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GtkComboBox.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GtkMenu.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GtkComboBoxText"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GtkComboBoxText.top_of_page"></a>GtkComboBoxText</span></h2>
<p>GtkComboBoxText — A simple, text-only combo box</p>
</td>
<td class="gallery_image" valign="top" align="right"><img src="combo-box-text.png"></td>
</tr></table></div>
<div class="refsect1">
<a name="GtkComboBoxText.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
</td>
<td class="function_name">
<a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-new" title="gtk_combo_box_text_new ()">gtk_combo_box_text_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
</td>
<td class="function_name">
<a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-new-with-entry" title="gtk_combo_box_text_new_with_entry ()">gtk_combo_box_text_new_with_entry</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-append" title="gtk_combo_box_text_append ()">gtk_combo_box_text_append</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-prepend" title="gtk_combo_box_text_prepend ()">gtk_combo_box_text_prepend</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-insert" title="gtk_combo_box_text_insert ()">gtk_combo_box_text_insert</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-append-text" title="gtk_combo_box_text_append_text ()">gtk_combo_box_text_append_text</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-prepend-text" title="gtk_combo_box_text_prepend_text ()">gtk_combo_box_text_prepend_text</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-insert-text" title="gtk_combo_box_text_insert_text ()">gtk_combo_box_text_insert_text</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-remove" title="gtk_combo_box_text_remove ()">gtk_combo_box_text_remove</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-remove-all" title="gtk_combo_box_text_remove_all ()">gtk_combo_box_text_remove_all</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-get-active-text" title="gtk_combo_box_text_get_active_text ()">gtk_combo_box_text_get_active_text</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkComboBoxText.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody><tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GtkComboBoxText.html#GtkComboBoxText-struct" title="struct GtkComboBoxText">GtkComboBoxText</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkComboBoxText.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen"> GObject
<span class="lineart">╰──</span> GInitiallyUnowned
<span class="lineart">╰──</span> <a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>
<span class="lineart">╰──</span> <a class="link" href="GtkContainer.html" title="GtkContainer">GtkContainer</a>
<span class="lineart">╰──</span> <a class="link" href="GtkBin.html" title="GtkBin">GtkBin</a>
<span class="lineart">╰──</span> <a class="link" href="GtkComboBox.html" title="GtkComboBox">GtkComboBox</a>
<span class="lineart">╰──</span> GtkComboBoxText
</pre>
</div>
<div class="refsect1">
<a name="GtkComboBoxText.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
GtkComboBoxText implements
AtkImplementorIface, <a class="link" href="GtkBuildable.html" title="GtkBuildable">GtkBuildable</a>, <a class="link" href="GtkCellLayout.html" title="GtkCellLayout">GtkCellLayout</a> and <a class="link" href="GtkCellEditable.html" title="GtkCellEditable">GtkCellEditable</a>.</p>
</div>
<div class="refsect1">
<a name="GtkComboBoxText.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gtk/gtk.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GtkComboBoxText.description"></a><h2>Description</h2>
<p>A GtkComboBoxText is a simple variant of <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a> that hides
the model-view complexity for simple text-only use cases.</p>
<p>To create a GtkComboBoxText, use <a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-new" title="gtk_combo_box_text_new ()"><code class="function">gtk_combo_box_text_new()</code></a> or
<a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-new-with-entry" title="gtk_combo_box_text_new_with_entry ()"><code class="function">gtk_combo_box_text_new_with_entry()</code></a>.</p>
<p>You can add items to a GtkComboBoxText with
<a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-append-text" title="gtk_combo_box_text_append_text ()"><code class="function">gtk_combo_box_text_append_text()</code></a>, <a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-insert-text" title="gtk_combo_box_text_insert_text ()"><code class="function">gtk_combo_box_text_insert_text()</code></a>
or <a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-prepend-text" title="gtk_combo_box_text_prepend_text ()"><code class="function">gtk_combo_box_text_prepend_text()</code></a> and remove options with
<a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-remove" title="gtk_combo_box_text_remove ()"><code class="function">gtk_combo_box_text_remove()</code></a>.</p>
<p>If the GtkComboBoxText contains an entry (via the “has-entry” property),
its contents can be retrieved using <a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-get-active-text" title="gtk_combo_box_text_get_active_text ()"><code class="function">gtk_combo_box_text_get_active_text()</code></a>.
The entry itself can be accessed by calling <a class="link" href="GtkBin.html#gtk-bin-get-child" title="gtk_bin_get_child ()"><code class="function">gtk_bin_get_child()</code></a> on the
combo box.</p>
<p>You should not call <a class="link" href="GtkComboBox.html#gtk-combo-box-set-model" title="gtk_combo_box_set_model ()"><code class="function">gtk_combo_box_set_model()</code></a> or attempt to pack more cells
into this combo box via its GtkCellLayout interface.</p>
<div class="refsect2">
<a name="id-1.3.13.3.8.7"></a><h3>GtkComboBoxText as GtkBuildable</h3>
<p>The GtkComboBoxText implementation of the GtkBuildable interface supports
adding items directly using the &lt;items&gt; element and specifying &lt;item&gt;
elements for each item. Each &lt;item&gt; element can specify the “id”
corresponding to the appended text and also supports the regular
translation attributes “translatable”, “context” and “comments”.</p>
<p>Here is a UI definition fragment specifying GtkComboBoxText items:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="o">&lt;</span><span class="n">object</span> <span class="n">class</span><span class="o">=</span><span class="s">&quot;GtkComboBoxText&quot;</span><span class="o">&gt;</span>
<span class="o">&lt;</span><span class="n">items</span><span class="o">&gt;</span>
<span class="o">&lt;</span><span class="n">item</span> <span class="n">translatable</span><span class="o">=</span><span class="s">&quot;yes&quot;</span> <span class="n">id</span><span class="o">=</span><span class="s">&quot;factory&quot;</span><span class="o">&gt;</span><span class="n">Factory</span><span class="o">&lt;/</span><span class="n">item</span><span class="o">&gt;</span>
<span class="o">&lt;</span><span class="n">item</span> <span class="n">translatable</span><span class="o">=</span><span class="s">&quot;yes&quot;</span> <span class="n">id</span><span class="o">=</span><span class="s">&quot;home&quot;</span><span class="o">&gt;</span><span class="n">Home</span><span class="o">&lt;/</span><span class="n">item</span><span class="o">&gt;</span>
<span class="o">&lt;</span><span class="n">item</span> <span class="n">translatable</span><span class="o">=</span><span class="s">&quot;yes&quot;</span> <span class="n">id</span><span class="o">=</span><span class="s">&quot;subway&quot;</span><span class="o">&gt;</span><span class="n">Subway</span><span class="o">&lt;/</span><span class="n">item</span><span class="o">&gt;</span>
<span class="o">&lt;/</span><span class="n">items</span><span class="o">&gt;</span>
<span class="o">&lt;/</span><span class="n">object</span><span class="o">&gt;</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
</div>
<hr>
<div class="refsect2">
<a name="id-1.3.13.3.8.8"></a><h3>CSS nodes</h3>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="n">combobox</span>
<span class="err">╰──</span> <span class="n">box</span><span class="p">.</span><span class="n">linked</span>
<span class="err">├──</span> <span class="n">entry</span><span class="p">.</span><span class="n">combo</span>
<span class="err">├──</span> <span class="n">button</span><span class="p">.</span><span class="n">combo</span>
<span class="err">╰──</span> <span class="n">window</span><span class="p">.</span><span class="n">popup</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>GtkComboBoxText has a single CSS node with name combobox. It adds
the style class .combo to the main CSS nodes of its entry and button
children, and the .linked class to the node of its internal box.</p>
</div>
</div>
<div class="refsect1">
<a name="GtkComboBoxText.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gtk-combo-box-text-new"></a><h3>gtk_combo_box_text_new ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
gtk_combo_box_text_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Creates a new <a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a>, which is a <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a> just displaying
strings.</p>
<div class="refsect3">
<a name="gtk-combo-box-text-new.returns"></a><h4>Returns</h4>
<p> A new <a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a></p>
</div>
<p class="since">Since: 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-new-with-entry"></a><h3>gtk_combo_box_text_new_with_entry ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
gtk_combo_box_text_new_with_entry (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Creates a new <a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a>, which is a <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a> just displaying
strings. The combo box created by this function has an entry.</p>
<div class="refsect3">
<a name="gtk-combo-box-text-new-with-entry.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a></p>
</div>
<p class="since">Since: 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-append"></a><h3>gtk_combo_box_text_append ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_combo_box_text_append (<em class="parameter"><code><a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *id</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *text</code></em>);</pre>
<p>Appends <em class="parameter"><code>text</code></em>
to the list of strings stored in <em class="parameter"><code>combo_box</code></em>
.
If <em class="parameter"><code>id</code></em>
is non-<code class="literal">NULL</code> then it is used as the ID of the row.</p>
<p>This is the same as calling <a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-insert" title="gtk_combo_box_text_insert ()"><code class="function">gtk_combo_box_text_insert()</code></a> with a
position of -1.</p>
<div class="refsect3">
<a name="gtk-combo-box-text-append.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>combo_box</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>id</p></td>
<td class="parameter_description"><p>a string ID for this value, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>text</p></td>
<td class="parameter_description"><p>A string</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-prepend"></a><h3>gtk_combo_box_text_prepend ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_combo_box_text_prepend (<em class="parameter"><code><a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *id</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *text</code></em>);</pre>
<p>Prepends <em class="parameter"><code>text</code></em>
to the list of strings stored in <em class="parameter"><code>combo_box</code></em>
.
If <em class="parameter"><code>id</code></em>
is non-<code class="literal">NULL</code> then it is used as the ID of the row.</p>
<p>This is the same as calling <a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-insert" title="gtk_combo_box_text_insert ()"><code class="function">gtk_combo_box_text_insert()</code></a> with a
position of 0.</p>
<div class="refsect3">
<a name="gtk-combo-box-text-prepend.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>combo_box</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>id</p></td>
<td class="parameter_description"><p>a string ID for this value, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>text</p></td>
<td class="parameter_description"><p>a string</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-insert"></a><h3>gtk_combo_box_text_insert ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_combo_box_text_insert (<em class="parameter"><code><a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
<em class="parameter"><code><span class="type">gint</span> position</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *id</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *text</code></em>);</pre>
<p>Inserts <em class="parameter"><code>text</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>
.
If <em class="parameter"><code>id</code></em>
is non-<code class="literal">NULL</code> then it is used as the ID of the row. See
<a class="link" href="GtkComboBox.html#GtkComboBox--id-column" title="The “id-column” property"><span class="type">“id-column”</span></a>.</p>
<p>If <em class="parameter"><code>position</code></em>
is negative then <em class="parameter"><code>text</code></em>
is appended.</p>
<div class="refsect3">
<a name="gtk-combo-box-text-insert.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>combo_box</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>position</p></td>
<td class="parameter_description"><p>An index to insert <em class="parameter"><code>text</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>id</p></td>
<td class="parameter_description"><p>a string ID for this value, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>text</p></td>
<td class="parameter_description"><p>A string to display</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-0.html#api-index-3.0">3.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-append-text"></a><h3>gtk_combo_box_text_append_text ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_combo_box_text_append_text (<em class="parameter"><code><a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *text</code></em>);</pre>
<p>Appends <em class="parameter"><code>text</code></em>
to the list of strings stored in <em class="parameter"><code>combo_box</code></em>
.</p>
<p>This is the same as calling <a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-insert-text" title="gtk_combo_box_text_insert_text ()"><code class="function">gtk_combo_box_text_insert_text()</code></a> with a
position of -1.</p>
<div class="refsect3">
<a name="gtk-combo-box-text-append-text.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>combo_box</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>text</p></td>
<td class="parameter_description"><p>A string</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-prepend-text"></a><h3>gtk_combo_box_text_prepend_text ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_combo_box_text_prepend_text (<em class="parameter"><code><a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *text</code></em>);</pre>
<p>Prepends <em class="parameter"><code>text</code></em>
to the list of strings stored in <em class="parameter"><code>combo_box</code></em>
.</p>
<p>This is the same as calling <a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-insert-text" title="gtk_combo_box_text_insert_text ()"><code class="function">gtk_combo_box_text_insert_text()</code></a> with a
position of 0.</p>
<div class="refsect3">
<a name="gtk-combo-box-text-prepend-text.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>combo_box</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>text</p></td>
<td class="parameter_description"><p>A string</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-insert-text"></a><h3>gtk_combo_box_text_insert_text ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_combo_box_text_insert_text (<em class="parameter"><code><a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
<em class="parameter"><code><span class="type">gint</span> position</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *text</code></em>);</pre>
<p>Inserts <em class="parameter"><code>text</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>
.</p>
<p>If <em class="parameter"><code>position</code></em>
is negative then <em class="parameter"><code>text</code></em>
is appended.</p>
<p>This is the same as calling <a class="link" href="GtkComboBoxText.html#gtk-combo-box-text-insert" title="gtk_combo_box_text_insert ()"><code class="function">gtk_combo_box_text_insert()</code></a> with a <code class="literal">NULL</code>
ID string.</p>
<div class="refsect3">
<a name="gtk-combo-box-text-insert-text.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>combo_box</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>position</p></td>
<td class="parameter_description"><p>An index to insert <em class="parameter"><code>text</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>text</p></td>
<td class="parameter_description"><p>A string</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-remove"></a><h3>gtk_combo_box_text_remove ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_combo_box_text_remove (<em class="parameter"><code><a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>,
<em class="parameter"><code><span class="type">gint</span> position</code></em>);</pre>
<p>Removes the string at <em class="parameter"><code>position</code></em>
from <em class="parameter"><code>combo_box</code></em>
.</p>
<div class="refsect3">
<a name="gtk-combo-box-text-remove.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>combo_box</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>position</p></td>
<td class="parameter_description"><p>Index of the item to remove</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-remove-all"></a><h3>gtk_combo_box_text_remove_all ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_combo_box_text_remove_all (<em class="parameter"><code><a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>);</pre>
<p>Removes all the text entries from the combo box.</p>
<div class="refsect3">
<a name="gtk-combo-box-text-remove-all.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>combo_box</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-0.html#api-index-3.0">3.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-combo-box-text-get-active-text"></a><h3>gtk_combo_box_text_get_active_text ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> *
gtk_combo_box_text_get_active_text (<em class="parameter"><code><a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a> *combo_box</code></em>);</pre>
<p>Returns the currently active string in <em class="parameter"><code>combo_box</code></em>
, or <code class="literal">NULL</code>
if none is selected. If <em class="parameter"><code>combo_box</code></em>
contains an entry, this
function will return its contents (which will not necessarily
be an item from the list).</p>
<div class="refsect3">
<a name="gtk-combo-box-text-get-active-text.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>combo_box</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkComboBoxText.html" title="GtkComboBoxText"><span class="type">GtkComboBoxText</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-combo-box-text-get-active-text.returns"></a><h4>Returns</h4>
<p>a newly allocated string containing the
currently active text. Must be freed with <code class="function">g_free()</code>. </p>
<p><span class="annotation">[<acronym title="The caller owns the data, and is responsible for free it."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: 2.24</p>
</div>
</div>
<div class="refsect1">
<a name="GtkComboBoxText.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GtkComboBoxText-struct"></a><h3>struct GtkComboBoxText</h3>
<pre class="programlisting">struct GtkComboBoxText;</pre>
</div>
</div>
<div class="refsect1">
<a name="GtkComboBoxText.see-also"></a><h2>See Also</h2>
<p><a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a></p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>