views:

24

answers:

1

Hello,

I am developping a Cocoa application and I have a special need. In my main window, when I mouse down on a certain area, a new window (like a complex tooltip) appears. I want to be able to do: - mouse down on the main window (mouse button stay pressed) - user moves the mouse on the "tooltip" window and mouseup on it.

My issue is that the tooltip window does nto get any mousevent until the mouseup.

How can I fix this?

Thanks in advance for your help,

Regards,

+1  A: 

And it won't since mouse is tracked by the main window. However, you can process mouseUp in the main window, transform click coordinates into the desktop space, get tooltip window frame and check whether the click occurred on the tooltip. After that, you can send a message to the tooltip window manually.

Or you can try to find another way to implement the final goal :) It is usually better to follow the rules, in this case - mouse tracking.

Gobra
Thanks for your answer, event "forwarding" seems to be a good option. How do you send a mouse event from one window to another one?
AP
NSWindow has a -sendEvent: method.
NSResponder