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

Re: [pygame] pygame+threading+windows



On 31 Jul 2006 at 17:37, Lars Friedrich wrote:

> Hello,
> 
> I am trying to use pygame to display some camera images on the screen.
> It is really fine, the speed is very satisfying!
> 
> Now the program has to something besides displaying images, so I want to
> put the whole pygame-thing into a Thread. Please see the attached file
> for my first trial. On my Linux-machine this runs fine.
> 
> The problem is, when I run the program in Windows (which I have to do,
> because the hardware I have to talk to is not available in Linux), the
> pygame-window hangs. No "event" is printed to std. I have to kill the
> window explicitely with the windows-end-now dialogue. What can I do
> about it? I suspect this to be a "threading"-issue not a "pygame"-issue,
> but maybe someone here had the same problem, and maybe also a solution?
> 
The event loop must be in the same thread as that which initializes 
pygame and brings up the main window. Move everything into the run 
method and it works.

Lenard Lindstrom
<len-l@xxxxxxxxx>