Page 1 of 1

Window, thread, mouse

Posted: Wed Feb 02, 2011 1:27 pm
by daft
I have a threaded window and its main loop stops working the moment the mouse cursor leaves the window. Immediately resumes when the mouse returns. What could be the problem?

Re: Window, thread, mouse

Posted: Wed Feb 02, 2011 2:13 pm
by netmaestro
Could be a stuck float in the carburetor or perhaps your timing chain is worn. Without some code to look at it's impossible to say.

Re: Window, thread, mouse

Posted: Wed Feb 02, 2011 2:20 pm
by Trond
As I have said before, it is my opinion that you should only have one main loop in the entire program, and all GUI stuff should be handled from the same thread. It's not necessary, but it's a good rule of thumb to avoid head scratching.

A shot it in the dark at your problem: Replace your WaitWindowEvent() with WaitWindowEvent(10).

Re: Window, thread, mouse

Posted: Wed Feb 02, 2011 2:47 pm
by daft
A shot it in the dark at your problem: Replace your WaitWindowEvent() with WaitWindowEvent(10).
A shot it in the dark has been of absolute precision. Thank you very much.

Re: Window, thread, mouse

Posted: Wed Feb 02, 2011 3:18 pm
by Trond
You may also want to consider a timer event. See the documentation on AddWindowTimer() for that. It may give you more control.