The following Code demonstrates the problem.
Instructions:
Run the code.
Click on the button.
Use the scroll bar to scroll up.
Notice that the text all runs together.

----------------------------------------------
use strict;
use warnings;
use Win32::GUI;
my $MainTitle = "Pauto Script Runner";
my $MainWidth=300;
my $MainHeight=300;
my $MainTop=300;
my $MainLeft=300;
our $MainWindow = new Win32::GUI::Window(
    -name   => "MainWindow",
    -text   => $MainTitle,
    -width  => $MainWidth,
    -height     => $MainHeight,
    -minsize  => [175, 120],
    -topmost => 1,
    -top        => $MainTop,
    -left       => $MainLeft,
        );
our $Test=$MainWindow->AddTextfield(
        -name   => "ABC",
        -text   => "This is is a test ($MainWidth,$MainHeight)\r\n",
        -readonly=>1,
        -multiline=>1,
        -top=>0,
        -left=>0,
        -width=>$MainWidth,
        -height=>$MainHeight-60,
        -vscroll=>1,
        -addstyle       => 0x1000,  #ES_WantReturn - allows the enter
key to work
        );
$MainWindow->AddButton(
        -name => "MyButton",
        -text => "ClickMe",
        -height  => 20,
        -pos  => [$MainWidth-100,$MainHeight-57  ],
        );
$MainWindow->Show();
Win32::GUI::Dialog();
sub MainWindow_Minimize {return 0;}
sub MainWindow_Maximize {return 0;}
sub MainWindow_Terminate {return -1;}
sub MyButton_Click{
        my $now=localtime();
        my $str="$now\r\nHello This is a test of the emergency broadcast
system and is only a test. Should this cause problems please report it
to the authorities.";
        my $mstr="$str"x10;
        $Test->Append($mstr);
        }
exit(0);
----------------------------------------------

-----Original Message-----
From: Robert May [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 27, 2005 11:56 AM
To: Lloyd, Steve
Cc: perl-win32-gui-users@lists.sourceforge.net
Subject: [SPAM] - Re: Readonly TextEdit redraw problem. [Was: otther
thngs] - Bayesian Filter detected spam


Steve,

If you can post a short example that exhibits the behaviour on your 
system, then I'd be happy to try it and see if I get the same behaviour 
here.

Rob.

Lloyd, Steve wrote:
> I have noticed that if scrolling in a Win32::GUI::Textfield set to 
> readonly does not refresh the text properly.. Has anyone else seen 
> this?  It this something that could be fixed before the next release?
> 
> Steve
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] on behalf of 
> Robert May
> Sent: Thu 7/21/2005 6:23 PM
> To: Frazier, Joe Jr
> Cc: perl-win32-gui-users@lists.sourceforge.net
> Subject: [SPAM] - Re: [win32gui] RE: [perl-win32-gui-users] Next
release [Was: System Tray problem after upgrade to v1.02 from v1.00] -
Bayesian Filter detected spam
>  
> Frazier, Joe Jr wrote:
> 
> 
>>>I would have though that targeting a bug-fix only release for
>>>a month's time might be realistic.  I'd like to get the 
>>>following done:
>>>- fix as many of the trackers as possible
>>>- get all the current sample code to work properly
>>>- include all the examples from the tutorial (and check that 
>>>they all work :-), fixing the tutorial as necessary
>>>- work on the test suite
>>>- get a semi-decent web-page up as our Homepage at SourceForge.
>>>   
>>>
>>
>>
>>Hey, if possible, can someone come up with an example of using 
>>Win32::GUI with one or more background worker thread(s)?
>>
> 
> Here's my threads example that I'm working on - funnily I was just
> discussing it off-list.
> 
> #!perl -w
> use strict;
> use warnings;
> 
> use Win32::GUI;
> 
> use threads;
> use Thread::Queue;
> 
> # Win32::GUI is not very thread friendly, so ensure the worker thread 
> # is created before you create any Win32::GUI objects print "Boss: 
> Starting\n"; print "Boss: creating queues\n";
> my $qd = Thread::Queue->new();
> my $qu = Thread::Queue->new();
> print "Boss: creating worker thread\n";
> my $t = threads->new(\&worker);
> 
> my $working = 0; # set by the boss when the worker is working my 
> $instruction = 1;
> 
> my $W = new Win32::GUI::Window (
>       -pos => [100,100],
>       -size => [200,200],
>       -name => "MW",
> ) or die "Creating main window";
> 
> $W->AddButton (
>       -text => "Execute Thread",
>       -name => "But1",
> ) or die "Creating Button1";
> 
> # Timer is used to read results back from worker thread $W->AddTimer( 
> "Tim1", 1000) or die "Creating Timer";
> 
> $W->Show();
> Win32::GUI::Dialog();
> 
> # tidy up
> print "Boss: Sending kill to worker\n";
> $qd->enqueue(undef);
> print "Boss: About to wait for worker\n";
> my $r = $t->join();
> print "Boss: worker completed after executing $r instructions\n";
> 
> exit(0);
> 
> sub But1_Click
> {
>       $W->But1->Disable();
>       print "Boss: Button Clicked: starting worker ($instruction)\n";
>       $qd->enqueue($instruction++);
>       $working = 1;
> 
>       return 1;
> }
> 
> sub MW_Terminate
> {
>       if($working) {
>               print "Boss: Can't exit while worker is working\n";
>               return 0;
>       }
> 
>       return -1;
> }
> 
> sub Tim1_Timer
> {
>       #print "Boss: timer went off\n";
> 
>       if(my $val = $qu->dequeue_nb()) {
>               print "Boss: worker finished instruction $val\n";
>               $W->But1->Enable();
>               $working=0;
>       }
> 
>       return 1;
> }
> 
> # The worker thread entry point
> sub worker
> {
>       print "Worker: starting\n";
>       my $count = 0;
> 
>       print "Worker: waiting for instructions\n";
>       while(my $num = $qd->dequeue()) {
>               print "Worker: got instruction $num\n";
>               $count++;
>               for my $i (0..5) {
>                       print "Worker:doing work ($i)\n";
>                       sleep(1);
>               }
>               print "Worker: Done instruction $num\n";
>               $qu->enqueue($num);
>       }
> 
>       print "Worker: Terminating after $count instructions\n";
>       return $count;
> }
> __END__
> 
> It wouldn't take much to turn it into a proper example.  Does this 
> seem like the right way to do it?
> 
> 
> 
>>Something I would like to see for example would be a "list" of sites 
>>in say a Win32::GUI::Grid (or listview at worst case, if we want to
not use extensions in the examples) with one or more threads that
periodically(using a 20 second timer for example) connect to the sites
and measure response times to populate another column on the Grid.
>> 
>>
> 
> Interesting idea - again it wouldn't be very difficult
> 
> 
>>I have seen one or two examples on the list for using threads, but it 
>>would be nice to have one in the core distribution.
>>
>>Also, has anyone created a PPM for this release yet?  If so, is it 
>>available on a repository, or only on the sourceforge site for
download?
>> 
>>
> 
> There's a PPM in the bribes repository
> (http://www.bribes.org/perl/ppmdir.html#ap)
>   |ppm install http://www.bribes.org/perl/ppm/Win32-GUI.ppd
> (I haven't tested it)
> 
> I am also in dialog with ActiveState, and it *should* get in their
> repository on their next build cycle (which was supposed to be last 
> Tuesday night, but it doesn't look like it happened yet)
> 
> Rob.
> |
> 
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies

> from IBM. Find simple to follow Roadmaps, straightforward articles, 
> informative Webcasts and more! Get everything you need to get up to 
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> Perl-Win32-GUI-Users mailing list 
> Perl-Win32-GUI-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> 
> 
> This email, and any files or previous email messages included with it,

> may contain confidential and/or privileged material. If you are not 
> the intended recipient please contact the sender and delete all 
> copies.
> 

Reply via email to