## GtkComboBoxEntry

GtkComboBoxEntry — A text entry field with a dropdown list

## Functions

GtkWidget * | gtk_combo_box_entry_new ()
GtkWidget * | gtk_combo_box_entry_new_with_model ()
GtkWidget * | gtk_combo_box_entry_new_text ()
void | gtk_combo_box_entry_set_text_column ()
gint | gtk_combo_box_entry_get_text_column ()

## Properties

gint | text-column | Read / Write

## Types and Values

struct | GtkComboBoxEntry

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkObject
                ╰── GtkWidget
                    ╰── GtkContainer
                        ╰── GtkBin
                            ╰── GtkComboBox
                                ╰── GtkComboBoxEntry

## Implemented Interfaces

GtkComboBoxEntry implements AtkImplementorIface, GtkBuildable, GtkCellLayout and GtkCellEditable.

## Includes

    #include <gtk/gtk.h>

## Description

A GtkComboBoxEntry is a widget that allows the user to choose from a list of valid choices or enter a different value. It is very similar to a GtkComboBox, but it displays the selected value in an entry to allow modifying it.

In contrast to a GtkComboBox, the underlying model of a GtkComboBoxEntry must always have a text column (see `gtk_combo_box_entry_set_text_column()`), and the entry will show the content of the text column in the selected row. To get the text from the entry, use `gtk_combo_box_get_active_text()`.

The changed signal will be emitted while typing into a GtkComboBoxEntry, as well as when selecting an item from the GtkComboBoxEntry's list. Use `gtk_combo_box_get_active()` or `gtk_combo_box_get_active_iter()` to discover whether an item was actually selected from the list.

Connect to the activate signal of the GtkEntry (use `gtk_bin_get_child()`) to detect when the user actually finishes entering text.

The convenience API to construct simple text-only GtkComboBoxes can also be used with GtkComboBoxEntrys which have been constructed with `gtk_combo_box_entry_new_text()`.

If you have special needs that go beyond a simple entry (e.g. input validation), it is possible to replace the child entry by a different widget using `gtk_container_remove()` and `gtk_container_add()`.

### GtkComboBoxEntry as GtkBuildable

Beyond the <attributes> support that is shared by all GtkCellLayout implementation, GtkComboBoxEntry makes the entry available in UI definitions as an internal child with name "entry".

## Functions

### gtk_combo_box_entry_new ()

    GtkWidget *
    gtk_combo_box_entry_new (void);

`gtk_combo_box_entry_new` has been deprecated since version 2.24 and should not be used in newly-written code.

Use `gtk_combo_box_new_with_entry()` instead

Creates a new GtkComboBoxEntry which has a GtkEntry as child. After construction, you should set a model using `gtk_combo_box_set_model()` and a text column using `gtk_combo_box_entry_set_text_column()`.

#### Returns

A new GtkComboBoxEntry.

Since 2.4

### gtk_combo_box_entry_new_with_model ()

    GtkWidget *
    gtk_combo_box_entry_new_with_model (GtkTreeModel *model,
                                        gint text_column);

`gtk_combo_box_entry_new_with_model` has been deprecated since version 2.24 and should not be used in newly-written code.

Use `gtk_combo_box_new_with_model_and_entry()` instead

Creates a new GtkComboBoxEntry which has a GtkEntry as child and a list of strings as popup. You can get the GtkEntry from a GtkComboBoxEntry using GTK_ENTRY (GTK_BIN (combo_box_entry)->child). To add and remove strings from the list, just modify `model` using its data manipulation API.

#### Parameters

model | A GtkTreeModel. |
text_column | A column in `model` to get the strings from. |

#### Returns

A new GtkComboBoxEntry.

Since 2.4

### gtk_combo_box_entry_new_text ()

    GtkWidget *
    gtk_combo_box_entry_new_text (void);

`gtk_combo_box_entry_new_text` is deprecated and should not be used in newly-written code.

Convenience function which constructs a new editable text combo box, which is a GtkComboBoxEntry just displaying strings. If you use this function to create a text combo box, you should only manipulate its data source with the following convenience functions: `gtk_combo_box_append_text()`, `gtk_combo_box_insert_text()`, `gtk_combo_box_prepend_text()` and `gtk_combo_box_remove_text()`.

#### Returns

A new text GtkComboBoxEntry.

Since 2.4

### gtk_combo_box_entry_set_text_column ()

    void
    gtk_combo_box_entry_set_text_column (GtkComboBoxEntry *entry_box,
                                         gint text_column);

`gtk_combo_box_entry_set_text_column` has been deprecated since version 2.24 and should not be used in newly-written code.

Use `gtk_combo_box_set_entry_text_column()` instead

Sets the model column which `entry_box` should use to get strings from to be `text_column` .

#### Parameters

entry_box | A GtkComboBoxEntry. |
text_column | A column in `model` to get the strings from. |

Since 2.4

### gtk_combo_box_entry_get_text_column ()

    gint
    gtk_combo_box_entry_get_text_column (GtkComboBoxEntry *entry_box);

`gtk_combo_box_entry_get_text_column` has been deprecated since version 2.24 and should not be used in newly-written code.

Use `gtk_combo_box_get_entry_text_column()` instead

Returns the column which `entry_box` is using to get the strings from.

#### Parameters

entry_box | A GtkComboBoxEntry. |

#### Returns

A column in the data source model of `entry_box` .

Since 2.4

## Types and Values

### struct GtkComboBoxEntry

    struct GtkComboBoxEntry;

`GtkComboBoxEntry` is deprecated and should not be used in newly-written code.

## Property Details

### The `“text-column”` property

      “text-column”              gint

A column in the data source model to get the strings from.

Flags: Read / Write

Allowed values: >= -1

Default value: -1

## See Also

GtkComboBox