Re: SimpleList and CellRenderer tweaking



muppet wrote:

you're adding the attribute on a new cell renderer that you're not 
using; however, the cell renderer you pass to add_attributes must be 
one that you've already packed into the column.

Yep, sounds reasonable ;)

also, you have an 
off-by-one on the loop if you just want the first three.  i think you 
want instead something like this:

It was an off-by-one in my description, but this really doesn't 
matter... ;)

   for (0..2) {
       my $col = $slist->get_column ($_);
       my $cell = ($col->get_cell_renderers)[0];  #consider only the first
       $col->add_attribute ($cell, weight_set => 5);
   }

I needed to add

  $cell->set ( weight => 700 );

otherwise the cellrender didn't know which weight to set. Now it works 
perfectly, thanks.

Regards,

Joern

-- 
Joern Reder
supporting:   http://www.zyn.de/
unbelievable: http://www.exit1.org/
CPAN:         http://www.perl.com/CPAN/modules/by-authors/id/J/JR/JRED

Attachment: pgpGYMZyncBkJ.pgp
Description: PGP signature



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