WIP: on_bind_cb() Bind data from the store object to the widget << adapting from the kriptolix example
This commit is contained in:
parent
cfa46b6a2a
commit
7bd92fad23
|
@ -56,12 +56,17 @@ static void on_setup_cb (GtkSignalListItemFactory *self, GtkListItem *my_list_it
|
|||
}
|
||||
|
||||
static void on_bind_cb (GtkSignalListItemFactory *self, GtkListItem *my_list_item, gpointer user_data)
|
||||
/* Bind data from the store object to the widget << adapting from the kriptolix example */
|
||||
{
|
||||
GtkWidget *my_label = gtk_list_item_get_child (my_list_item);
|
||||
/* my_string_object is owned by the instance. Caller mustn't change or destroy it. */
|
||||
GtkStringObject *my_string_object = gtk_list_item_get_item (my_list_item);
|
||||
/* The string returned by gtk_string_object_get_string is owned by the instance. */
|
||||
gtk_label_set_text (GTK_LABEL (my_label), gtk_string_object_get_string (my_string_object));
|
||||
GtkWidget *my_expander = gtk_expander_new (NULL);
|
||||
gtk_expander_set_child (GTK_EXPANDER(my_expander), gtk_list_item_get_child (my_list_item));
|
||||
|
||||
|
||||
GtkWidget *my_label = gtk_list_item_get_child (my_list_item);
|
||||
/* my_string_object is owned by the instance. Caller mustn't change or destroy it. */
|
||||
GtkStringObject *my_string_object = gtk_list_item_get_item (my_list_item);
|
||||
/* The string returned by gtk_string_object_get_string is owned by the instance. */
|
||||
gtk_label_set_text (GTK_LABEL (my_label), gtk_string_object_get_string (my_string_object));
|
||||
}
|
||||
|
||||
static void on_selection_change (GtkStringList *my_selection_model, guint position, guint n_items, gpointer user_data)
|
||||
|
|
Loading…
Reference in New Issue