SimpleList and CellRenderer tweaking




Hiho,

I have a problem with a Gtk2::SimpleList and some CellRenderer tweaking.
I want to make the font of the first three columns bold, if the fifth 
column of my list is true.

This is the corresponding code snippet:

    my $slist = Gtk2::SimpleList->new (
            "Nr"       => "int",
            "Artist"   => "text",
            "Album"    => "text",
            "Title"    => "text",
            "ids"      => "text",
            "playing"  => "bool",
    );

    $slist->get_column(4)->set_visible(0);
    $slist->get_column(5)->set_visible(0);

    my $bold_cr = Gtk2::CellRendererText->new;
    $bold_cr->set ( weight => 700 );

    $slist->get_column($_)->add_attribute($bold_cr, weight_set => 5)
            for (0..3);

But I get only an assertion warning for the ->add_attribute(...) line:

  Gtk-CRITICAL **: file gtktreeviewcolumn.c: line 1359
    (gtk_tree_view_column_add_attribute): assertion `info != NULL'

I hope someone can delight me what I'm doing wrong here ;)

Thanks,

Joern

-- 
sub i($){print$_[0]}*j=*ENV;sub w($){sleep$_[0]}sub _($){i"$p:$c> ",w+01
,$_=$_[0],tr;i-za-h,;a-hi-z ;,i$_,w+01,i"\n"}$|=1;$f='HO';($c=$j{PWD})=~
s+$j{$f."ME"}+~+;$p.="$j{USER}\@".`hostname`;chop$p;_"kl",$c='~',_"zu,".
"-zn,*",_"#,epg,lw,gwc,mfmkcbm,cvsvwev,uiqt,kwvbmvb?",i"$p:$c> ";w+1<<07

Attachment: pgp6vtlqXL8Zk.pgp
Description: PGP signature



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