Re^2: Perl::Gtk2, Looking for a Widget Similar to HourGlassby mmartin (Monk)
|on Jul 22, 2013 at 20:09 UTC||Need Help??|
Hey Monks, finally got a solution to work.
I decided to go with using the GIF image instead of the ProgressBar and running the Background Job using
the "Proc::Background" Module.
The code below is what will happen when you press the "Submit" button in my program. Basically you click
submit then the function/sub below gets executed. Inside this Function my Pop-Up window gets ran, which contains
the GIF image I mentioned before. Then the Background Job gets started, and I use a while loop to continuously check
if the Job is still "alive". Inside that while loop is another while loop that causes Gtk2 to continue processing
while there are still events to be ran, so that causes the GIF image to continue "spinning". Otherwise, without the
INNER while loop the GIF image inside the popup would pause/stop completely until the OUTER while loop had finished
executing because of the "sleep" or "usleep" commands which cause Gtk2 to pause.
So anyway... Thanks guys for all your help with this... Much Appreciated!
I forgot to mention, the reason I use the usleep() command instead of just "sleep 1;" or something like that is because there would
be a slight pause in the GIF image on every loop inside the while loop. So by using the usleep command it loops so quickly that you
cannot notice that it is pausing or not...