in reply to Re^4: disable button
in thread disable button
I'm not exceptionally clear on why it has this effect, but look at the following example. Your way still dosn't pass the button object, while the second way does.
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = tkinit; my $push; # dosn't work $push = $mw->Button(-text => "test ", -command =>[\&save_parms,$push,'somedata'] )->pack(); # works my $push1 = $mw->Button(-text => "test1 ", )->pack(); $push1->configure( -command =>[\&save_parms,$push1,'somedata']); MainLoop; sub save_parms { print "@_\n"; }
|
|---|