문제

I'm using a view in a background window that I would like to click and immediately activate a mouseDown event, I currently have to click once for the view's window to activate and click again to run mouseDown. I remember having seen something like this but I haven't used XCode in almost a year and I can't find it anywhere.

Thanks for the help.

도움이 되었습니까?

해결책

Found it!

In case anyone runs into this problem all you need to do is override acceptsFirstMouse:

In your view class just add the method:

- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent {
return YES;
}

Super simple stuff.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top