1. RE: On the edge.......
- Posted by Derek Parnell <ddparnell at bigpond.com> Mar 15, 2001
- 412 views
Hi, the main problem is that when an event handler starts running, all other events are blocked until the event handler finishes. In your case, once you detect the mouse-down event and "do something", while that something is doing its stuff, the mouse-up event is blocked, waiting for you to finish doing something! That's why we added the doEvents() routine in win32lib. Using the newer version of the library try something like this... --------------- integer StopIt procedure dosomething() StopIt = False -- Loop around until I'm signalled to stop. while StopIt = False do doEvents(0) -- allow some window events to get through. . . . what ever . . . end while end procedure procedure test_mouse(integer event, integer x, integer y ) if event = WM_LBUTTONDOWN then -- start do my thing. dosomething() elsif event = WM_LBUTTONUP then -- signal that I have to stop now. StopIt = True end if end procedure onMouse[ Win ] = routine_id("test_mouse") --------------------- cheers, Derek