RE: [perl-win32-gui-users] eek! =)

2002-05-28 Thread FARRINGTON, RYAN
here is a sample break from the code starts on line 162 ends on line
185.
 
sub ::btnOpen_Click {
 defined(my $win = $Win32::GUI::Loft::window{winFileDisplay}) or return(1);
 my %file1 = $win-tvwTreeView()-ItemInfo(
$win-tvwTreeView-SelectedItem() ) or return(1);
 my $file = $file1{'-text'};
 $interface-execute('check_server', $file);
 until($interface-get_state eq 'fin') {
  my $void = $win-DoEvents();
  $win-pbProgressBar()-StepIt();
  sleep(1);
 }
 $win-pbProgressBar()-SetPos(0);
 my @return_value = $interface-get_retval;
 my $msg = ;
 foreach my $line (@return_value){
  $msg = $msg . $line;
 }
 $win-reFileSelected()-Text($msg);
 
 return(1);
}

-Original Message-
From: FARRINGTON, RYAN [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 28, 2002 8:48 AM
To: 'perl-win32-gui-users@lists.sourceforge.net'
Subject: [perl-win32-gui-users] eek! =)



Using Win32::GUI and I'm having a problem with the program reporting to
windows that it is not responding. I know that it is because of the loop I
have the program in but I still want the user to work while I'm processing
in the background. I found a reference to $win-DoEvents() but as far as I
can see that works but it errors out with Use of uninitialized value in
subroutine entry at hotfix.pl line 172 Gah =( I'm starting to hate this...
I've looked at the archives but no search sucks =) Anyone have any ideas?



Re: [perl-win32-gui-users] eek! =)

2002-05-28 Thread Morbus Iff
Using Win32::GUI and I'm having a problem with the program reporting to 
windows that it is not responding. I know that it is because of the loop I 
have the program in but I still want the user to work while I'm processing 
in the background. I found a reference to $win-DoEvents() but as far as I 
can see that works but it errors out with Use of uninitialized value in 
subroutine entry at hotfix.pl line 172 Gah =( I'm starting to hate 
this... I've looked at the archives but no search sucks =) Anyone have any 
ideas?


Yup, I see this in my own scripts. From what I understand, it's equivalent 
to Win32::GUI saying hey! there are no events for me to respond to. I've 
done the requisite searching, .pm looking, and so forth, and the only 
non-destructive way I stopped the error was to add the following to my script:


  # override the warning signal, which
  # will stop thousands of DoEvent warnings
  # happening under Win32::GUI.
  BEGIN { $SIG{'__WARN__'} = sub {
 warn $_[0] unless (caller())[0] =~ /Win/; } }

Which basically says to ignore any warnings that the Win32 libraries pass 
off to your script. Of course, you'd only want to do this once you're sure 
that your code is working perfectly and flags no other warnings.




--
Morbus Iff ( i'm the droid you're looking for )
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
Tech: http://www.oreillynet.com/pub/au/779 - articles and weblog
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus