I have been trying to create a GUI for my IRC bot, but no matter what I
try, the GUI freezes once it connects. I know that the GUI has a loop and
that NET::IRC has it's own loop; therefore I have used NET::IRC's
do_one_loop and WIN32::GUI's DoEvents. I've even tried lagging the irc loop
to get the window to update reguraly, but it didn't work either, here is my
program's main loop:
while (!$terminate) {
$window->DoEvents();
if ($loop > 90000 && $connected) {
$irc->do_one_loop();
$loop = 0;
}
else { $loop++; }
}
Assuming there is no logic issues with the above (add a couple of print
statements to see if you get to DoEvents) then the only thing I can think of
is that NET::IRC is doing a blocking call, resulting in a frozen GUI. If
this is the case, then you are best moving to a threaded solution, were one
thread deals the GUI, with the other dealing with NET::IRC.
Cheers,
jez.