Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Perl Tk text widget printing problem

by thundergnat (Deacon)
on Nov 14, 2012 at 15:41 UTC ( #1003838=note: print w/ replies, xml ) Need Help??


in reply to Perl Tk text widget printing problem

I agree with zentara; it looks like you are feeding insert a hash. See the following test code:

use warnings; use strict; use Tk; my %w; my %hash = ( 'key1' => 'value1', 'key2' => 'value2' ); $w{mw} = MainWindow->new; $w{text} = $w{mw}->Text->pack; $w{text}->insert('end', %hash); $w{text}->insert('end', "\n\n" ); while ( my ($key, $value) = each %hash ){ $w{text}->insert('end', "$key => $value\n"); } MainLoop;
Update: (after actual code snippet was posted) You are setting yourself up for trouble by accessing private internal data structures directly. Try using the accessor methods instead.

$txt->insert('end', $worksheet->get_cell($row, $col)->value());
Update 2:blarg. fixed broken hash iterator in demo code.


Comment on Re: Perl Tk text widget printing problem
Select or Download Code
Replies are listed 'Best First'.
Re^2: Perl Tk text widget printing problem
by reaper9187 (Scribe) on Nov 14, 2012 at 17:00 UTC
    Hi...
    thanks for helping .. works like a charm.. :) :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2015-07-30 21:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls