Subject: | problem with character encodings and Tk804.025 |
activeperl 5.8.0,
simple program (attached),
I do a `pp program.pl', run a.exe,
and instead of seeing May, Exit, or "Select Random",
all I see is a bunch of sqares (basically a char encoding problem).
This all with Tk804.025_beta2, you may wish to forward to the Tk authors.
use Tk;
my $mw = MainWindow->new();
my $var;
my @list = qw(jan feb mar apr);
my $opt = $mw->Optionmenu(
-options => [@list],
-command => sub { print "got: ", shift, "\n" },
-variable => \$var,
)->pack;
$opt->addOptions([may=>5],[jun=>6],[jul=>7],[aug=>8]);
$mw->Label(-textvariable=>\$var, -relief=>'groove')->pack;
$mw->Button(-text=>'Exit', -command=>sub{$mw->destroy})->pack;
$mw->Button(
-text => 'Select Random',
-command => sub {
#$opt->setOption( $list[int rand @list] );
$opt->setOption( int rand @list );
}
)->pack;
MainLoop;