[Glade-users] Dynamically add data to GtkComboEntry ListStore



I was able to solve my problem after reading GtkComboBox widget - part 2 
<http://tadeboro.blogspot.com/2009/04/as-promised-im-back-with-second-part-of.html>by 
Tadej Borov?ak.  I changed my code to do the following (simplified by 
removing the enum):

     data->country_store = gtk_list_store_new (2, G_TYPE_STRING, 
G_TYPE_STRING);

     gtk_list_store_append( data->country_store, &iter );
     gtk_list_store_set( data->country_store, &iter, 0, "America", 1, 
"USA", -1 );
     gtk_list_store_append( data->country_store, &iter );
     gtk_list_store_set( data->country_store, &iter, 0, "Canada", 1, 
"CAN", -1 );
     gtk_combo_box_set_model ( data->country, GTK_TREE_MODEL 
(data->country_store));


Thanks Tadej for the great tutorial,

Patrick
__
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20100513/6b04ca9c/attachment.html 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]