pixbuf in a treestor



Is there some hidden trick I don't know, to display a pixbuf in a TreeStore??

This is what I did:


the model:

$model = Gtk2::TreeStore->new (qw/ 
                Glib::String Glib::String       Gtk2::Gdk::Pixbuf Glib::String 
                Glib::String Glib::String       / );

set the column:

$cell = Gtk2::CellRendererPixbuf->new;
$col = Gtk2::TreeViewColumn->new;
$col->pack_start($cell,2);
$col->add_attribute ($cell, pixbuf => 0);

load the pixbuf:
$redbar=Gtk2::Gdk::Pixbuf->new_from_file(ICONPATH."red.png");


show data:

$model->set ($iter,0, $name     1, $fullpath,
                                2, $redbar,     3, $perc,
                                4, calc($size), 5, $size);

But the column with the pixbuf is empty. No errors, the "text" columns are ok...



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]