## GtkComboBox GtkComboBox — A widget used to choose from a list of items |

## Synopsis

    #include <gtk/gtk.h>

    struct              GtkComboBox;
    GtkWidget *         gtk_combo_box_new                   (void);
    GtkWidget *         gtk_combo_box_new_with_entry        (void);
    GtkWidget *         gtk_combo_box_new_with_model        (GtkTreeModel *model);
    GtkWidget *         gtk_combo_box_new_with_model_and_entry
                                                            (GtkTreeModel *model);
    GtkWidget *         gtk_combo_box_new_with_area         (GtkCellArea *area);
    GtkWidget *         gtk_combo_box_new_with_area_and_entry
                                                            (GtkCellArea *area);
    gint                gtk_combo_box_get_wrap_width        (GtkComboBox *combo_box);
    void                gtk_combo_box_set_wrap_width        (GtkComboBox *combo_box,
                                                             gint width);
    gint                gtk_combo_box_get_row_span_column   (GtkComboBox *combo_box);
    void                gtk_combo_box_set_row_span_column   (GtkComboBox *combo_box,
                                                             gint row_span);
    gint                gtk_combo_box_get_column_span_column
                                                            (GtkComboBox *combo_box);
    void                gtk_combo_box_set_column_span_column
                                                            (GtkComboBox *combo_box,
                                                             gint column_span);
    gint                gtk_combo_box_get_active            (GtkComboBox *combo_box);
    void                gtk_combo_box_set_active            (GtkComboBox *combo_box,
                                                             gint index_);
    gboolean            gtk_combo_box_get_active_iter       (GtkComboBox *combo_box,
                                                             GtkTreeIter *iter);
    void                gtk_combo_box_set_active_iter       (GtkComboBox *combo_box,
                                                             GtkTreeIter *iter);
    gint                gtk_combo_box_get_id_column         (GtkComboBox *combo_box);
    void                gtk_combo_box_set_id_column         (GtkComboBox *combo_box,
                                                             gint id_column);
    const gchar *       gtk_combo_box_get_active_id         (GtkComboBox *combo_box);
    gboolean            gtk_combo_box_set_active_id         (GtkComboBox *combo_box,
                                                             const gchar *active_id);
    GtkTreeModel *      gtk_combo_box_get_model             (GtkComboBox *combo_box);
    void                gtk_combo_box_set_model             (GtkComboBox *combo_box,
                                                             GtkTreeModel *model);
    void                gtk_combo_box_popup_for_device      (GtkComboBox *combo_box,
                                                             GdkDevice *device);
    void                gtk_combo_box_popup                 (GtkComboBox *combo_box);
    void                gtk_combo_box_popdown               (GtkComboBox *combo_box);
    AtkObject *         gtk_combo_box_get_popup_accessible  (GtkComboBox *combo_box);
    GtkTreeViewRowSeparatorFunc gtk_combo_box_get_row_separator_func
                                                            (GtkComboBox *combo_box);
    void                gtk_combo_box_set_row_separator_func
                                                            (GtkComboBox *combo_box,
                                                             GtkTreeViewRowSeparatorFunc func,
                                                             gpointer data,
                                                             GDestroyNotify destroy);
    void                gtk_combo_box_set_add_tearoffs      (GtkComboBox *combo_box,
                                                             gboolean add_tearoffs);
    gboolean            gtk_combo_box_get_add_tearoffs      (GtkComboBox *combo_box);
    void                gtk_combo_box_set_title             (GtkComboBox *combo_box,
                                                             const gchar *title);
    const gchar *       gtk_combo_box_get_title             (GtkComboBox *combo_box);
    void                gtk_combo_box_set_focus_on_click    (GtkComboBox *combo,
                                                             gboolean focus_on_click);
    gboolean            gtk_combo_box_get_focus_on_click    (GtkComboBox *combo);
    void                gtk_combo_box_set_button_sensitivity
                                                            (GtkComboBox *combo_box,
                                                             GtkSensitivityType sensitivity);
    GtkSensitivityType  gtk_combo_box_get_button_sensitivity
                                                            (GtkComboBox *combo_box);
    gboolean            gtk_combo_box_get_has_entry         (GtkComboBox *combo_box);
    void                gtk_combo_box_set_entry_text_column (GtkComboBox *combo_box,
                                                             gint text_column);
    gint                gtk_combo_box_get_entry_text_column (GtkComboBox *combo_box);
    void                gtk_combo_box_set_popup_fixed_width (GtkComboBox *combo_box,
                                                             gboolean fixed);
    gboolean            gtk_combo_box_get_popup_fixed_width (GtkComboBox *combo_box);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkWidget
                   +----GtkContainer
                         +----GtkBin
                               +----GtkComboBox
                                     +----GtkAppChooserButton
                                     +----GtkComboBoxText

## Implemented Interfaces

GtkComboBox implements AtkImplementorIface, GtkBuildable, GtkCellLayout and GtkCellEditable.

## Properties

      "active"                   gint                  : Read / Write
      "active-id"                gchar*                : Read / Write
      "add-tearoffs"             gboolean              : Read / Write
      "button-sensitivity"       GtkSensitivityType    : Read / Write
      "cell-area"                GtkCellArea*          : Read / Write / Construct Only
      "column-span-column"       gint                  : Read / Write
      "entry-text-column"        gint                  : Read / Write
      "focus-on-click"           gboolean              : Read / Write
      "has-entry"                gboolean              : Read / Write / Construct Only
      "has-frame"                gboolean              : Read / Write
      "id-column"                gint                  : Read / Write
      "model"                    GtkTreeModel*         : Read / Write
      "popup-fixed-width"        gboolean              : Read / Write
      "popup-shown"              gboolean              : Read
      "row-span-column"          gint                  : Read / Write
      "tearoff-title"            gchar*                : Read / Write
      "wrap-width"               gint                  : Read / Write

## Style Properties

      "appears-as-list"          gboolean              : Read
      "arrow-scaling"            gfloat                : Read
      "arrow-size"               gint                  : Read
      "shadow-type"              GtkShadowType         : Read

## Signals

      "changed"                                        : Run Last
      "format-entry-text"                              : Run Last
      "move-active"                                    : Action
      "popdown"                                        : Action
      "popup"                                          : Action

## Description

A GtkComboBox is a widget that allows the user to choose from a list of valid choices. The GtkComboBox displays the selected choice. When activated, the GtkComboBox displays a popup which allows the user to make a new choice. The style in which the selected value is displayed, and the style of the popup is determined by the current theme. It may be similar to a Windows-style combo box.

The GtkComboBox uses the model-view pattern; the list of valid choices is specified in the form of a tree model, and the display of the choices can be adapted to the data in the model by using cell renderers, as you would in a tree view. This is possible since GtkComboBox implements the GtkCellLayout interface. The tree model holding the valid choices is not restricted to a flat list, it can be a real tree, and the popup will reflect the tree structure.

To allow the user to enter values not in the model, the 'has-entry' property allows the GtkComboBox to contain a GtkEntry. This entry can be accessed by calling `gtk_bin_get_child()` on the combo box.

For a simple list of textual choices, the model-view API of GtkComboBox can be a bit overwhelming. In this case, GtkComboBoxText offers a simple alternative. Both GtkComboBox and GtkComboBoxText can contain an entry.

## Details

### struct GtkComboBox

    struct GtkComboBox;

### gtk_combo_box_new ()

    GtkWidget *         gtk_combo_box_new                   (void);

Creates a new empty GtkComboBox.

Returns : | A new GtkComboBox.

Since 2.4

### gtk_combo_box_new_with_entry ()

    GtkWidget *         gtk_combo_box_new_with_entry        (void);

Creates a new empty GtkComboBox with an entry.

Returns : | A new GtkComboBox.

### gtk_combo_box_new_with_model ()

    GtkWidget *         gtk_combo_box_new_with_model        (GtkTreeModel *model);

Creates a new GtkComboBox with the model initialized to `model`.

`model` : | A GtkTreeModel.
Returns : | A new GtkComboBox.

Since 2.4

### gtk_combo_box_new_with_model_and_entry ()

    GtkWidget *         gtk_combo_box_new_with_model_and_entry
                                                            (GtkTreeModel *model);

Creates a new empty GtkComboBox with an entry and with the model initialized to `model`.

`model` : | A GtkTreeModel
Returns : | A new GtkComboBox

### gtk_combo_box_new_with_area ()

    GtkWidget *         gtk_combo_box_new_with_area         (GtkCellArea *area);

Creates a new empty GtkComboBox using `area` to layout cells.

`area` : | the GtkCellArea to use to layout cell renderers
Returns : | A new GtkComboBox.

### gtk_combo_box_new_with_area_and_entry ()

    GtkWidget *         gtk_combo_box_new_with_area_and_entry
                                                            (GtkCellArea *area);

Creates a new empty GtkComboBox with an entry.

The new combo box will use `area` to layout cells.

`area` : | the GtkCellArea to use to layout cell renderers
Returns : | A new GtkComboBox.

### gtk_combo_box_get_wrap_width ()

    gint                gtk_combo_box_get_wrap_width        (GtkComboBox *combo_box);

Returns the wrap width which is used to determine the number of columns for the popup menu. If the wrap width is larger than 1, the combo box is in table mode.

`combo_box` : | A GtkComboBox
Returns : | the wrap width.

Since 2.6

### gtk_combo_box_set_wrap_width ()

    void                gtk_combo_box_set_wrap_width        (GtkComboBox *combo_box,
                                                             gint width);

Sets the wrap width of `combo_box` to be `width`. The wrap width is basically the preferred number of columns when you want the popup to be layed out in a table.

`combo_box` : | A GtkComboBox
`width` : | Preferred number of columns

Since 2.4

### gtk_combo_box_get_row_span_column ()

    gint                gtk_combo_box_get_row_span_column   (GtkComboBox *combo_box);

Returns the column with row span information for `combo_box`.

`combo_box` : | A GtkComboBox
Returns : | the row span column.

Since 2.6

### gtk_combo_box_set_row_span_column ()

    void                gtk_combo_box_set_row_span_column   (GtkComboBox *combo_box,
                                                             gint row_span);

Sets the column with row span information for `combo_box` to be `row_span`. The row span column contains integers which indicate how many rows an item should span.

`combo_box` : | A GtkComboBox.
`row_span` : | A column in the model passed during construction.

Since 2.4

### gtk_combo_box_get_column_span_column ()

    gint                gtk_combo_box_get_column_span_column
                                                            (GtkComboBox *combo_box);

Returns the column with column span information for `combo_box`.

`combo_box` : | A GtkComboBox
Returns : | the column span column.

Since 2.6

### gtk_combo_box_set_column_span_column ()

    void                gtk_combo_box_set_column_span_column
                                                            (GtkComboBox *combo_box,
                                                             gint column_span);

Sets the column with column span information for `combo_box` to be `column_span`. The column span column contains integers which indicate how many columns an item should span.

`combo_box` : | A GtkComboBox
`column_span` : | A column in the model passed during construction

Since 2.4

### gtk_combo_box_get_active ()

    gint                gtk_combo_box_get_active            (GtkComboBox *combo_box);

Returns the index of the currently active item, or -1 if there's no active item. If the model is a non-flat treemodel, and the active item is not an immediate child of the root of the tree, this function returns `gtk_tree_path_get_indices (path)[0]`, where `path` is the GtkTreePath of the active item.

`combo_box` : | A GtkComboBox
Returns : | An integer which is the index of the currently active item, or -1 if there's no active item.

Since 2.4

### gtk_combo_box_set_active ()

    void                gtk_combo_box_set_active            (GtkComboBox *combo_box,
                                                             gint index_);

Sets the active item of `combo_box` to be the item at `index`.

`combo_box` : | A GtkComboBox
`index_` : | An index in the model passed during construction, or -1 to have no active item

Since 2.4

### gtk_combo_box_get_active_iter ()

    gboolean            gtk_combo_box_get_active_iter       (GtkComboBox *combo_box,
                                                             GtkTreeIter *iter);

Sets `iter` to point to the current active item, if it exists.

`combo_box` : | A GtkComboBox
`iter` : | The uninitialized GtkTreeIter. [out]
Returns : | `TRUE`, if `iter` was set

Since 2.4

### gtk_combo_box_set_active_iter ()

    void                gtk_combo_box_set_active_iter       (GtkComboBox *combo_box,
                                                             GtkTreeIter *iter);

Sets the current active item to be the one referenced by `iter`, or unsets the active item if `iter` is `NULL`.

`combo_box` : | A GtkComboBox
`iter` : | The GtkTreeIter, or `NULL`. [allow-none]

Since 2.4

### gtk_combo_box_get_id_column ()

    gint                gtk_combo_box_get_id_column         (GtkComboBox *combo_box);

Returns the column which `combo_box` is using to get string IDs for values from.

`combo_box` : | A GtkComboBox
Returns : | A column in the data source model of `combo_box`.

Since 3.0

### gtk_combo_box_set_id_column ()

    void                gtk_combo_box_set_id_column         (GtkComboBox *combo_box,
                                                             gint id_column);

Sets the model column which `combo_box` should use to get string IDs for values from. The column `id_column` in the model of `combo_box` must be of type `G_TYPE_STRING`.

`combo_box` : | A GtkComboBox
`id_column` : | A column in `model` to get string IDs for values from

Since 3.0

### gtk_combo_box_get_active_id ()

    const gchar *       gtk_combo_box_get_active_id         (GtkComboBox *combo_box);

Returns the ID of the active row of `combo_box`. This value is taken from the active row and the column specified by the "id-column" property of `combo_box` (see `gtk_combo_box_set_id_column()`).

The returned value is an interned string which means that you can compare the pointer by value to other interned strings and that you must not free it.

If the "id-column" property of `combo_box` is not set, or if no row is active, or if the active row has a `NULL` ID value, then `NULL` is returned.

`combo_box` : | a GtkComboBox
Returns : | the ID of the active row, or `NULL`

Since 3.0

### gtk_combo_box_set_active_id ()

    gboolean            gtk_combo_box_set_active_id         (GtkComboBox *combo_box,
                                                             const gchar *active_id);

Changes the active row of `combo_box` to the one that has an ID equal to `active_id`, or unsets the active row if `active_id` is `NULL`. Rows having a `NULL` ID string cannot be made active by this function.

If the "id-column" property of `combo_box` is unset or if no row has the given ID then the function does nothing and returns `FALSE`.

`combo_box` : | a GtkComboBox
`active_id` : | the ID of the row to select, or `NULL`. [allow-none]
Returns : | `TRUE` if a row with a matching ID was found. If a `NULL` `active_id` was given to unset the active row, the function always returns `TRUE`.

Since 3.0

### gtk_combo_box_get_model ()

    GtkTreeModel *      gtk_combo_box_get_model             (GtkComboBox *combo_box);

Returns the GtkTreeModel which is acting as data source for `combo_box`.

`combo_box` : | A GtkComboBox
Returns : | A GtkTreeModel which was passed during construction. [transfer none]

Since 2.4

### gtk_combo_box_set_model ()

    void                gtk_combo_box_set_model             (GtkComboBox *combo_box,
                                                             GtkTreeModel *model);

Sets the model used by `combo_box` to be `model`. Will unset a previously set model (if applicable). If model is `NULL`, then it will unset the model.

Note that this function does not clear the cell renderers, you have to call `gtk_cell_layout_clear()` yourself if you need to set up different cell renderers for the new model.

`combo_box` : | A GtkComboBox
`model` : | A GtkTreeModel. [allow-none]

Since 2.4

### gtk_combo_box_popup_for_device ()

    void                gtk_combo_box_popup_for_device      (GtkComboBox *combo_box,
                                                             GdkDevice *device);

Pops up the menu or dropdown list of `combo_box`, the popup window will be grabbed so only `device` and its associated pointer/keyboard are the only GdkDevices able to send events to it.

`combo_box` : | a GtkComboBox
`device` : | a GdkDevice

Since 3.0

### gtk_combo_box_popup ()

    void                gtk_combo_box_popup                 (GtkComboBox *combo_box);

Pops up the menu or dropdown list of `combo_box`.

This function is mostly intended for use by accessibility technologies; applications should have little use for it.

`combo_box` : | a GtkComboBox

Since 2.4

### gtk_combo_box_popdown ()

    void                gtk_combo_box_popdown               (GtkComboBox *combo_box);

Hides the menu or dropdown list of `combo_box`.

This function is mostly intended for use by accessibility technologies; applications should have little use for it.

`combo_box` : | a GtkComboBox

Since 2.4

### gtk_combo_box_get_popup_accessible ()

    AtkObject *         gtk_combo_box_get_popup_accessible  (GtkComboBox *combo_box);

Gets the accessible object corresponding to the combo box's popup.

This function is mostly intended for use by accessibility technologies; applications should have little use for it.

`combo_box` : | a GtkComboBox
Returns : | the accessible object corresponding to the combo box's popup. [transfer none]

Since 2.6

### gtk_combo_box_get_row_separator_func ()

    GtkTreeViewRowSeparatorFunc gtk_combo_box_get_row_separator_func
                                                            (GtkComboBox *combo_box);

Returns the current row separator function.

`combo_box` : | a GtkComboBox
Returns : | the current row separator function.

Since 2.6

### gtk_combo_box_set_row_separator_func ()

    void                gtk_combo_box_set_row_separator_func
                                                            (GtkComboBox *combo_box,
                                                             GtkTreeViewRowSeparatorFunc func,
                                                             gpointer data,
                                                             GDestroyNotify destroy);

Sets the row separator function, which is used to determine whether a row should be drawn as a separator. If the row separator function is `NULL`, no separators are drawn. This is the default value.

`combo_box` : | a GtkComboBox
`func` : | a GtkTreeViewRowSeparatorFunc
`data` : | user data to pass to `func`, or `NULL`. [allow-none]
`destroy` : | destroy notifier for `data`, or `NULL`. [allow-none]

Since 2.6

### gtk_combo_box_set_add_tearoffs ()

    void                gtk_combo_box_set_add_tearoffs      (GtkComboBox *combo_box,
                                                             gboolean add_tearoffs);

Sets whether the popup menu should have a tearoff menu item.

`combo_box` : | a GtkComboBox
`add_tearoffs` : | `TRUE` to add tearoff menu items

Since 2.6

### gtk_combo_box_get_add_tearoffs ()

    gboolean            gtk_combo_box_get_add_tearoffs      (GtkComboBox *combo_box);

Gets the current value of the :add-tearoffs property.

`combo_box` : | a GtkComboBox
Returns : | the current value of the :add-tearoffs property.

### gtk_combo_box_set_title ()

    void                gtk_combo_box_set_title             (GtkComboBox *combo_box,
                                                             const gchar *title);

Sets the menu's title in tearoff mode.

`combo_box` : | a GtkComboBox
`title` : | a title for the menu in tearoff mode

Since 2.10

### gtk_combo_box_get_title ()

    const gchar *       gtk_combo_box_get_title             (GtkComboBox *combo_box);

Gets the current title of the menu in tearoff mode. See `gtk_combo_box_set_add_tearoffs()`.

`combo_box` : | a GtkComboBox
Returns : | the menu's title in tearoff mode. This is an internal copy of the string which must not be freed.

Since 2.10

### gtk_combo_box_set_focus_on_click ()

    void                gtk_combo_box_set_focus_on_click    (GtkComboBox *combo,
                                                             gboolean focus_on_click);

Sets whether the combo box will grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don't want the keyboard focus removed from the main area of the application.

`combo` : | a GtkComboBox
`focus_on_click` : | whether the combo box grabs focus when clicked with the mouse

Since 2.6

### gtk_combo_box_get_focus_on_click ()

    gboolean            gtk_combo_box_get_focus_on_click    (GtkComboBox *combo);

Returns whether the combo box grabs focus when it is clicked with the mouse. See `gtk_combo_box_set_focus_on_click()`.

`combo` : | a GtkComboBox
Returns : | `TRUE` if the combo box grabs focus when it is clicked with the mouse.

Since 2.6

### gtk_combo_box_set_button_sensitivity ()

    void                gtk_combo_box_set_button_sensitivity
                                                            (GtkComboBox *combo_box,
                                                             GtkSensitivityType sensitivity);

Sets whether the dropdown button of the combo box should be always sensitive (`GTK_SENSITIVITY_ON`), never sensitive (`GTK_SENSITIVITY_OFF`) or only if there is at least one item to display (`GTK_SENSITIVITY_AUTO`).

`combo_box` : | a GtkComboBox
`sensitivity` : | specify the sensitivity of the dropdown button

Since 2.14

### gtk_combo_box_get_button_sensitivity ()

    GtkSensitivityType  gtk_combo_box_get_button_sensitivity
                                                            (GtkComboBox *combo_box);

Returns whether the combo box sets the dropdown button sensitive or not when there are no items in the model.

`combo_box` : | a GtkComboBox
Returns : | `GTK_SENSITIVITY_ON` if the dropdown button is sensitive when the model is empty, `GTK_SENSITIVITY_OFF` if the button is always insensitive or `GTK_SENSITIVITY_AUTO` if it is only sensitive as long as the model has one item to be selected.

Since 2.14

### gtk_combo_box_get_has_entry ()

    gboolean            gtk_combo_box_get_has_entry         (GtkComboBox *combo_box);

Returns whether the combo box has an entry.

`combo_box` : | a GtkComboBox
Returns : | whether there is an entry in `combo_box`.

Since 2.24

### gtk_combo_box_set_entry_text_column ()

    void                gtk_combo_box_set_entry_text_column (GtkComboBox *combo_box,
                                                             gint text_column);

Sets the model column which `combo_box` should use to get strings from to be `text_column`. The column `text_column` in the model of `combo_box` must be of type `G_TYPE_STRING`.

This is only relevant if `combo_box` has been created with "has-entry" as `TRUE`.

`combo_box` : | A GtkComboBox
`text_column` : | A column in `model` to get the strings from for the internal entry

Since 2.24

### gtk_combo_box_get_entry_text_column ()

    gint                gtk_combo_box_get_entry_text_column (GtkComboBox *combo_box);

Returns the column which `combo_box` is using to get the strings from to display in the internal entry.

`combo_box` : | A GtkComboBox.
Returns : | A column in the data source model of `combo_box`.

Since 2.24

### gtk_combo_box_set_popup_fixed_width ()

    void                gtk_combo_box_set_popup_fixed_width (GtkComboBox *combo_box,
                                                             gboolean fixed);

Specifies whether the popup's width should be a fixed width matching the allocated width of the combo box.

`combo_box` : | a GtkComboBox
`fixed` : | whether to use a fixed popup width

Since 3.0

### gtk_combo_box_get_popup_fixed_width ()

    gboolean            gtk_combo_box_get_popup_fixed_width (GtkComboBox *combo_box);

Gets whether the popup uses a fixed width matching the allocated width of the combo box.

`combo_box` : | a GtkComboBox
Returns : | `TRUE` if the popup uses a fixed width

Since 3.0

## Property Details

### The `"active"` property

      "active"                   gint                  : Read / Write

The item which is currently active. If the model is a non-flat treemodel, and the active item is not an immediate child of the root of the tree, this property has the value `gtk_tree_path_get_indices (path)[0]`, where `path` is the GtkTreePath of the active item.

Allowed values: >= G_MAXULONG

Default value: -1

Since 2.4

### The `"active-id"` property

      "active-id"                gchar*                : Read / Write

The value of the ID column of the active row.

Default value: NULL

Since 3.0

### The `"add-tearoffs"` property

      "add-tearoffs"             gboolean              : Read / Write

The add-tearoffs property controls whether generated menus have tearoff menu items.

Note that this only affects menu style combo boxes.

Default value: FALSE

Since 2.6

### The `"button-sensitivity"` property

      "button-sensitivity"       GtkSensitivityType    : Read / Write

Whether the dropdown button is sensitive when the model is empty.

Default value: GTK_SENSITIVITY_AUTO

Since 2.14

### The `"cell-area"` property

      "cell-area"                GtkCellArea*          : Read / Write / Construct Only

The GtkCellArea used to layout cell renderers for this combo box.

If no area is specified when creating the combo box with `gtk_combo_box_new_with_area()` a horizontally oriented GtkCellAreaBox will be used.

Since 3.0

### The `"column-span-column"` property

      "column-span-column"       gint                  : Read / Write

If this is set to a non-negative value, it must be the index of a column of type `G_TYPE_INT` in the model.

The values of that column are used to determine how many columns a value in the list will span.

Allowed values: >= G_MAXULONG

Default value: -1

Since 2.4

### The `"entry-text-column"` property

      "entry-text-column"        gint                  : Read / Write

The column in the combo box's model to associate with strings from the entry if the combo was created with "has-entry" = `TRUE`.

Allowed values: >= G_MAXULONG

Default value: -1

Since 2.24

### The `"focus-on-click"` property

      "focus-on-click"           gboolean              : Read / Write

Whether the combo box grabs focus when it is clicked with the mouse.

Default value: TRUE

### The `"has-entry"` property

      "has-entry"                gboolean              : Read / Write / Construct Only

Whether the combo box has an entry.

Default value: FALSE

Since 2.24

### The `"has-frame"` property

      "has-frame"                gboolean              : Read / Write

The has-frame property controls whether a frame is drawn around the entry.

Default value: TRUE

Since 2.6

### The `"id-column"` property

      "id-column"                gint                  : Read / Write

The column in the combo box's model that provides string IDs for the values in the model, if != -1.

Allowed values: >= G_MAXULONG

Default value: -1

Since 3.0

### The `"model"` property

      "model"                    GtkTreeModel*         : Read / Write

The model from which the combo box takes the values shown in the list.

Since 2.4

### The `"popup-fixed-width"` property

      "popup-fixed-width"        gboolean              : Read / Write

Whether the popup's width should be a fixed width matching the allocated width of the combo box.

Default value: TRUE

Since 3.0

### The `"popup-shown"` property

      "popup-shown"              gboolean              : Read

Whether the combo boxes dropdown is popped up. Note that this property is mainly useful, because it allows you to connect to notify::popup-shown.

Default value: FALSE

Since 2.10

### The `"row-span-column"` property

      "row-span-column"          gint                  : Read / Write

If this is set to a non-negative value, it must be the index of a column of type `G_TYPE_INT` in the model.

The values of that column are used to determine how many rows a value in the list will span. Therefore, the values in the model column pointed to by this property must be greater than zero and not larger than wrap-width.

Allowed values: >= G_MAXULONG

Default value: -1

Since 2.4

### The `"tearoff-title"` property

      "tearoff-title"            gchar*                : Read / Write

A title that may be displayed by the window manager when the popup is torn-off.

Default value: NULL

Since 2.10

### The `"wrap-width"` property

      "wrap-width"               gint                  : Read / Write

If wrap-width is set to a positive value, the list will be displayed in multiple columns, the number of columns is determined by wrap-width.

Allowed values: >= 0

Default value: 0

Since 2.4

## Style Property Details

### The `"appears-as-list"` style property

      "appears-as-list"          gboolean              : Read

Whether dropdowns should look like lists rather than menus.

Default value: FALSE

### The `"arrow-scaling"` style property

      "arrow-scaling"            gfloat                : Read

Sets the amount of space used up by the combobox arrow, proportional to the font size.

Allowed values: [0,2]

Default value: 1

Since 3.2

### The `"arrow-size"` style property

      "arrow-size"               gint                  : Read

Sets the minimum size of the arrow in the combo box. Note that the arrow size is coupled to the font size, so in case a larger font is used, the arrow will be larger than set by arrow size.

Allowed values: >= 0

Default value: 15

Since 2.12

### The `"shadow-type"` style property

      "shadow-type"              GtkShadowType         : Read

Which kind of shadow to draw around the combo box.

Default value: GTK_SHADOW_NONE

Since 2.12

## Signal Details

### The `"changed"` signal

    void                user_function                      (GtkComboBox *widget,
                                                            gpointer     user_data)      : Run Last

The changed signal is emitted when the active item is changed. The can be due to the user selecting a different item from the list, or due to a call to `gtk_combo_box_set_active_iter()`. It will also be emitted while typing into the entry of a combo box with an entry.

`widget` : | the object which received the signal
`user_data` : | user data set when the signal handler was connected.

Since 2.4

### The `"format-entry-text"` signal

    gchar*              user_function                      (GtkComboBox *combo,
                                                            gchar       *path,
                                                            gpointer     user_data)      : Run Last

For combo boxes that are created with an entry (See GtkComboBox:has-entry).

A signal which allows you to change how the text displayed in a combo box's entry is displayed.

Connect a signal handler which returns an allocated string representing `path`. That string will then be used to set the text in the combo box's entry. The default signal handler uses the text from the GtkComboBox::entry-text-column model column.

Here's an example signal handler which fetches data from the model and displays it in the entry.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    static gchar*
    format_entry_text_callback (GtkComboBox *combo,
                                const gchar *path,
                                gpointer     user_data)
    {
      GtkTreeIter iter;
      GtkTreeModel model;
      gdouble      value;

      model = gtk_combo_box_get_model (combo);

      gtk_tree_model_get_iter_from_string (model, &iter, path);
      gtk_tree_model_get (model, &iter,
                          THE_DOUBLE_VALUE_COLUMN, &value,
                          -1);

      return g_strdup_printf ("%g", value);
    }

`combo` : | the object which received the signal
`path` : | the GtkTreePath string from the combo box's current model to format text for
`user_data` : | user data set when the signal handler was connected.
Returns : | a newly allocated string representing `path` for the current GtkComboBox model. [transfer full]

Since 3.4

### The `"move-active"` signal

    void                user_function                      (GtkComboBox  *widget,
                                                            GtkScrollType scroll_type,
                                                            gpointer      user_data)        : Action

The ::move-active signal is a keybinding signal which gets emitted to move the active selection.

`widget` : | the object that received the signal
`scroll_type` : | a GtkScrollType
`user_data` : | user data set when the signal handler was connected.

Since 2.12

### The `"popdown"` signal

    gboolean            user_function                      (GtkComboBox *button,
                                                            gpointer     user_data)      : Action

The ::popdown signal is a keybinding signal which gets emitted to popdown the combo box list.

The default bindings for this signal are Alt+Up and Escape.

`button` : | the object which received the signal
`user_data` : | user data set when the signal handler was connected.

Since 2.12

### The `"popup"` signal

    void                user_function                      (GtkComboBox *widget,
                                                            gpointer     user_data)      : Action

The ::popup signal is a keybinding signal which gets emitted to popup the combo box list.

The default binding for this signal is Alt+Down.

`widget` : | the object that received the signal
`user_data` : | user data set when the signal handler was connected.

Since 2.12

## See Also

GtkComboBoxText, GtkTreeModel, GtkCellRenderer