## GdauiCombo

GdauiCombo — Combo box to choose from the contents of a GdaDataModel

## Stability Level

Stable, unless otherwise indicated

## Functions

GtkWidget * | gdaui_combo_new ()
GtkWidget * | gdaui_combo_new_with_model ()
void | gdaui_combo_set_model ()
void | gdaui_combo_add_null ()
gboolean | gdaui_combo_is_null_selected ()

## Properties

gboolean | as-list | Read / Write
GdaDataModel * | model | Read / Write

## Types and Values

struct | GdauiCombo

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBin
                        ╰── GtkComboBox
                            ╰── GdauiCombo
                                ╰── GdauiProviderSelector

## Implemented Interfaces

GdauiCombo implements AtkImplementorIface, GtkBuildable, GtkCellLayout, GtkCellEditable and GdauiDataSelector.

## Includes

    #include <libgda/thread-wrapper/gda-thread-wrapper.h>

## Description

## Functions

### gdaui_combo_new ()

    GtkWidget *
    gdaui_combo_new (void);

Create a new GdauiCombo widget.

#### Returns

the newly-created widget.

[transfer full]

Since: 4.2

### gdaui_combo_new_with_model ()

    GtkWidget *
    gdaui_combo_new_with_model (GdaDataModel *model,
                                gint n_cols,
                                gint *cols_index);

Create a new GdauiCombo widget with a model. See `gdaui_combo_set_model()` for more information about the `n_cols` and `cols_index` usage.

#### Parameters

model | a GdaDataModel object. |
n_cols | number of columns in the model to be shown |
cols_index | an array of columns to be shown, its size must be `n_cols` |

#### Returns

the newly-created widget.

[transfer full]

Since: 4.2

### gdaui_combo_set_model ()

    void
    gdaui_combo_set_model (GdauiCombo *combo,
                           GdaDataModel *model,
                           gint n_cols,
                           gint *cols_index);

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

Makes `combo` display data stored in `model` (makes the combo widget refresh its list of values and display the values contained in the model). A NULL `model` will make the combo empty and disassociate the previous model, if any.

if `n_cols` is `0`, then all the columns of `model` will be displayed in `combo` .

[skip]

#### Parameters

combo | a GdauiCombo widget. |
model | a GdaDataModel object. |
n_cols | number of columns in the model to be shown |
cols_index | an array of columns to be shown, its size must be `n_cols` . | [array length=n_cols]

Since: 4.2

### gdaui_combo_add_null ()

    void
    gdaui_combo_add_null (GdauiCombo *combo,
                          gboolean add_null);

Tells if `combo` should add a special entry representing an "undefined choice", as a `NULL` entry. The default is that only the available choices in `combo` 's model are presented.

#### Parameters

combo | a GdauiCombo widget |
add_null | set to `TRUE` to add a NULL value to the combo box |

Since: 4.2

### gdaui_combo_is_null_selected ()

    gboolean
    gdaui_combo_is_null_selected (GdauiCombo *combo);

Tell if the currently selected entry represents the "undefined choice" entry.

#### Parameters

combo | a GdauiCombo widget |

#### Returns

`TRUE` if the `NULL` value is selected

Since: 4.2

## Types and Values

### struct GdauiCombo

    struct GdauiCombo;

## Property Details

### The `“as-list”` property

      “as-list”                  gboolean

Owner: GdauiCombo

Flags: Read / Write

Default value: FALSE

### The `“model”` property

      “model”                    GdaDataModel *

Owner: GdauiCombo

Flags: Read / Write