in reply to Re^4: Insert checkbutton into MListbox
in thread Insert checkbutton into MListbox
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;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Insert checkbutton into MListbox
by ghosh123 (Monk) on Feb 06, 2012 at 14:11 UTC | |
by chessgui (Scribe) on Feb 06, 2012 at 16:03 UTC | |
by ghosh123 (Monk) on Feb 07, 2012 at 09:00 UTC | |
by ghosh123 (Monk) on Feb 09, 2012 at 09:17 UTC |
In Section
Seekers of Perl Wisdom