Re: gtkcombobox with self internal code to the options



Hi all,

I also needed the liststore implementation of a Combo for a different reason (I could not find a way to to make the simple Combo tell me the number of items currently in the list. With a list store implementation this is simply n = gtk_tree_model_iter_n_children ( (GtkTreeModel *)store , NULL );).

I confirm what Tadej was mentioning...

After moving the data into the liststore the following work for setting the active selection:

   GtkTreeIter iter ;
   char pathstring [ 20 ] ;
   sprintf ( pathstring , "%d" , selix ) ;
   gtk_tree_model_get_iter_from_string ((GtkTreeModel *)store,
                                       &iter, pathstring);
   gtk_combo_box_set_active_iter ((GtkComboBox *)c, &iter ) ;

This works too:

   gtk_combo_box_set_active ((GtkComboBox *)c, selix ) ;

Ken


--- On Fri, 25/6/10, Tadej Borovšak <tadeboro gmail com> wrote:

From: Tadej Borovšak <tadeboro gmail com>
Subject: Re: gtkcombobox with self internal code to the options
To: "John Williams" <asb1231 gmail com>
Cc: gtk-list gnome org
Date: Friday, 25 June, 2010, 2:39 AM

Hi.

> Shall I beg?

Maybe you should attach a check to your mail. ;-)

Seriously, sorry for this delay. gtk_combo_box_set_active() will work
just fine. If you have iter, you can also use
gtk_combo_box_set_active_iter().

Tadej

--
Tadej Borovšak
tadeboro.blogspot.com
tadeboro gmail com
tadej borovsak gmail com
_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list



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