If anyone has the Learning Perl/Tk book, I am working through the example on
page 65.  I will include the script following.

My problem is that this routine as in the book doesn't work.  I can Disable
the Exit button but re-enabling it doesn't work.  My print statement returns
the following:

ARRAY(0x1814af8)
ARRAY(0x1814ad4)

Obviously, I get the first when I disable the Exit button, the second when I
attempt to re-enable it.  The problem is that my Exit button is never
re-enabled.  If I continue to hit the 'Enable/Disable Exit' button, those
two value alternateendlessly.  So, I don't know where the problem is found.

Any thoughts,

TIA,

Adam Frielink
Tyco Plastics


----
use Tk;

$mw = new MainWindow;
$mw->title("Button Manipulation");

my $exit_b = $mw->Button(-text => "Exit",
                -command => sub { exit })->pack;

$var = "Disable Exit";
$mw->Button( -textvariable => \$var,
             -command => sub { my $state = $exit_b->configure(-state);
                               print "$state";   # I added this line for
curiosity
                               if ($state eq "disabled") {
                                 $exit_b->configure(-state => 'normal');
                                 $var = "Disable Exit";
                               } else {
                                 $exit_b->configure(-state => 'disabled');
                                 $var = "Enable Exit";
                               }})->pack;
MainLoop;

------

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to