timeout wont run without a 'print'!?



Hey wondering if anyone can shed some light on this crazy issue: 

I have a simple Gtk2 perl program. I used glade to design the interface
and use Gtk2::GladeXML to render it.

The interface consists of 6 text entry widgets and a couple of buttons.

I have a timeout set up to run every second, such that the 6 text entry
widgets get a random number displayed in them.

The weird thing is: the timeout itself only runs once and then stops
after the first iteration  *unless* I put a 'print' statement in the
subroutine!?!  And then it runs fine!?!  But only with the 'print;' in
there!?!?

I dont even have to actually print anything - not even a new line! As
long as I keep a blank 'print;' statement in the timeout subroutine, it
runs fine once a second, and the text entry widgets get updated.

Its crazy!

Any ideas here?  Why should the execution of the timeout be dependent on
whether there is text output to STDOUT?!?

I can provide source if someone wants to take a look.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]