1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>GtkComboBoxEntry</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
7
<link rel="home" href="index.html" title="GTK+ 2 Reference Manual">
8
<link rel="up" href="MenusAndCombos.html" title="Menus, Combo Box, Toolbar">
9
<link rel="prev" href="GtkComboBoxText.html" title="GtkComboBoxText">
10
<link rel="next" href="GtkMenu.html" title="GtkMenu">
11
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17
<td><a accesskey="p" href="GtkComboBoxText.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18
<td><a accesskey="u" href="MenusAndCombos.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20
<th width="100%" align="center">GTK+ 2 Reference Manual</th>
21
<td><a accesskey="n" href="GtkMenu.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23
<tr><td colspan="5" class="shortcuts">
24
<a href="#GtkComboBoxEntry.synopsis" class="shortcut">Top</a>
26
<a href="#GtkComboBoxEntry.description" class="shortcut">Description</a>
28
<a href="#GtkComboBoxEntry.object-hierarchy" class="shortcut">Object Hierarchy</a>
30
<a href="#GtkComboBoxEntry.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
32
<a href="#GtkComboBoxEntry.properties" class="shortcut">Properties</a>
35
<div class="refentry">
36
<a name="GtkComboBoxEntry"></a><div class="titlepage"></div>
37
<div class="refnamediv"><table width="100%"><tr>
39
<h2><span class="refentrytitle"><a name="GtkComboBoxEntry.top_of_page"></a>GtkComboBoxEntry</span></h2>
40
<p>GtkComboBoxEntry — A text entry field with a dropdown list</p>
42
<td valign="top" align="right"><img src="combo-box-entry.png"></td>
44
<div class="refsynopsisdiv">
45
<a name="GtkComboBoxEntry.synopsis"></a><h2>Synopsis</h2>
46
<pre class="synopsis">
47
#include <gtk/gtk.h>
49
struct <a class="link" href="GtkComboBoxEntry.html#GtkComboBoxEntry-struct" title="struct GtkComboBoxEntry">GtkComboBoxEntry</a>;
50
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * <a class="link" href="GtkComboBoxEntry.html#gtk-combo-box-entry-new" title="gtk_combo_box_entry_new ()">gtk_combo_box_entry_new</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
51
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * <a class="link" href="GtkComboBoxEntry.html#gtk-combo-box-entry-new-with-model" title="gtk_combo_box_entry_new_with_model ()">gtk_combo_box_entry_new_with_model</a> (<em class="parameter"><code><a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> *model</code></em>,
52
<em class="parameter"><code><span class="type">gint</span> text_column</code></em>);
53
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * <a class="link" href="GtkComboBoxEntry.html#gtk-combo-box-entry-new-text" title="gtk_combo_box_entry_new_text ()">gtk_combo_box_entry_new_text</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
54
<span class="returnvalue">void</span> <a class="link" href="GtkComboBoxEntry.html#gtk-combo-box-entry-set-text-column" title="gtk_combo_box_entry_set_text_column ()">gtk_combo_box_entry_set_text_column</a> (<em class="parameter"><code><a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a> *entry_box</code></em>,
55
<em class="parameter"><code><span class="type">gint</span> text_column</code></em>);
56
<span class="returnvalue">gint</span> <a class="link" href="GtkComboBoxEntry.html#gtk-combo-box-entry-get-text-column" title="gtk_combo_box_entry_get_text_column ()">gtk_combo_box_entry_get_text_column</a> (<em class="parameter"><code><a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a> *entry_box</code></em>);
59
<div class="refsect1">
60
<a name="GtkComboBoxEntry.object-hierarchy"></a><h2>Object Hierarchy</h2>
61
<pre class="synopsis">
63
+----GInitiallyUnowned
64
+----<a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a>
65
+----<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>
66
+----<a class="link" href="GtkContainer.html" title="GtkContainer">GtkContainer</a>
67
+----<a class="link" href="GtkBin.html" title="GtkBin">GtkBin</a>
68
+----<a class="link" href="GtkComboBox.html" title="GtkComboBox">GtkComboBox</a>
72
<div class="refsect1">
73
<a name="GtkComboBoxEntry.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
75
GtkComboBoxEntry implements
76
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>
78
<div class="refsect1">
79
<a name="GtkComboBoxEntry.properties"></a><h2>Properties</h2>
80
<pre class="synopsis">
81
"<a class="link" href="GtkComboBoxEntry.html#GtkComboBoxEntry--text-column" title='The "text-column" property'>text-column</a>" <span class="type">gint</span> : Read / Write
84
<div class="refsect1">
85
<a name="GtkComboBoxEntry.description"></a><h2>Description</h2>
87
A <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a> is a widget that allows the user to choose from a
88
list of valid choices or enter a different value. It is very similar
89
to a <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a>, but it displays the selected value in an entry to
93
In contrast to a <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a>, the underlying model of a <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a>
94
must always have a text column (see <a class="link" href="GtkComboBoxEntry.html#gtk-combo-box-entry-set-text-column" title="gtk_combo_box_entry_set_text_column ()"><code class="function">gtk_combo_box_entry_set_text_column()</code></a>),
95
and the entry will show the content of the text column in the selected row.
96
To get the text from the entry, use <a class="link" href="GtkComboBox.html#gtk-combo-box-get-active-text" title="gtk_combo_box_get_active_text ()"><code class="function">gtk_combo_box_get_active_text()</code></a>.
99
The changed signal will be emitted while typing into a GtkComboBoxEntry,
100
as well as when selecting an item from the GtkComboBoxEntry's list. Use
101
<a class="link" href="GtkComboBox.html#gtk-combo-box-get-active" title="gtk_combo_box_get_active ()"><code class="function">gtk_combo_box_get_active()</code></a> or <a class="link" href="GtkComboBox.html#gtk-combo-box-get-active-iter" title="gtk_combo_box_get_active_iter ()"><code class="function">gtk_combo_box_get_active_iter()</code></a> to discover
102
whether an item was actually selected from the list.
105
Connect to the activate signal of the GtkEntry (use <a class="link" href="GtkBin.html#gtk-bin-get-child" title="gtk_bin_get_child ()"><code class="function">gtk_bin_get_child()</code></a>)
106
to detect when the user actually finishes entering text.
109
The convenience API to construct simple text-only <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a>es
110
can also be used with <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a>s which have been constructed
111
with <a class="link" href="GtkComboBoxEntry.html#gtk-combo-box-entry-new-text" title="gtk_combo_box_entry_new_text ()"><code class="function">gtk_combo_box_entry_new_text()</code></a>.
114
If you have special needs that go beyond a simple entry (e.g. input validation),
115
it is possible to replace the child entry by a different widget using
116
<a class="link" href="GtkContainer.html#gtk-container-remove" title="gtk_container_remove ()"><code class="function">gtk_container_remove()</code></a> and <a class="link" href="GtkContainer.html#gtk-container-add" title="gtk_container_add ()"><code class="function">gtk_container_add()</code></a>.
118
<div class="refsect2">
119
<a name="GtkComboBoxEntry-BUILDER-UI"></a><h3>GtkComboBoxEntry as GtkBuildable</h3>
121
Beyond the <attributes> support that is shared by all
122
<a class="link" href="GtkCellLayout.html#GtkCellLayout-BUILDER-UI" title="GtkCellLayouts as GtkBuildable">GtkCellLayout</a> implementation,
123
GtkComboBoxEntry makes the entry available in UI definitions as an internal
124
child with name "entry".
128
<div class="refsect1">
129
<a name="GtkComboBoxEntry.details"></a><h2>Details</h2>
130
<div class="refsect2">
131
<a name="GtkComboBoxEntry-struct"></a><h3>struct GtkComboBoxEntry</h3>
132
<pre class="programlisting">struct GtkComboBoxEntry;</pre>
133
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
134
<h3 class="title">Warning</h3>
135
<p><code class="literal">GtkComboBoxEntry</code> is deprecated and should not be used in newly-written code.</p>
141
<div class="refsect2">
142
<a name="gtk-combo-box-entry-new"></a><h3>gtk_combo_box_entry_new ()</h3>
143
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * gtk_combo_box_entry_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
144
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
145
<h3 class="title">Warning</h3>
146
<p><code class="literal">gtk_combo_box_entry_new</code> has been deprecated since version 2.24 and should not be used in newly-written code. Use <a class="link" href="GtkComboBox.html#gtk-combo-box-new-with-entry" title="gtk_combo_box_new_with_entry ()"><code class="function">gtk_combo_box_new_with_entry()</code></a> instead</p>
149
Creates a new <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a> which has a <a class="link" href="GtkEntry.html" title="GtkEntry"><span class="type">GtkEntry</span></a> as child. After
150
construction, you should set a model using <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> and a
151
text column using <a class="link" href="GtkComboBoxEntry.html#gtk-combo-box-entry-set-text-column" title="gtk_combo_box_entry_set_text_column ()"><code class="function">gtk_combo_box_entry_set_text_column()</code></a>.
153
<div class="variablelist"><table border="0" class="variablelist">
155
<col align="left" valign="top">
159
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
160
<td>A new <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a>.</td>
163
<p class="since">Since 2.4</p>
166
<div class="refsect2">
167
<a name="gtk-combo-box-entry-new-with-model"></a><h3>gtk_combo_box_entry_new_with_model ()</h3>
168
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * gtk_combo_box_entry_new_with_model (<em class="parameter"><code><a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> *model</code></em>,
169
<em class="parameter"><code><span class="type">gint</span> text_column</code></em>);</pre>
170
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
171
<h3 class="title">Warning</h3>
172
<p><code class="literal">gtk_combo_box_entry_new_with_model</code> has been deprecated since version 2.24 and should not be used in newly-written code. Use <a class="link" href="GtkComboBox.html#gtk-combo-box-new-with-model-and-entry" title="gtk_combo_box_new_with_model_and_entry ()"><code class="function">gtk_combo_box_new_with_model_and_entry()</code></a> instead</p>
175
Creates a new <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a> which has a <a class="link" href="GtkEntry.html" title="GtkEntry"><span class="type">GtkEntry</span></a> as child and a list
176
of strings as popup. You can get the <a class="link" href="GtkEntry.html" title="GtkEntry"><span class="type">GtkEntry</span></a> from a <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a>
177
using GTK_ENTRY (GTK_BIN (combo_box_entry)->child). To add and remove
178
strings from the list, just modify <em class="parameter"><code>model</code></em> using its data manipulation
181
<div class="variablelist"><table border="0" class="variablelist">
183
<col align="left" valign="top">
188
<td><p><span class="term"><em class="parameter"><code>model</code></em> :</span></p></td>
189
<td>A <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>.</td>
192
<td><p><span class="term"><em class="parameter"><code>text_column</code></em> :</span></p></td>
193
<td>A column in <em class="parameter"><code>model</code></em> to get the strings from.</td>
196
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
197
<td>A new <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a>.</td>
201
<p class="since">Since 2.4</p>
204
<div class="refsect2">
205
<a name="gtk-combo-box-entry-new-text"></a><h3>gtk_combo_box_entry_new_text ()</h3>
206
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * gtk_combo_box_entry_new_text (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
207
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
208
<h3 class="title">Warning</h3>
209
<p><code class="literal">gtk_combo_box_entry_new_text</code> is deprecated and should not be used in newly-written code.</p>
212
Convenience function which constructs a new editable text combo box, which
213
is a <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a> just displaying strings. If you use this function to
214
create a text combo box, you should only manipulate its data source with
215
the following convenience functions: <a class="link" href="GtkComboBox.html#gtk-combo-box-append-text" title="gtk_combo_box_append_text ()"><code class="function">gtk_combo_box_append_text()</code></a>,
216
<a class="link" href="GtkComboBox.html#gtk-combo-box-insert-text" title="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" title="gtk_combo_box_prepend_text ()"><code class="function">gtk_combo_box_prepend_text()</code></a> and
217
<a class="link" href="GtkComboBox.html#gtk-combo-box-remove-text" title="gtk_combo_box_remove_text ()"><code class="function">gtk_combo_box_remove_text()</code></a>.
219
<div class="variablelist"><table border="0" class="variablelist">
221
<col align="left" valign="top">
225
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
226
<td>A new text <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a>.</td>
229
<p class="since">Since 2.4</p>
232
<div class="refsect2">
233
<a name="gtk-combo-box-entry-set-text-column"></a><h3>gtk_combo_box_entry_set_text_column ()</h3>
234
<pre class="programlisting"><span class="returnvalue">void</span> gtk_combo_box_entry_set_text_column (<em class="parameter"><code><a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a> *entry_box</code></em>,
235
<em class="parameter"><code><span class="type">gint</span> text_column</code></em>);</pre>
236
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
237
<h3 class="title">Warning</h3>
238
<p><code class="literal">gtk_combo_box_entry_set_text_column</code> has been deprecated since version 2.24 and should not be used in newly-written code. Use <a class="link" href="GtkComboBox.html#gtk-combo-box-set-entry-text-column" title="gtk_combo_box_set_entry_text_column ()"><code class="function">gtk_combo_box_set_entry_text_column()</code></a> instead</p>
241
Sets the model column which <em class="parameter"><code>entry_box</code></em> should use to get strings from
242
to be <em class="parameter"><code>text_column</code></em>.
244
<div class="variablelist"><table border="0" class="variablelist">
246
<col align="left" valign="top">
251
<td><p><span class="term"><em class="parameter"><code>entry_box</code></em> :</span></p></td>
252
<td>A <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a>.</td>
255
<td><p><span class="term"><em class="parameter"><code>text_column</code></em> :</span></p></td>
256
<td>A column in <em class="parameter"><code>model</code></em> to get the strings from.</td>
260
<p class="since">Since 2.4</p>
263
<div class="refsect2">
264
<a name="gtk-combo-box-entry-get-text-column"></a><h3>gtk_combo_box_entry_get_text_column ()</h3>
265
<pre class="programlisting"><span class="returnvalue">gint</span> gtk_combo_box_entry_get_text_column (<em class="parameter"><code><a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a> *entry_box</code></em>);</pre>
266
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
267
<h3 class="title">Warning</h3>
268
<p><code class="literal">gtk_combo_box_entry_get_text_column</code> has been deprecated since version 2.24 and should not be used in newly-written code. Use <a class="link" href="GtkComboBox.html#gtk-combo-box-get-entry-text-column" title="gtk_combo_box_get_entry_text_column ()"><code class="function">gtk_combo_box_get_entry_text_column()</code></a> instead</p>
271
Returns the column which <em class="parameter"><code>entry_box</code></em> is using to get the strings from.
273
<div class="variablelist"><table border="0" class="variablelist">
275
<col align="left" valign="top">
280
<td><p><span class="term"><em class="parameter"><code>entry_box</code></em> :</span></p></td>
281
<td>A <a class="link" href="GtkComboBoxEntry.html" title="GtkComboBoxEntry"><span class="type">GtkComboBoxEntry</span></a>.</td>
284
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
285
<td>A column in the data source model of <em class="parameter"><code>entry_box</code></em>.</td>
289
<p class="since">Since 2.4</p>
292
<div class="refsect1">
293
<a name="GtkComboBoxEntry.property-details"></a><h2>Property Details</h2>
294
<div class="refsect2">
295
<a name="GtkComboBoxEntry--text-column"></a><h3>The <code class="literal">"text-column"</code> property</h3>
296
<pre class="programlisting"> "text-column" <span class="type">gint</span> : Read / Write</pre>
297
<p>A column in the data source model to get the strings from.</p>
298
<p>Allowed values: >= G_MAXULONG</p>
299
<p>Default value: -1</p>
302
<div class="refsect1">
303
<a name="GtkComboBoxEntry.see-also"></a><h2>See Also</h2>
305
<a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a>
311
Generated by GTK-Doc V1.18</div>
b'\\ No newline at end of file'