| 1 |
#!/usr/local/bin/perl -w |
| 2 |
use Tk; |
| 3 |
my $top = MainWindow->new; |
| 4 |
my $i = $top->Photo(-file => Tk->findINC('icon.gif')); |
| 5 |
my $t = $top->Text->grid; |
| 6 |
my $l = $top->Label(-text => 'Frog'); |
| 7 |
$t->insert('end',"A Label '"); |
| 8 |
$t->windowCreate('end', -window => $l); |
| 9 |
$t->insert('end',"'\n"); |
| 10 |
$t->insert('end',"An Image '"); |
| 11 |
$t->imageCreate('end', -image => $i); |
| 12 |
$t->insert('end',"'\n"); |
| 13 |
print join(',', $t->dump('1.0', 'end')), "\n"; |
| 14 |
$t->dump(-command => \&dump, '1.0', 'end'); |
| 15 |
MainLoop; |
| 16 |
|
| 17 |
sub dump |
| 18 |
{ |
| 19 |
print join(',',@_),"\n"; |
| 20 |
} |
| 21 |
|
| 22 |
__END__ |
| 23 |
|
| 24 |
|