| Top |
HdyComboRowHdyComboRow — A GtkListBox row used to choose from a list of items |
| gchar * | (*HdyComboRowGetNameFunc) () |
| gchar * | (*HdyComboRowGetEnumValueNameFunc) () |
| HdyComboRow * | hdy_combo_row_new () |
| GListModel * | hdy_combo_row_get_model () |
| void | hdy_combo_row_bind_model () |
| void | hdy_combo_row_bind_name_model () |
| void | hdy_combo_row_set_for_enum () |
| gchar * | hdy_enum_value_row_name () |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkListBoxRow ╰── HdyActionRow ╰── HdyComboRow
The HdyComboRow widget allows the user to choose from a list of valid choices. The row displays the selected choice. When activated, the row displays a popover which allows the user to make a new choice.
The HdyComboRow uses the model-view pattern; the list of valid choices is specified in the form of a GListModel, and the display of the choices can be adapted to the data in the model via widget creation functions.
gchar * (*HdyComboRowGetNameFunc) (gpointer item,gpointer user_data);
Called for combo rows that are bound to a GListModel with
hdy_combo_row_bind_name_model() for each item that gets added to the model.
gchar * (*HdyComboRowGetEnumValueNameFunc) (HdyEnumValueObject *value,gpointer user_data);
Called for combo rows that are bound to an enumeration with
hdy_combo_row_set_for_enum() for each value from that enumeration.
HdyComboRow *
hdy_combo_row_new (void);
Creates a new HdyComboRow.
Since: 0.0.6
GListModel *
hdy_combo_row_get_model (HdyComboRow *self);
Gets the model bound to self
, or NULL if none is bound.
Since: 0.0.6
void hdy_combo_row_bind_model (HdyComboRow *self,GListModel *model,GtkListBoxCreateWidgetFunc create_list_widget_func,GtkListBoxCreateWidgetFunc create_current_widget_func,gpointer user_data,GDestroyNotify user_data_free_func);
Binds model
to self
.
If self
was already bound to a model, that previous binding is destroyed.
The contents of self
are cleared and then filled with widgets that represent
items from model
. self
is updated whenever model
changes. If model
is
NULL, self
is left empty.
self |
||
model |
the GListModel to be bound to |
[nullable] |
create_list_widget_func |
a function that creates widgets for
items to display in the list, or |
[nullable] |
create_current_widget_func |
a function that creates
widgets for items to display as the seleted item, or |
[nullable][scope call] |
user_data |
user data passed to |
|
user_data_free_func |
function for freeing |
Since: 0.0.6
void hdy_combo_row_bind_name_model (HdyComboRow *self,GListModel *model,HdyComboRowGetNameFunc get_name_func,gpointer user_data,GDestroyNotify user_data_free_func);
Binds model
to self
.
If self
was already bound to a model, that previous binding is destroyed.
The contents of self
are cleared and then filled with widgets that represent
items from model
. self
is updated whenever model
changes. If model
is
NULL, self
is left empty.
This is more conventient to use than hdy_combo_row_bind_model() if you want
to represent items of the model with names.
self |
||
model |
the GListModel to be bound to |
[nullable] |
get_name_func |
a function that creates names for items, or |
[nullable] |
user_data |
user data passed to |
|
user_data_free_func |
function for freeing |
Since: 0.0.6
void hdy_combo_row_set_for_enum (HdyComboRow *self,GType enum_type,HdyComboRowGetEnumValueNameFunc get_name_func,gpointer user_data,GDestroyNotify user_data_free_func);
Creates a model for enum_type
and binds it to self
. The items of the model
will be HdyEnumValueObject objects.
If self
was already bound to a model, that previous binding is destroyed.
The contents of self
are cleared and then filled with widgets that represent
items from model
. self
is updated whenever model
changes. If model
is
NULL, self
is left empty.
This is more conventient to use than hdy_combo_row_bind_name_model() if you
want to represent values of an enumeration with names.
See hdy_enum_value_row_name().
Since: 0.0.6
gchar * hdy_enum_value_row_name (HdyEnumValueObject *value,gpointer user_data);
This is a default implementation of HdyComboRowGetEnumValueNameFunc to be
used with hdy_combo_row_set_for_enum(). If the enumeration has a nickname, it
will return it, otherwise it will return its name.
value |
the value from the enum from which to get a name |
|
user_data |
unused user data. |
[closure] |
Since: 0.0.6