Combobox (set active and retrieve data)
| From: | Robertico | Date: | Tue, 21 Aug 2007 16:45:07 +0000 |
| Subject: | Combobox (set active and retrieve data) | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-8051@lists.php.net to get a copy of this message | ||
Hi .
I have an array with pair values $aProveedor =
array(04=>"Nacional",05=>"Extranjero",06=>"Global");
And hace this code.
$cajasCampos[$fila] = new GtkComboBox();
$modelo2 = new GtkListStore(Gtk::TYPE_STRING);
$cajasCampos[$fila]->set_model($modelo2);
$cellRenderer = new GtkCellRendererText();
$cajasCampos[$fila]->pack_start($cellRenderer);
$cajasCampos[$fila]->set_attributes($cellRenderer, 'text', 0);
foreach($aProveedor as $proveedor)
{
$modelo2->append(array($proveedor));
}
$cajasCampos[$fila]->set_active(0); //(1) --> How can I set active by
index? I mean set_active(04) | set_active(05) | set_active(06)
(2) I need the combo shows the Text Values (Nacional, Extranjero, Global),
but when I retrieve date value I need to get the numeric values (04,05,06)
How can I do that?
Thanks in advance!!
--
L.I. Roberto Carlos Bárcenas Adame.
roberto.barcenas@gmail.com
Tel. 57949690 (Recados)
================
("
-''-/").___..--''"-._
6_ 6 ) -. ( ).-.__.)
(_Y_.)' ._ ) ._ . ``-..-'
_..`--'_..-_/ /--'_.' ,'
(il),-'' (li),' ((!.-'
Por mí raza hablará el espíritu...
======================