Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Setting value in Tk -textvariable

by Chmrr (Vicar)
on Aug 06, 2002 at 01:18 UTC ( #187879=note: print w/ replies, xml ) Need Help??

in reply to Setting value in Tk -textvariable

Tk's not the one complaining at you; perl is complaining that you're not doing what you think you're doing. If it's saying that it can't use a string as a hash reference, that means that $move isn't a hash reference, it's a string. Somewhere along the ways, you've gotten confused as to what's in what variable. I'd suggest a proper application of Data::Dumper to the variables in question to figure out what's going on.

Here's a crude and fast example of setting a label's value to something in a hash reference:

use Tk; my $main = tkinit; my $value = "Foo!"; my $href = {bar=>baz}; $main->Label(-textvariable=>\$value)->pack; $main->after(5000,sub{$value=$$href{bar}; $main->update;}); $main->MainLoop();

perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'

Comment on Re: Setting value in Tk -textvariable
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://187879]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2015-11-28 15:42 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (743 votes), past polls