Smile-n-Nod has asked for the wisdom of the Perl Monks concerning the following question:
If %top_hash and %hash are shared (as above), this script displays an Entry widget which contains "Original". If those hashes are not shared, the Entry widget display "Changed." Why doesn't the Entry widget update its display when I set -textvariable to a reference to a shared hash?use threads; use threads::shared; use Tk; # If these two hashes are shared (as below), the Entry widget displays # "Original"; if they are not shared, the widget displays "Changed". # %top_hash; # %hash; share(%top_hash); share(%hash); $top_hash{A} = \%hash; $top_hash{A}{B} = 'Original'; $t = MainWindow->new()->Scrolled('Text')->pack(); $e = $t->Entry(-textvariable => \$top_hash{A}{B}); $t->windowCreate('end', -window => $e); $t->insert('end', "\n"); $top_hash{A}{B} = 'Changed'; MainLoop;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: perl/Tk Entry widget displays wrong value when -textvariable is shared
by zentara (Archbishop) on Sep 02, 2010 at 17:30 UTC |
Back to
Seekers of Perl Wisdom