Frage

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.

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top