blueberryCoffee has asked for the wisdom of the Perl Monks concerning the following question:
use Tk; my $app = new MainWindow; my $entry1 = $app->Entry()->pack(); my $entry2 = $app->Entry()->pack(); $entry1->bind('all', '<<customEvent>>' => sub{ print "entry 1" }); $entry2->bind('all', '<<customEvent>>' => sub{ print "entry 2" }); $app->Button(-text => 'gen event', -command => sub{ $app->eventGenerate('<<customEvent>>')} +)->pack(); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: 2 widgets respond to same event
by eibwen (Friar) on Apr 21, 2005 at 01:46 UTC | |
by blueberryCoffee (Scribe) on Apr 21, 2005 at 03:45 UTC | |
|
Re: 2 widgets respond to same event
by starbolin (Hermit) on Apr 21, 2005 at 01:23 UTC | |
|
Re: 2 widgets respond to same event
by japhy (Canon) on Apr 21, 2005 at 00:09 UTC |