views:

212

answers:

1

Hello,

I have an NSView subclass that gets initialized with an OpenGL context and has a bunch of mouse event handling (onMouseDown, etc...). I have an app using it which has a main Cocoa window that contains the view and all the mouse events are working properly.

However, I'm trying to use it now in another app where i have a secondary window that pops open and gets initialized with the view and while i get mouse moved evets, I don't seem to get any mouse click (or keyboard for that matter) events whatsoever.

When I click and drag on the view, the entire window moves, which im guessing has to do why i dont get any mouse events. I have acceptsFirstResponder and acceptsFirstMouse returning YES and even have hitTest returning self for good measure.

Do you guys have any ideas what could be wrong?

+7  A: 

You need to return NO from -mouseDownCanMoveWindow in your NSView subclass.

Rob Keniger
Great that fixed it!
toastie

related questions