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

Re: [pygame] Display Update Trouble After Focus Loss



Thanks a million Nathan (and everyone else who took a look at this), pygame.event.pump() solved the problem.

Much appreciate,

mark


On Thu, Sep 11, 2008 at 1:00 PM, Nathan Whitehead <nwhitehe@xxxxxxxxx> wrote:
On Thu, Sep 11, 2008 at 8:45 AM, Mark S <slygroups@xxxxxxxxx> wrote:
> I'm having some trouble with the pygame display.  While my program is
> running it will spend a chunk of time continually animating in a tight loop.
>  If during this time the window losses focus (I click on another window, for
> example) the display will stop updating. The program continues running and
> when it reaches the end of the animation loop it will wait for the user to
> hit a key, at which point the display with begin updating again.

I would try adding pygame.event.pump() calls within the tight
animation loop (once per frame maybe).  That will allow pygame to
process windowing events during the animation.
--
Nathan Whitehead