in reply to perl tk [menu accelerator]
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = tkinit; my $t = $mw->Text->pack; my $b = $mw->Button( -text => 'Press Me', -command => \&foo, )->pack; + $mw->bind('<Control-a>', [$b => 'invoke']); MainLoop; sub foo { $t->insert('end', "Thank you\n"); $t->see('end'); }
|
|---|