« Return to Thread: Combobox (set active and retrieve data)

Combobox (set active and retrieve data)

by Robertico-2 :: Rate this Message:

Reply to Author | View in Thread

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@...
Tel. 57949690 (Recados)
================
      ("`-''-/").___..--''"`-._
       `6_ 6  )   `-.  (     ).`-.__.`)
       (_Y_.)'  ._   )  `._ `. ``-..-'
     _..`--'_..-_/  /--'_.' ,'
    (il),-''  (li),'  ((!.-'
Por mí raza hablará el espíritu...
======================

 « Return to Thread: Combobox (set active and retrieve data)