banzai has asked for the wisdom of the Perl Monks concerning the following question:
foreach my $key (@keys) { $cells{$row.$i}=$mwwidgets{"sc_list"}->Label(-textvariable=>\ +$info{$key.$row},-relief=>"ridge",-width=>15)->grid(-row=>$row,-colum +n=>$i)->bind('<Double-Button-1>',sub{profile_window($currentrow)}); print $cells{$row.$i}; #$cells{10}->configure(-text=>"bla"); last if ($i==7); $i++; } $row++;
this is just a snippet from a bigger program, but i need some help with why it doesnt work. its supposed to fill the %cells with labels and grid them in the scrolled widget $mwwidgets{"sc_list"} (it's a hash of all widgets). @keys contains the keys for the %info hash, but i dont think it matters here.
the line that right now is a comment is supposed to test if it worked, but the warning tells me it cant call the method on an uninitialized value, same for the print line. the labels are being created though, they also contain the right text and the bind works. what to do?
(btw this is my first post here, no idea if i did the formatting right)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Tk: Creating label in hash
by roboticus (Chancellor) on Sep 18, 2013 at 11:21 UTC | |
Re: Tk: Creating label in hash
by Anonymous Monk on Sep 18, 2013 at 11:06 UTC | |
by banzai (Initiate) on Sep 18, 2013 at 12:41 UTC | |
Re: Tk: Creating label in hash
by Anonymous Monk on Sep 18, 2013 at 07:47 UTC |