Petras has asked for the wisdom of the Perl Monks concerning the following question:
#!perl use warnings; use strict; use Tk; my $mw = MainWindow->new; $mw->title("Checkbutton Grid"); my $x_size = 5; my $y_size = 5; my %b_name; for (my $x=0; $x<$x_size; ++$x) { for (my $y=0; $y<$y_size; ++$y) { $mw -> Checkbutton ( -activebackground => "white", ) -> grid ( -row => $x, -column => $y ); } } MainLoop;
$mw -> Checkbutton ( -activebackground => "white", -command => &react ("\"$x\_$y\""); -command => print "hi" # <= this is a change ) -> grid ( -row => $x, -column => $y ); .... sub react { print "$_[0]\n"; }
-command => [\&display, $x, $y]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl/Tk : Trouble with commands and Checkbuttons
by pg (Canon) on Sep 16, 2005 at 06:03 UTC | |
|
Re: Perl/Tk : Trouble with commands and Checkbuttons
by spiritway (Vicar) on Sep 16, 2005 at 05:34 UTC | |
by pg (Canon) on Sep 16, 2005 at 06:05 UTC | |
by Tanktalus (Canon) on Sep 16, 2005 at 14:52 UTC | |
|
Re: Perl/Tk : Trouble with commands and Checkbuttons
by Sandy (Curate) on Sep 16, 2005 at 15:28 UTC |