82
82
In contrast to a <link linkend="GtkComboBox"><type>GtkComboBox</type></link>, the underlying model of a <link linkend="GtkComboBoxEntry"><type>GtkComboBoxEntry</type></link>
83
83
must always have a text column (see <link linkend="gtk-combo-box-entry-set-text-column"><function>gtk_combo_box_entry_set_text_column()</function></link>),
84
and the entry will show the content of the text column in the selected row. To
85
get the text from the entry, use <link linkend="gtk-combo-box-get-active-text"><function>gtk_combo_box_get_active_text()</function></link>.
84
and the entry will show the content of the text column in the selected row.
85
To get the text from the entry, use <link linkend="gtk-combo-box-get-active-text"><function>gtk_combo_box_get_active_text()</function></link>.
88
<para>The changed signal will be emitted while typing into a GtkComboBoxEntry,
89
The changed signal will be emitted while typing into a GtkComboBoxEntry,
89
90
as well as when selecting an item from the GtkComboBoxEntry's list. Use
90
91
<link linkend="gtk-combo-box-get-active"><function>gtk_combo_box_get_active()</function></link> or <link linkend="gtk-combo-box-get-active-iter"><function>gtk_combo_box_get_active_iter()</function></link> to discover
91
92
whether an item was actually selected from the list.
94
<para>Connect to the activate signal of the GtkEntry (use <link linkend="gtk-bin-get-child"><function>gtk_bin_get_child()</function></link>) to
95
detect when the user actually finishes entering text.</para>
96
Connect to the activate signal of the GtkEntry (use <link linkend="gtk-bin-get-child"><function>gtk_bin_get_child()</function></link>)
97
to detect when the user actually finishes entering text.
98
The convenience API to construct simple text-only <link linkend="GtkComboBox"><type>GtkComboBox</type></link><!-- -->es can
99
also be used with <link linkend="GtkComboBoxEntry"><type>GtkComboBoxEntry</type></link><!-- -->s which have been constructed
101
The convenience API to construct simple text-only <link linkend="GtkComboBox"><type>GtkComboBox</type></link><!-- -->es
102
can also be used with <link linkend="GtkComboBoxEntry"><type>GtkComboBoxEntry</type></link><!-- -->s which have been constructed
100
103
with <link linkend="gtk-combo-box-entry-new-text"><function>gtk_combo_box_entry_new_text()</function></link>.
107
If you have special needs that go beyond a simple entry (e.g. input validation),
108
it is possible to replace the child entry by a different widget using
109
<link linkend="gtk-container-remove"><function>gtk_container_remove()</function></link> and <link linkend="gtk-container-add"><function>gtk_container_add()</function></link>.
104
113
<refsect1 role="details">
205
214
<refsect1 role="property_details">
206
215
<title role="property_details.title">Property Details</title>
207
<refsect2><title><anchor id="GtkComboBoxEntry--text-column"/>The "<literal>text-column</literal>" property</title>
208
<indexterm><primary>GtkComboBoxEntry:text-column</primary></indexterm><programlisting> "text-column" <link linkend="gint">gint</link> : Read / Write</programlisting>
216
<refsect2><title><anchor id="GtkComboBoxEntry--text-column"/>The :<literal>text-column</literal> property</title>
217
<indexterm><primary>GtkComboBoxEntry:text-column</primary></indexterm><programlisting> text-column <link linkend="gint">gint</link> : Read / Write</programlisting>
209
218
<para>A column in the data source model to get the strings from.</para><para>Allowed values: >= -1</para>
210
219
<para>Default value: -1</para>