Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2014-09-17 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (56 votes), past polls