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

Re: [pygame] App stops responding when minimized



psymaster@caths.co.uk wrote:
...than 4 fps it sometimes stops responding when it's minimized.
I check for events on every iteration so I don't know what's wrong.
what events are you expecting to get when minimized? i'm certain that windows will not pass keyboard or mouse events to a minimized app.

there's a better way to do things than the long time.wait() call. set up a repeating timer event. then have your program wait in a loop with pygame.event.wait(). this will 'SLEEP' your application until an event comes in. that means it takes no cpu time, but will still respond instantly to user input (no waiting for every 1/4 second).

look at the pygame "VGRADE" example for setting up a slow timer and drawing a new screen everytime it is triggered.


And something else, does anybody know how can I make a pygame window
"always on top" under windows without using external apps? I know it's OT.
SDL has nothing to do this. I'm afraid pygame is stuck unable to do it also.