Hi,
You are deleting whatever is in $text0 till the énd'.
Comment that out and you will see all the values of $i.

...

sub prg{
    for (my $i=0;$i<20;$i++){
   #   $text0->delete('0.0','end');    # commented out
       $text0->insert('end',"$i\n");
   #   sleep 1;
    }
 }

Bye,
Zeray



|---------+------------------------------------------------->
|         |                                                 |
|         |                                                 |
|         |                                                 |
|         |                                                 |
|         |                                                 |
|         |    [EMAIL PROTECTED]                          |
|         |                                                 |
|         |    Sent by:                                     |
|         |    [EMAIL PROTECTED]|
|         |    .com                                         |
|         |                                                 |
|         |    2005-06-01 10:06 AM                          |
|         |    Please respond to synoptic                   |
|---------+------------------------------------------------->
  
>------------------------------------------------------------------------------------------------------------------------------|
  |                                                                             
                                                 |
  |           To:   perl-win32-users@listserv.ActiveState.com                   
                                                 |
  |           cc:   (bcc: Zeray Abraha/WLR/SC/PHILIPS)                          
                                                 |
  |           Subject:    perl Tk question                                      
                                                 |
  |                                                                             
                                                 |
  |           Classification:                                                   
                                                 |
  |                                                                             
                                                 |
  |                                                                             
                                                 |
  
>------------------------------------------------------------------------------------------------------------------------------|




Hi All!
In the following snippet:
====
use strict;
use Tk;
require Tk::LabFrame;
my $top = new MainWindow;
my $bar=$top->LabFrame(-label => 'buttons bar');
$bar->pack;
my $exi=$bar->Button(-command=>\&exi,-text=>'exit');
$exi->pack(-side=>'left');
my $prg=$bar->Button(-command=>\&prg,-text=>'prg');
$prg->pack(-side=>'left');
my $fr=$top->LabFrame();
$fr->configure(-height=>'5',-width=>"30");
$fr->pack(-fill=>'none');
my $text0=$fr->Text();
$text0->configure(-height=>'10',-width=>"20");
$text0->pack(-side=>'top',-fill=>'none');
MainLoop;
sub exi{
             $top->destroy;
             }
sub prg{
                         for (my $i=0;$i<20;$i++){
                                     $text0->delete('0.0','end');
                                     $text0->insert('end',"$i\n");
             sleep 1;
                         }
             }
====
When executing this snippet
I see in text0 only the last $i /in for cycle/
What I  must add to prg code
in order to see all cosequtive values of $i ?
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to