bug
| From: | Pablo DallOglio | Date: | Thu, 12 Feb 2009 23:54:10 +0000 |
| Subject: | bug | ||
| Groups: | php.gtk.dev | ||
| Request: | Send a blank email to php-gtk-dev+get-4316@lists.php.net to get a copy of this message | ||
Hello
When creating a combobox using a GtkListStore, PHP-GTK gives me this
error:
(combobox_model.php:7672): GLib-GObject-WARNING **:
IA__g_object_new_valist: object class `GtkComboBox' has no property
named `text-column'
Does anyone knows what it can be ? The code is below:
<?php
$window = new GtkWindow;
$window->set_default_size(200,100);
$window->set_border_width(20);
$window->set_position(GTK::WIN_POS_CENTER);
$model = new GtkListStore(GObject::TYPE_OBJECT, GObject::TYPE_STRING);
$comboBox = new GtkComboBox($model); // => the error is here
$cell_renderer1 = new GtkCellRendererPixbuf();
$cell_renderer2 = new GtkCellRendererText();
$comboBox->pack_start($cell_renderer1, false);
$comboBox->pack_start($cell_renderer2, true);
$comboBox->set_attributes($cell_renderer1, 'pixbuf', 0);
$comboBox->set_attributes($cell_renderer2, 'text', 1);
$items = array();
$items[] = array('ico_pdf.png', 'Arquivo PDF');
$items[] = array('ico_php.png', 'Arquivo PHP');
foreach ($items as $item)
{
$imagem = $item[0];
$texto = $item[1];
$pixbuf = GdkPixbuf::new_from_file($imagem);
$iter = $model->append(array($pixbuf, $texto));
}
$comboBox->set_active(0);
$window->add($comboBox);
$window->show_all();
Gtk::main();
?>