From: Peter E. <Pet...@at...> - 2003-05-28 13:45:24
|
Note sure why it stops when minimized, I assume it is a scope issue and is supposed to happen. Nevertheless, change your for() loop to a _Timer event and it [1] should work, [2] be more Windows-y, and [3] allow you to do other things with the window in between counts (whereas sleep will only sleep). Then, don't forget to add a Win32::GUI::Dialog() line, as well as a Main_Terminate sub to handle that event. -----Original Message----- From: Jangale V-S SPEL-TIT [mailto:v-s...@si...] Sent: Wednesday, May 28, 2003 6:48 AM To: 'per...@li...' Subject: [perl-win32-gui-users] Doevent problem in minimised window - Please help I am new to Win32::GUI . I have written a basic program (copied from examples) as below use Win32::GUI; $main = Win32::GUI::Window->new( -name => "Main", -title => "Win32-GUI: Doevents-Demo", -left => 100, -top => 100, -width => 600, -height => 400, ); sub Main_Terminate() { print "Main window terminated\n"; return -1; } $textfield = $main->AddTextfield( -name => "Textfield", -text => "have fun and more", -left => 75, -top => 150, -width => 200, -height => 40, -readonly => 1, ); $main->Show(); $textfield->Text("Processing infile..."); for ($linenr=0;$linenr<2000;$linenr++) { print "$linenr\n"; $textfield->Text("Processing line $linenr"); $main->DoEvents(); sleep 1; #body of the loop... } The problem is that when I minimise window , the counting in the for loop stops ! That is value of $linenr does not increment ! After checking I found out that program stops at Doevents function when window is minimised ! The moment I restore the minimised window, the counting proceeds ! Can somebody tell me what am I doing wrong ?? Operating system W2K Service pack 3 perl v5.6.1 Win32::GUI - 0.0.665 With Best Regards, Vidyadhar ------------------------------------------------------- This SF.net email is sponsored by: ObjectStore. If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge _______________________________________________ Perl-Win32-GUI-Users mailing list Per...@li... https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users |