- 论坛徽章:
- 0
|
大家好,
我的的系统是CentOS5.9,在我的系统运行perl语言编写的图形界面程序时,在图形界面的对话框中,无法用键盘输入,是怎么回事?
下面是一个测试程序(test.pl),运行perl test.pl时,会弹出一个对话框,我也无法在这个对话框中用键盘输入。大家帮忙看看吧。
#!/usr/bin/perl
use Tk;
$mw = MainWindow->new;
$mw->title("Entry");
$e_txt = "Entry Text"; # Create Entry with initial text
$e = $mw->Entry(-textvariable => \$e_txt)->pack(-expand => 1,
-fill => 'x');
$mw->Button(-text => "Exit",
-command => sub { exit })->pack(-side => 'bottom');
# Create a Button that will insert a counter at the cursor
$i = 1;
$mw->Button(-text => "Insert #", -command =>
sub {
if ($e->selectionPresent( )) {
$e->insert('sel.last', "$i"); $i++;
}
})->pack;
MainLoop;
|
|