GdauiCombo

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

Synopsis

                    GdauiCombo;
GtkWidget *         gdaui_combo_new                     (void);
GtkWidget *         gdaui_combo_new_with_model          (GdaDataModel *model,
                                                         gint n_cols,
                                                         gint *cols_index);
void                gdaui_combo_set_model               (GdauiCombo *combo,
                                                         GdaDataModel *model,
                                                         gint n_cols,
                                                         gint *cols_index);
GdaDataModel *      gdaui_combo_get_model               (GdauiCombo *combo);
void                gdaui_combo_add_undef_choice        (GdauiCombo *combo,
                                                         gboolean add_undef_choice);
gboolean            gdaui_combo_set_values              (GdauiCombo *combo,
                                                         const GSList *values);
GSList *            gdaui_combo_get_values              (GdauiCombo *combo);
gboolean            gdaui_combo_undef_selected          (GdauiCombo *combo);
gboolean            gdaui_combo_set_values_ext          (GdauiCombo *combo,
                                                         const GSList *values,
                                                         gint *cols_index);
GSList *            gdaui_combo_get_values_ext          (GdauiCombo *combo,
                                                         gint n_cols,
                                                         gint *cols_index);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBin
                                 +----GtkComboBox
                                       +----GdauiCombo
                                             +----GdauiProviderSelector

Implemented Interfaces

GdauiCombo implements GtkBuildable, AtkImplementorIface, GtkCellLayout and GtkCellEditable.

Properties

  "model"                    GdaDataModel*         : Read / Write

Description

Details

GdauiCombo

typedef struct _GdauiCombo GdauiCombo;


gdaui_combo_new ()

GtkWidget *         gdaui_combo_new                     (void);

Create a new GdauiCombo widget.

Returns :

the newly-created widget.

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.

model :

a GdaDataModel object.

n_cols :

number of columns in the model to be shown

cols_index :

index of each column to be shown

Returns :

the newly-created widget.

gdaui_combo_set_model ()

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

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.

combo :

a GdauiCombo widget.

model :

a GdaDataModel object.

n_cols :

number of columns in the model to be shown

cols_index :

index of each column to be shown

gdaui_combo_get_model ()

GdaDataModel *      gdaui_combo_get_model               (GdauiCombo *combo);

This function returns the GdaDataModel from which combo displays values.

combo :

a GdauiCombo widget.

Returns :

a GdaDataModel containing the data from the GdauiCombo widget.

gdaui_combo_add_undef_choice ()

void                gdaui_combo_add_undef_choice        (GdauiCombo *combo,
                                                         gboolean add_undef_choice);

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

combo :

a GdauiCombo widget

add_undef_choice :


gdaui_combo_set_values ()

gboolean            gdaui_combo_set_values              (GdauiCombo *combo,
                                                         const GSList *values);

Sets the currently selected row of combo from the values stored in values.

WARNING: values must contain one value for each column set to be displayed when the data model was associated to combo.

combo :

a GdauiCombo widget

values :

a list of GValue

Returns :

TRUE if a row in the model was found to match the list of values.

gdaui_combo_get_values ()

GSList *            gdaui_combo_get_values              (GdauiCombo *combo);

Get a list of the currently selected values in combo. The list itself must be free'd using g_slist_free(), but not the values it contains.

WARNING: values will contain one value for each column set to be displayed when the data model was associated to combo.

combo :

a GdauiCombo widget

Returns :

a new list of values, or NULL if there is no displayed data in combo.

gdaui_combo_undef_selected ()

gboolean            gdaui_combo_undef_selected          (GdauiCombo *combo);

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

combo :

a GdauiCombo widget

Returns :


gdaui_combo_set_values_ext ()

gboolean            gdaui_combo_set_values_ext          (GdauiCombo *combo,
                                                         const GSList *values,
                                                         gint *cols_index);

Sets the currently selected row of combo from the values stored in values, assuming that these values correspond to the columns listed in cols_index. cols_index must contain at least as many gint as there are elements in values;

if cols_index is NULL, then it is assumed that values has the same number of columns than combo's data model and that the values in values are ordered in the same way as the columns of combo's data model.

combo :

a GdauiCombo widget

values :

a list of GValue objects

cols_index :

array of gint, index of column to which each value in values corresponds, or NULL

Returns :

TRUE if a row in the model was found to match the list of values.

gdaui_combo_get_values_ext ()

GSList *            gdaui_combo_get_values_ext          (GdauiCombo *combo,
                                                         gint n_cols,
                                                         gint *cols_index);

Get a list of the currently selected values in combo. The list itself must be free'd using g_slist_free(), but not the values it contains. If there is no selected value in combo, then NULL is returned.

if n_cols equals 0 and cols_index is NULL, then a GValue will be returned for each column of combo's data model.

combo :

a GdauiCombo widget

n_cols :

the number of columns for which values are requested

cols_index :

an array of n_cols gint indicating which column to get a value for, or NULL

Returns :

a new list of values, or NULL if there is no displayed data in combo.

Property Details

The "model" property

  "model"                    GdaDataModel*         : Read / Write