use Tk;
my $mw=new MainWindow;
my $item_width=15;
my %attr_item=('-background'=>'#ffafaf');
my %attr_btn=('-background'=>'#afffaf','-activebackground'=>'#7aaa7a')
+;
my $text=$mw->Scrolled('Text',
-insertontime=>0,
-scrollbars=>'e',
-width=>($item_width+15),
-background=>'#efefef'
)->pack;
my $first=1;
$text->tagConfigure('item',%attr_item);
foreach my $item ("State" , "Dependency", "CalcTime", "Result")
{
my $btn=$text->Checkbutton(%attr_item,'-activebackground'=>'#ff7f7
+f');
my $up=$text->Button(-text=>'Up',%attr_btn);
my $down=$text->Button(-text=>'Down',%attr_btn);
$text->insert('1.0',"\n") unless $first; $first=0;
$text->windowCreate('1.0',-window=>$up);
$text->windowCreate('1.0',-window=>$down);
$text->windowCreate('1.0',-window=>$btn);
$text->insert('1.0',sprintf('%-'.$item_width.'s',$item));
$text->tagAdd('item','1.0',"1.$item_width");
}
MainLoop;
|