perl之达人请进
所在版块:求学狮城 发贴时间:2007-06-13 16:39

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
有这样一段code

#!/usr/bin/perl -w

use Tk;

my $mw = MainWindow -> new();
$mw -> configure (-width => 200, -height => 200);

my $tf = $mw -> Entry (-width => 10, -background => "white") -> pack (-side => "left");
$tf -> insert ("end", "kao");

my $button = $mw -> Button (-text => "GO", -background => "white") -> pack (-side => "right");

MainLoop();

运行之后发现textfield $tf就不是editable的了,但是如果我把顺序换过来,button在tf的前面的话,就可以了。

#!/usr/bin/perl -w

use Tk;

my $mw = MainWindow -> new();
$mw -> configure (-width => 200, -height => 200);

my $button = $mw -> Button (-text => "GO", -background => "white") -> pack (-side => "right");

my $tf = $mw -> Entry (-width => 10, -background => "white") -> pack (-side => "left");
$tf -> insert ("end", "kao");

MainLoop();

请问是为什么?
.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!

This page is intentionally left blank
 相关帖子 我要回复↙ ↗回到正文
perl之达人请进 icky   (809 bytes , 471reads )
...just realized that i didn't install perl-tk... hash   (0 bytes , 246reads )
perl-tk version: 804.027 icky   (0 bytes , 205reads )
真是扯,同样的code放到另外一台fc5的机器上就正常了,也是804.027 icky   (34 bytes , 236reads )
oh... Bird   (25 bytes , 242reads )
佳哥这话有点跑题…… 老黑   (0 bytes , 293reads )