Re: Reading from a GtkComboBox created with ..._new_text()

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

 



Hi

Internally the GtkComboBox created with gtk_combo_box_new_text() uses a
GtkListStore as it's "TreeModel". Just call gtk_combo_box_get_model() to
get it.

> I would like to loop around all items in the combo.

model = gtk_combo_box_get_model( combo );

if( ! gtk_tree_model_get_iter_first( model, &iter ) )
	return -1; // Empty list

do {
	gtk_tree_model_get( model, &iter, 0, &combo_text, -1 );

	g_free( combo_text );
}
while( gtk_tree_model_iter_next( model, &iter ) );

HTH

Jan-Marek
_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux