Petras has asked for the wisdom of the Perl Monks concerning the following question:
I would expect the shell output to be the entry in $user_x, a space, and the entry in $user_y. Instead the output is consistantly the hard-coded default value of $original_x, a space, and the hard-coded default value of $original_y (please don't respond and ask if I changed the values in the Entry widgets ;~) Of course I did!).#!perl use Tk; use strict; use warnings; my $original_x = 3; my $original_y = 4; my $mw = MainWindow -> new; my $f1 = $mw -> Frame; my $user_x = $f1 -> Entry ( -textvariable => $original_x, -width => 3, ) -> pack; my $user_y = $f1 -> Entry ( -textvariable => $original_y, -width => 3, ) -> pack; $f1 -> pack; $mw -> Button ( -text => "Print Entries", -command => [\&print_entries, $user_x -> get(), $original_y], ) -> pack; MainLoop; sub print_entries { print "@_\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk -textvariable doesn't change when Entry widget changes
by jdporter (Paladin) on Sep 20, 2005 at 14:51 UTC | |
by Petras (Friar) on Sep 26, 2005 at 03:08 UTC | |
|
Re: Tk -textvariable doesn't change when Entry widget changes
by JediWizard (Deacon) on Sep 20, 2005 at 14:51 UTC | |
|
Re: Tk -textvariable doesn't change when Entry widget changes
by Util (Priest) on Sep 20, 2005 at 15:39 UTC | |
by Petras (Friar) on Sep 26, 2005 at 03:17 UTC |