开发者

cocoa mousedown on a window and mouse up in another

开发者 https://www.devze.com 2023-01-13 08:10 出处:网络
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:

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 adv开发者_如何转开发ance for your help,

Regards,


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号