Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Refresh text widget

by ChOas (Curate)
on Mar 20, 2002 at 07:53 UTC ( #152932=note: print w/ replies, xml ) Need Help??


in reply to Refresh text widget

Hi!

First I would like to advice you to use

#!/usr/local/bin/perl -w use strict;
Then we`ll talk further.. the first thing you`ll probably
see is that your program won`t run because Line is not
declared, and when you declare it, please do not do it
within the else statement, because that will make it too
local to insert in your widget.

But, like I said, use strict, and -w, fix the errors, and
see if that helps, we`ll take it from there, okay ?

GreetZ!,
    ChOas

print "profeth still\n" if /bird|devil/;


Comment on Re: Refresh text widget
Download Code
Re: Re: Refresh text widget
by Anonymous Monk on Mar 20, 2002 at 09:27 UTC
    OKAY ... thank you for the advice to use strict (which is in the original code for this extracted example). I have modified this example code with the appropriate lines. It still works in the same undesired manner. Any hints towards what the real issue is?
    #!/usr/local/bin/perl -w use strict; use Tk; my $line = ""; my $submain = MainWindow->new(); my $status = $submain->Button(-text => 'Click to Clear', -command => sub {$submain->destroy;} ); $status->pack; my $text1 = $submain->Text ('-width'=>100, 'height'=>20); $text1->pack(-side => 'left', -fill => 'y'); $text1->insert('end', "start\n"); $text1->pack; for(my $loop=0; $loop <= 3; $loop++ ) { sleep 1; print "$loop\n"; if ( $loop == 1 ) { $line = "$loop case 1\n"; } elsif ( $loop == 2 ) { $line = "$loop case 2\n"; } else { $line = "$loop something else\n"; } $text1->insert('end', "$line"); $text1->pack; } MainLoop();

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://152932]
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-07-29 07:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls