Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Setting value in Tk -textvariable

by Chmrr (Vicar)
on Aug 06, 2002 at 01:18 UTC ( [id://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'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-19 21:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found