![]() |
![]() |
![]() |
GNOME Data Access 4 manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
GdauiComboGdauiCombo — Combo box to choose from the contents of a GdaDataModel |
![]() |
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);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkBin +----GtkComboBox +----GdauiCombo +----GdauiProviderSelector
GdauiCombo implements GtkBuildable, AtkImplementorIface, GtkCellLayout and GtkCellEditable.
GtkWidget * gdaui_combo_new (void);
Create a new GdauiCombo widget.
Returns : |
the newly-created widget. |
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.
|
a GdaDataModel object. |
|
number of columns in the model to be shown |
|
index of each column to be shown |
Returns : |
the newly-created widget. |
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
.
|
a GdauiCombo widget. |
|
a GdaDataModel object. |
|
number of columns in the model to be shown |
|
index of each column to be shown |
GdaDataModel * gdaui_combo_get_model (GdauiCombo *combo);
This function returns the GdaDataModel from which combo
displays values.
|
a GdauiCombo widget. |
Returns : |
a GdaDataModel containing the data from the GdauiCombo widget. |
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.
|
a GdauiCombo widget |
|
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
.
|
a GdauiCombo widget |
|
a list of GValue |
Returns : |
TRUE if a row in the model was found to match the list of 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
.
|
a GdauiCombo widget |
Returns : |
a new list of values, or NULL if there is no displayed data in combo .
|
gboolean gdaui_combo_undef_selected (GdauiCombo *combo);
Tell if the currently selected entry represents the "undefined choice" entry.
|
a GdauiCombo widget |
Returns : |
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.
|
a GdauiCombo widget |
|
a list of GValue objects |
|
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. |
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.
|
a GdauiCombo widget |
|
the number of columns for which values are requested |
|
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 .
|