Re: GtkComboBox:: insert_text()

From: Date: Sat, 19 Nov 2005 11:01:14 +0000
Subject: Re: GtkComboBox:: insert_text()
References: 1 2  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-6351@lists.php.net to get a copy of this message
I did use the method by using the new_text() function. As you mentioned I did use a translation array to initially solve this problem and will just leave it in place. On 11/19/05, Christian Weiske <cweiske@cweiske.de> wrote: > > Tabber, > > > GtkComboBox::insert_text does not function how I belive it is described > in > > > > http://cweiske.dyndns.org/en/html/gtk/gtk.gtkcombobox.method.insert_text.html > > > > I am populating the combo box with a possible listings from my database, > and > > want to use their unique ids as their index. But when I try to grab the > > selected index or use GtkComboBox::set_active I need to use the > generated > > index. > > The manual states: > Note that you can only use this method with combo boxes constructed with > the new_text() function. > > As associative arrays don't exist in c as in php, they are converted to > a normal array, keys starting from 0. > > You could create an translation array which translated the keys from > your db ids to sequential ones. > > -- > Regards/MfG, > Christian Weiske > > >

« previous php.gtk.general (#6351) next »