[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.
>

Yes, but what's curious is that it doesn't do that every time, just
occasionally.

> 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.
>

Thanks for the suggestion, I'll try it out. Where can I find the example?

>
>> 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.
>

I know pygame can't do it, it's too platform-specific, I thought maybe
someone reading this list maybe has it working and can give me a snippet.



Thanks for the reply Pete.