For the TableMatrix I think it is the only way. The HList widget uses Tk::ItemStyle, which I've only seen used on the HList. There is also the optionAdd method. A simple example:
#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::HList; use Tk::ItemStyle; my $mw = MainWindow->new(); my $green = $mw->ItemStyle( 'text', -stylename => 'green', -bg => 'green', -fg => 'black', ); $mw->optionAdd("*background", 'red'); $mw->optionAdd("*foreground", 'blue'); my $hlist; $hlist = $mw->HList( -itemtype => 'text', -selectmode => 'single', )->pack(-fill=>'both',-expand=>1); $hlist->columnWidth(0, -char, 90); for (1..1000) { $hlist->add($_, -text=>$_); } for (my $i = 1 ; $i < 1000 ; $i += 2){ $hlist->entryconfigure( $i, -style => 'green' ); } MainLoop;
In reply to Re: TableMatrix - setting cells characteristics - eg colour & state
by zentara
in thread TableMatrix - setting cells characteristics - eg colour & state
by merrymonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |