Exemple #1
0
 function new_column($label, $cell_type, $index)
 {
     //check cell type
     if ($cell_type == 'text') {
         $this->celulas[$index] = new GtkCellRendererText();
     } elseif ($cell_type == 'active') {
         $this->celulas[$index] = new GtkCellRendererToggle();
         $this->celulas[$index]->connect('toggled', array($this, 'sel_toggled'));
     } elseif ($cell_type == 'pixbuf') {
         $this->celulas[$index] = new GtkCellRendererPixbuf();
     }
     $column = new GtkTreeViewColumn($label, $this->celulas[$index], $cell_type, $index);
     $column->set_reorderable(true);
     $column->set_sort_column_id($index);
     $column->set_resizable(true);
     $column->connect('clicked', array($this, 'column_clicked'));
     $this->treeview->append_column($column);
     return $column;
 }