|
|
|
|
复制本帖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
|
|