Search code examples
objective-cmacosnsmatrixnsbuttoncell

setAction: Always Called with mouseUp


I have in my mac app an NSMatrix made up of NSButtonCells. I do this:

[matrix setAction:@selector(matrixbutton:)];

However this is always called when the user releases the mouse click. Is it possible to alter this so it is called as soon as the mouse goes down?

Thanks.


Solution

  • No; controls on the Mac activate on mouse-up, not mouse-down. (Otherwise, it's impossible to distinguish between a click and a drag, for instance, since both begin with a mouse-down.)