Window, thread, mouse

Just starting out? Need help? Post your questions and find answers here.
daft
User
User
Posts: 25
Joined: Fri Oct 29, 2010 10:32 am

Window, thread, mouse

Post 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?
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Window, thread, mouse

Post 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.
BERESHEIT
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Window, thread, mouse

Post 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).
daft
User
User
Posts: 25
Joined: Fri Oct 29, 2010 10:32 am

Re: Window, thread, mouse

Post 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.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Window, thread, mouse

Post by Trond »

You may also want to consider a timer event. See the documentation on AddWindowTimer() for that. It may give you more control.
Post Reply