Hello, I need to start subroutine before MainLoop() (its a while loop) This is the sub:
--------
sub CheckTime {
$exeTime=18;
$Hour=shift(@_);
$loopStop=0;
while ($loopStop==0) {
sleep(1); # 1 = 1s
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$ZWIDGETS{'Text1'} -> insert('end',"Waiting......\n");
if ($hour==$exeTime) { $loopStop=1; $ZWIDGETS{'Text1'} -> insert('end',"Starting.....\n");}
}
return $hour;
}
----------------------------------------
And when I put it in this way, first program do the while loop and than start window:
-----------------------------------------
&CheckTime($HourGet);
MainLoop();
----------------------------------------
I need the subroutine works all the time and update Tk Text box...
I have try use the threads but Tk and threads works really bad.
Thx for help..
--------
sub CheckTime {
$exeTime=18;
$Hour=shift(@_);
$loopStop=0;
while ($loopStop==0) {
sleep(1); # 1 = 1s
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$ZWIDGETS{'Text1'} -> insert('end',"Waiting......\n");
if ($hour==$exeTime) { $loopStop=1; $ZWIDGETS{'Text1'} -> insert('end',"Starting.....\n");}
}
return $hour;
}
----------------------------------------
And when I put it in this way, first program do the while loop and than start window:
-----------------------------------------
&CheckTime($HourGet);
MainLoop();
----------------------------------------
I need the subroutine works all the time and update Tk Text box...
I have try use the threads but Tk and threads works really bad.
Thx for help..