Re: gtkcombobox with self internal code to the options

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

 



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@xxxxxxxxx> wrote:

From: Tadej Borovšak <tadeboro@xxxxxxxxx>
Subject: Re: gtkcombobox with self internal code to the options
To: "John Williams" <asb1231@xxxxxxxxx>
Cc: gtk-list@xxxxxxxxx
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@xxxxxxxxx
tadej.borovsak@xxxxxxxxx
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

_______________________________________________
gtk-list mailing list
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