|
|
|
|
 shortkey - take [ 2004-12-14 17:39 | 1,198 byte(s)]
 Re: shortkey - ACp [ 2004-12-15 08:36 | 292 byte(s)]
|
|
|
|
[Original]
[Print]
[Top]
|
all,
我想用perl/tk 写个录入数据的小程序, 请问怎么设置快捷键呢,
比如,
use Tk;
my $mw = MainWindow -> new();
$mw ->Label( -textvariable => $greeting,
-relief => 'groove' ) -> pack ( -fill => 'x');
$mw->Button( -text => 'Hello',
-command => [&say_hello, 'Hello'])
-> pack(-side => 'left');
$mw->Button( -text => 'Bonjour',
-command => [&say_hello, 'Bonjour'])
-> pack(-side => 'left');
$mw->Button( -text => 'Guten Tag',
-command => [&say_hello, 'Guten Tag'])
-> pack(-side => 'left');
$mw->Button( -text => 'Exit',
-command => sub{exit})
-> pack(-side => 'left');
MainLoop;
sub say_hello {
my ($greet) = @_;
$greeting = $greet;
}
怎么给每个按钮设置一个快捷键,
thanks
regards,
|
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
my $win = MainWindow->new();
$win->bind( '<q>' => &deletefile );
$win->bind( '<Control-s>' => &savefile );
|
|
|
----
OnlyPc
|
|
[Original]
[Print]
[Top]
|
|
|