Help with CellRenderText.



When doing the following


----- SNAP ---------
$tree_model = Gtk2::TreeStore->new (qw/
                                         Glib::String
                                         Glib::String
                                         Glib::Boolean
                                         Glib::Boolean /);
$tree_view = Gtk2::TreeView->new($tree_model);
       
my $renderer = Gtk2::CellRendererText->new;
$tree_view->insert_column_with_data_func(
                                0,
                                "asd",
                                $renderer,
                                sub {
                                       my ($treecol, $cell, $model,
$iter, $col_num) = @_;
                                       my $id = $model->get ($iter, 1);
                                       $cell->set (text =>
$info);                                             
                                       $cell->set(weight => 600 ) if
($id > 20);
                                                
                                     },
                                undef
        );
------- SNAP ----------

shouldn't this turn bold just the cells where the id is greater then 20?
when i do this i get all the column bold....

how can i set a renderer attribute to only a cell, not the entire
column?

Thanx




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