Re: the first mouseDown message of NSWindow
Re: the first mouseDown message of NSWindow
- Subject: Re: the first mouseDown message of NSWindow
- From: Conrad Shultz <email@hidden>
- Date: Wed, 14 Dec 2011 14:37:56 -0800
On 12/14/11 2:13 PM, Torsten Curdt wrote:
> I have a custom window that where I receive mouseDown messages. Now
> the first mouseDown is always lost because it just activates the
> window.
> Here is the relevant code:
>
> https://gist.github.com/0b3b010ad675a349ce72
>
> So I was digging through the docs but I don't see a way around this.
>
> http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html
>
> But I've seen this working in other applications so I must be missing something.
> Anyone that could give me some pointers?
You could probably achieve your desired behavior with minimal
refactoring by using a custom contentView in your NSWindow, overriding
-acceptsFirstMouse: therein, and handling (mouse) events in the view
instead of the window.
There may be a view-independent way to do it that I haven't encountered;
maybe someone else will have a suggestion.
--
Conrad Shultz
Synthetiq Solutions
www.synthetiqsolutions.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden