gtk_combo_box_set_model fails to set model...
- From: Setzer- <setzer sm-soft org>
- To: gtk-app-devel-list gnome org
- Subject: gtk_combo_box_set_model fails to set model...
- Date: Wed, 20 Oct 2004 22:11:39 -0400
I'm trying to use the new gtk_combo w/ models, however, after I set the
model I had created to a combo box,
using gtk_combo_box_get_model returns NULL.
the model is created as follow :
GtkTreeModel *symboles_list;
symboles_list = GTK_TREE_MODEL (gtk_list_store_new(3,
G_TYPE_STRING,
G_TYPE_POINTER,
G_TYPE_BOOLEAN));
// At this point, symboles_list is succesfully created (i.e. != NULL)
/* ... */
// fill it with some data (variables were filled earlier in the code)
gtk_tree_store_append(GTK_TREE_STORE(symboles_list), &iter, NULL);
gtk_tree_store_set(GTK_TREE_STORE(symboles_list), &iter,
0, key, // Col 0 set to key
1, preclist, // Col 1 set to list pointer
2, IsTerminal, -1); // Col 2 set to IsTerminal
// Attach the model to the combo box
gtk_combo_box_set_model(GTK_COMBO_BOX (symboles),
GTK_TREE_MODEL(symboles_list));
// Verify
model = gtk_combo_box_get_model(GTK_COMBO_BOX(symboles));
//model == NULL. : (
earlier in the code,
GtkWidget *symboles;
GtkCellRenderer *renderer;
symboles = gtk_combo_new();
renderer = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (symboles),
renderer, FALSE);
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (symboles),
renderer, "text", 0);
// Then the function to create the model, fill it and attach it is called.
This code follows that of
http://mail.gnome.org/archives/gtk-list/2004-June/msg00253.html,
which was probably mentioning the same problem.
BTW, I have GTK+ 2.4.3 win32.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]