| 1 |
#!/usr/local/bin/perl -w |
| 2 |
|
| 3 |
use Tk; |
| 4 |
use Tk::HList; |
| 5 |
use Tk::ItemStyle; |
| 6 |
|
| 7 |
$top = new MainWindow; |
| 8 |
$hl = $top->HList->pack; |
| 9 |
$redstyle = $top->ItemStyle('text', |
| 10 |
-foreground => 'red', |
| 11 |
-font => '10x20', |
| 12 |
-background => 'green'); |
| 13 |
|
| 14 |
print $redstyle,"\n"; |
| 15 |
|
| 16 |
$bluestyle = $top->ItemStyle('text', |
| 17 |
-foreground => 'blue', |
| 18 |
-background => 'white', |
| 19 |
); |
| 20 |
|
| 21 |
$hl->add(0, -itemtype => 'text', -text => 'red', -style => $redstyle); |
| 22 |
$hl->add(1, -itemtype => 'text', -text => 'blue', -style => $bluestyle); |
| 23 |
|
| 24 |
$top->after(5000, [ configure => $redstyle, -background => 'cyan' ]); |
| 25 |
|
| 26 |
MainLoop; |
| 27 |
|